Re: www/firefox and mail/thunderbird fail to build due to missing makefile variable

From: Edward Sanford Sutton, III <mirror176_at_hotmail.com>
Date: Fri, 27 Dec 2024 23:54:57 UTC
On 12/27/24 12:37, Philipp Ost wrote:
> Am 27.12.2024 um 18:38 schrieb Philipp Ost:
>> Hi everyone,
>>
>> both www/firefox and mail/thunderbird fail to build on a freshly 
>> installed 14.2-STABLE/amd64 with a similar error:
>>
>> [firefox-133.0.3,2]
>> ----8<----
>> [...]
>> gmake[2]: Leaving directory '/usr/ports/www/firefox/work/.build'
>> gmake[1]: *** [/usr/ports/www/firefox/work/firefox-133.0.3/config/ 
>> recurse.mk:34: compile] Error 2
>> gmake[1]: Leaving directory '/usr/ports/www/firefox/work/.build'
>> gmake: *** [/usr/ports/www/firefox/work/firefox-133.0.3/config/ 
>> rules.mk:359: all] Error 2
>> ===> Compilation failed unexpectedly.
>> Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the 
>> failure to
>> the maintainer.
>> *** Error code 1
>>
>> Stop.
>> make[1]: stopped in /usr/ports/www/firefox
>> *** Error code 1
>>
>> Stop.
>> make: stopped in /usr/ports/www/firefox
>> ---->8----
>>
>> [thunderbird-128.6.0]:
>> ----8<----
>> [...]
>> gmake[2]: Leaving directory '/usr/ports/mail/thunderbird/work/.build'
>> gmake[1]: *** [/usr/ports/mail/thunderbird/work/thunderbird-128.6.0/ 
>> config/recurse.mk:34: compile] Error 2
>> gmake[1]: Leaving directory '/usr/ports/mail/thunderbird/work/.build'
>> gmake: *** [/usr/ports/mail/thunderbird/work/thunderbird-128.6.0/ 
>> config/ rules.mk:361: all] Error 2
>> ===> Compilation failed unexpectedly.
>> Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the 
>> failure to
>> the maintainer.
>> *** Error code 1
>>
>> Stop.
>> make[1]: stopped in /usr/ports/mail/thunderbird
>> *** Error code 1
>>
>> Stop.
>> make: stopped in /usr/ports/mail/thunderbird
>> ---->8----
>>
>> Looking at the last reported error in rules.mk, it seems as if in both 
>> cases a variable is not set correctly somewhere:
>> ----8<----
>> [...]
>> # The root makefile doesn't want to do a plain export/libs, because
>> # of the tiers and because of libxul. Suppress the default rules in favor
>> # of something else. Makefiles which use this var *must* provide a 
>> sensible
>> # default rule before including rules.mk
>> default all::
>>          $(foreach tier,$(TIERS),$(call SUBMAKE,$(tier)))
>> [...]
>> ---->8----
>>
>> Before trying to chase this any further, has anyone else encountered 
>> this already?
>>
>> Best
>> Philipp
> 
> Quick follow-up: both these errors where caused by me setting LTO=on. 
> With LTO=off, everything built fine.

   Whatever the error was I'd say it looked like your logs snipping 
removed lines that likely would error out. If a port has an option that 
is known to work then until fixed it should be commented away from the 
user, removed, or mark the port as broken.
   The MAKE_JOBS_UNSAFE is more of a generic comment that should only 
matter if the build system of a port is flawed to not orderly handle 
multiple make jobs. If things fail then defining that eliminates the 
possibility that its the failure; please report if you ever find such a 
failure, specifically if reproducible as that definitely needs to be 
fixed or MAKE_JOBS_UNSAFE needs to be set by the port itself then. 
Otherwise defining it before submitting any logs helps keep the log of 
the failure reproducible + orderly for faster comparison.
   Last I checked the general concept of LTO=yes (and not just when a 
port gives the option), LTO will break quite a few ports. If I recall it 
seemed like a compiler/linker issue so I presumed it would get fixed 
there instead of patching each port to force it off just because of that 
seemingly common bug. I have wondered how much having it work would 
help. Since I build my own ports I figure it also means compiles that 
use ccache less, take longer, use less threads, and use more RAM in an 
attempt to get more optimized binaries to result.

> Best
> Philipp