Solved Cannot build libreoffice

FreeBSD-12.1p10

I require the Base component of LibreOffice (LO). This is disabled in the packaged version of LibreOffice (JAVA==NO, PGSQL==NO). To obtain this feature I tried building a local version of LO using Poudriere and enabling those options.

The build required 300+ ports and did not complete. There are two failed ports and 10 skipped. The two failed are harfbuzz-icu and openjdk11.

harfbuzz-icu failed for this reason:

Code:
[65/88] c++ -Isrc/libharfbuzz-subset.so.0.20702.0.p -Isrc -I../src -I. -I.. -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++11 -fno-exceptions -fno-rtti -O3 -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -DHAVE_CONFIG_H -O2 -fstack-protector-strong -fno-strict-aliasing -fPIC -Wno-non-virtual-dtor -MD -MQ src/libharfbuzz-subset.so.0.20702.0.p/hb-subset.cc.o -MF src/libharfbuzz-subset.so.0.20702.0.p/hb-subset.cc.o.d -o src/libharfbuzz-subset.so.0.20702.0.p/hb-subset.cc.o -c ../src/hb-subset.cc
FAILED: src/libharfbuzz-subset.so.0.20702.0.p/hb-subset.cc.o
c++ -Isrc/libharfbuzz-subset.so.0.20702.0.p -Isrc -I../src -I. -I.. -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++11 -fno-exceptions -fno-rtti -O3 -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -DHAVE_CONFIG_H -O2 -fstack-protector-strong -fno-strict-aliasing -fPIC -Wno-non-virtual-dtor -MD -MQ src/libharfbuzz-subset.so.0.20702.0.p/hb-subset.cc.o -MF src/libharfbuzz-subset.so.0.20702.0.p/hb-subset.cc.o.d -o src/libharfbuzz-subset.so.0.20702.0.p/hb-subset.cc.o -c ../src/hb-subset.cc
c++: error: unable to execute command: Killed
c++: error: clang frontend command failed due to signal (use -v to see invocation)
FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1)
Target: x86_64-unknown-freebsd12.1
Thread model: posix
InstalledDir: /usr/bin
c++: note: diagnostic msg: PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the crash backtrace, preprocessed source, and associated run script.
c++: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
c++: note: diagnostic msg: /tmp/hb-subset-c94cc7.cpp
c++: note: diagnostic msg: /tmp/hb-subset-c94cc7.sh
c++: note: diagnostic msg:

********************
ninja: build stopped: subcommand failed.
*** Error code 1

Stop.
make: stopped in /usr/ports/print/harfbuzz-icu
=>> Cleaning up wrkdir
===>  Cleaning for harfbuzz-icu-2.7.2
build of print/harfbuzz-icu | harfbuzz-icu-2.7.2 ended at Tue Oct  6 22:16:43 EDT 2020
build time: 00:06:05
!!! build failure encountered !!!

The directory /usr/local/poudriere/jails/freebsd_12-1x64/tmp/ is empty so providing the requested files in a bug report is not possible.

harfbuzz-icu failed for this reason:

Code:
gmake[3]: *** Waiting for unfinished jobs....
c++: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
c++: warning: argument unused during compilation: '-static-libgcc' [-Wunused-command-line-argument]
gmake[4]: Leaving directory '/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.8-10-1/make/hotspot'
gmake[3]: Leaving directory '/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.8-10-1'

ERROR: Build failed for target 'images' in configuration 'bsd-x86_64-normal-server-release' (exit code 2)
gmake[3]: Entering directory '/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.8-10-1'

=== Output from failing command(s) repeated here ===
* For target jdk_modules_java.base__the.java.base_batch:

* All command lines available in /wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.8-10-1/build/bsd-x86_64-normal-server-release/make-support/failure-logs.
=== End of repeated output ===

No indication of failed target found.
Hint: Try searching the build log for '] Error'.
Hint: See doc/building.html#troubleshooting for assistance.

gmake[3]: Leaving directory '/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.8-10-1'
gmake[2]: *** [/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.8-10-1/make/Init.gmk:305: main] Error 2
gmake[2]: Leaving directory '/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.8-10-1'
gmake[1]: *** [/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.8-10-1/make/Init.gmk:186: images] Error 2
gmake[1]: Leaving directory '/wrkdirs/usr/ports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.8-10-1'
*** Error code 1

Stop.
make: stopped in /usr/ports/java/openjdk11
=>> Cleaning up wrkdir
===>  Cleaning for openjdk11-11.0.8+10.1
build of java/openjdk11 | openjdk11-11.0.8+10.1 ended at Tue Oct  6 22:16:50 EDT 2020
build time: 00:07:39
!!! build failure encountered !!!

Now, the interesting thing in this is that while openjdk11-11.0 is available as a pre-built binary harfbuzz-2.7 is not.

I am clearly not in a position to deal with such errors.
How does one proceed?
 
How much free RAM/swap do you have on the machine you are trying to build on? In the first log the compiler being killed might very well just mean the machine was running out of RAM. I can't really speak for libharfbuzz-icu but some ports easily need 8GB of RAM to build.

The second log is inconclusive. As i read it it's cut off before showing the actual error that caused the failure.
 
How much free RAM/swap do you have on the machine you are trying to build on? In the first log the compiler being killed might very well just mean the machine was running out of RAM. I can't really speak for libharfbuzz-icu but some ports easily need 8GB of RAM to build.

sysctl hw | egrep 'hw.(phys|user|real)'
hw.physmem: 17064009728
hw.usermem: 3977068544
hw.realmem: 17179869184

However, Poudriere successfully built this port when it was submitted as a stand-alone build.

The second log is inconclusive. As i read it it's cut off before showing the actual error that caused the failure.

I am trying to build this as a stand-alone job as well to see if that makes a difference.

UPDATE openjdk11 also successfully built when submitted by itself.
 
sysctl hw | egrep 'hw.(phys|user|real)'
hw.physmem: 17064009728
hw.usermem: 3977068544
hw.realmem: 17179869184

Well, thanks i guess. I hope you don't mind that i am to lazy to convert this to actual GB values.

However, Poudriere successfully built this port when it was submitted as a stand-alone build.

To be honest i have practically no experience with Poudriere. If it's building multiple ports at once it might pose a problem though as those 8GB+ of RAM (in the extreme case) would actually be per port so even if you have more than that it might still run out.
 
And that is exactly the reason, why i have different/separate files with ports to build.
ports01base.txt
ports02network.txt
ports03web.txt
etc......
especially the „big“ ones (LLVM, rust) i do in a run of its own, since you cannot rely on PRIORITY BOOST (at least it seems to me that way).
yes, might look like wasted ressources, but ..... *shrug*
 
And that is exactly the reason, why i have different/separate files with ports to build.
ports01base.txt
ports02network.txt
ports03web.txt
etc......
especially the „big“ ones (LLVM, rust) i do in a run of its own, since you cannot rely on PRIORITY BOOST (at least it seems to me that way).
yes, might look like wasted ressources, but ..... *shrug*

When I started this I had no idea that rebuilding libreoffice was going to require 385 packages.
 
Depending on your installation, i'd analyze which "target"-port has what dependencies, that overlap with other ports you want to build, and build those dependencies in its own run before actually building the "target"-ports.
The "classics" being the build- and runtime dependencies (LLVM, rust, gcc, cmake, perl etc.).
As i said: I've built separate files for groups of packages.
e.g.: in my file "ports01base.txt" i have pkg, sudo, nano and some "biggies" (LLVM and perl to name two), especially since the other ports in that file are not dependant on those).
Take care that you "respect" the order of building. it makes no sense putting a dependency, e.g. "rust" in a file you intend to build after building "firefox".....

Oh, and install/setup devel/ccache. it speeds up building by a rather huge scale
 
May I ask if there is a reason why LibreOffice for pkg is build without JRE?
OpenOffice pkg is built with JRE and it enables some extensions I'm interested in using.
And / or where is the best place to ask that question?
Thanks.
 
May I ask if there is a reason why LibreOffice for pkg is build without JRE?
OpenOffice pkg is built with JRE and it enables some extensions I'm interested in using.
And / or where is the best place to ask that question?
Thanks.

Do you have built it with this option on?

JAVA=off: Add Java support (XML filters, macros, DB connections)
 
What version of OpenJDK do you want LO to be built against? I chose 11. But there are multiple options and as far as I am aware a build against one requires that specific JRE be installed. If one is using 12, 13, 14, or 15 then a LO built against 11 would require two JREs be installed . And that does lead to complications as I can testify from painful personal experience. So, my guess is that the maintainer took the position that anyone who actually NEEDed LO with Java enabled would likely have (or could rapidly acquire) the technical competence to build their own.

The only reason that I needed Java was to run Base and that requires other non-default options be set as well. So I was compelled to buid my own anyway.
 
What version of OpenJDK do you want LO to be built against? I chose 11. But there are multiple options and as far as I am aware a build against one requires that specific JRE be installed. If one is using 12, 13, 14, or 15 then a LO built against 11 would require two JREs be installed . And that does lead to complications as I can testify from painful personal experience. So, my guess is that the maintainer took the position that anyone who actually NEEDed LO with Java enabled would likely have (or could rapidly acquire) the technical competence to build their own.

The only reason that I needed Java was to run Base and that requires other non-default options be set as well. So I was compelled to buid my own anyway.
Thanks for the reply - good question.
When I look at OpenOffice (which is supposed to be the same base, etc) it seems to be built with
CRASHDUMP : off
CUPS : on
DBGUTIL : off
DEBUG : off
GNOME : on
GNOMEVFS : off
MMEDIA : on
MYSQL : off
PDFIMPORT : off
REPORT_BUILDER : off
SDK : off
WIKI_PUBLISHER : on
But it does allow Java to be chosen in Options - and in my installation it chooses OpenJDK 11.0.9, and doesn't give me any other choices.
So I guess I'm puzzled at the two approaches - there is obviously something I don't understand here.
In my case I find OpenOffice can enable Java - and thus the extensions I'm after for writing documents, but it cannot print pages with complex graphics - so I'm forced to switch between the two.
I'd rather not do that.
 
FWIW, I've decided to stick with OpenOffice.
For me, it has better UIs, and is better integrated with JRE - which I use.
The printing / graphics issues I've decided to work around - that's less hassle and more reliable than the alternative of weaving my own LO.
Maybe with time, OO will get up to date.
Anyway, OO is a very reliable application suite and does what I need it to do - so I'll stick with it.
Thanks to those who helped with my original question.
 
Back
Top