libheif-1.18.2 asks to rebuild with the key MAKE_JOBS_UNSAFE=yes

Hello.
I'm updating system and a message popped up.
I did not find any information about why version 'libheif-1.18.2 is not safe.

Code:
-out-of-range-compare -Wno-error=potentially-evaluated-expression -MD -MT examples/CMakeFiles/heif-enc.dir/heif_enc.cc.o -MF examples/CMakeFiles/heif-enc.dir/heif_enc.cc.o.d -o examples/CMakeFiles/heif-enc.dir/heif_enc.cc.o -c /usr/ports/graphics/libheif/work/libheif-1.18.2/examples/heif_enc.cc
ninja: build stopped: subcommand failed.
===> 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/graphics/libheif
*** Error code 1

Stop.
make: stopped in /usr/ports/graphics/libheif
egrep: empty (sub)expression
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20241008-57373-6zdq7l env UPGRADE_TOOL=portupgrade UPGRADE_PORT=libheif-1.18.2 UPGRADE_PORT_VER=1.18.2 make
** Fix the problem and try again.
--->  Skipping 'graphics/ImageMagick7' (ImageMagick7-7.1.1.26_4) because a requisite package 'libheif-1.18.2' (graphics/libheif) failed (specify -k to force)
--->  Skipping 'graphics/pecl-imagick' (php82-pecl-imagick-3.7.0_3) because a requisite package 'ImageMagick7-7.1.1.26_4' (graphics/ImageMagick7) failed (specify -k to force)
** Listing the failed packages (-:ignored / *:skipped / !:failed)
    ! graphics/libheif (libheif-1.18.2)    (unknown build error)
    * graphics/ImageMagick7 (ImageMagick7-7.1.1.26_4)
    * graphics/pecl-imagick (php82-pecl-imagick-3.7.0_3)
 
The error does not mean it is not make jobs safe, it means it was build with make jobs configured to permit multiple jobs but the build failed. You will generally see that on any failed output as its a common troubleshooting technique to eliminate a possible failure type.

Sometimes software has errors in its build system that can cause things to be built in an order that is not valid when multiple jobs are allowed to run at the same time. Simplest example is if you need to build a+b+c to build d. If you were to build that with 4 jobs and no flow control then you will likely start building d while a+b+c are being worked on by the first 3 jobs which will fail.

If you replace make with make -DMAKE_JOBS_UNSAFE and it still fails, then you need to continue with other troubleshooting steps as it was unlikely to be an out of order job. More build output above what was cut off is likely useful to narrow down the issue. Knowing about any customized port options (including dependencies) and if any other variables are overridden such as passing compiler flags could help find other points of failure. Otherwise knowing specific kernel+base version and hardware it was built on + any strange configurations (workdir over an intermittent network connection) may be helpful.
 
The error does not mean it is not make jobs safe, it means it was build with make jobs configured to permit multiple jobs but the build failed. You will generally see that on any failed output as its a common troubleshooting technique to eliminate a possible failure type.

Sometimes software has errors in its build system that can cause things to be built in an order that is not valid when multiple jobs are allowed to run at the same time. Simplest example is if you need to build a+b+c to build d. If you were to build that with 4 jobs and no flow control then you will likely start building d while a+b+c are being worked on by the first 3 jobs which will fail.

If you replace make with make -DMAKE_JOBS_UNSAFE and it still fails, then you need to continue with other troubleshooting steps as it was unlikely to be an out of order job. More build output above what was cut off is likely useful to narrow down the issue. Knowing about any customized port options (including dependencies) and if any other variables are overridden such as passing compiler flags could help find other points of failure. Otherwise knowing specific kernel+base version and hardware it was built on + any strange configurations (workdir over an intermittent network connection) may be helpful.
make.conf
Code:
CPUTYPE?=nocona
MAKE_JOBS_NUMBER=6

NO_GAMES=true
NO_INET6=true
NO_BLUETOOTH=true
NO_SHAREDOCS=true
OPTIONS_UNSET=DOCS X11 IPV6 BLUETOOTH GAMES SMB CUPS VULKAN FFMPEG GITWEB EXAMPLES
 
Last edited by a moderator:
Code:
root@test_site_ru:/usr/ports/graphics/libheif # make MAKE_JOBS_UNSAFE=yes install clean
===>  Building for libheif-1.18.2_1
[  1% 1/83] /usr/bin/c++ -DHAVE_JPEG_WRITE_ICC_PROFILE=1 -DHAVE_LIBJPEG=1 -DHAVE_LIBPNG=1 -DHAVE_LIBSHARPYUV=1 -DHAVE_UNISTD_H -DHAVE_VISIBILITY -DLIBHEIF_EXPORTS -I/usr/ports/graphics/libheif/work/.build -I/usr/ports/graphics/libheif/work/libheif-1.18.2/libheif/api -I/usr/ports/graphics/libheif/work/libheif-1.18.2/libheif -I/usr/ports/graphics/libheif/work/libheif-1.18.2/include/libheif -I/usr/ports/graphics/libheif/work/libheif-1.18.2/include -O2 -pipe -march=nocona -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include -O2 -pipe -march=nocona -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -DNDEBUG -std=c++11 -fPIE -fvisibility=hidden -fvisibility-inlines-hidden   -Wall -Wsign-compare -Wconversion -Wno-sign-conversion -Wno-error=conversion -Wno-error=unused-parameter -Wno-error=deprecated-declarations -Wno-error=tautological-compare -Wno-error=tautological-constant-out-of-range-compare -Wno-error=potentially-evaluated-expression -MD -MT examples/CMakeFiles/heif-dec.dir/heif_dec.cc.o -MF examples/CMakeFiles/heif-dec.dir/heif_dec.cc.o.d -o examples/CMakeFiles/heif-dec.dir/heif_dec.cc.o -c /usr/ports/graphics/libheif/work/libheif-1.18.2/examples/heif_dec.cc
FAILED: examples/CMakeFiles/heif-dec.dir/heif_dec.cc.o 
/usr/bin/c++ -DHAVE_JPEG_WRITE_ICC_PROFILE=1 -DHAVE_LIBJPEG=1 -DHAVE_LIBPNG=1 -DHAVE_LIBSHARPYUV=1 -DHAVE_UNISTD_H -DHAVE_VISIBILITY -DLIBHEIF_EXPORTS -I/usr/ports/graphics/libheif/work/.build -I/usr/ports/graphics/libheif/work/libheif-1.18.2/libheif/api -I/usr/ports/graphics/libheif/work/libheif-1.18.2/libheif -I/usr/ports/graphics/libheif/work/libheif-1.18.2/include/libheif -I/usr/ports/graphics/libheif/work/libheif-1.18.2/include -O2 -pipe -march=nocona -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include -O2 -pipe -march=nocona -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -DNDEBUG -std=c++11 -fPIE -fvisibility=hidden -fvisibility-inlines-hidden   -Wall -Wsign-compare -Wconversion -Wno-sign-conversion -Wno-error=conversion -Wno-error=unused-parameter -Wno-error=deprecated-declarations -Wno-error=tautological-compare -Wno-error=tautological-constant-out-of-range-compare -Wno-error=potentially-evaluated-expression -MD -MT examples/CMakeFiles/heif-dec.dir/heif_dec.cc.o -MF examples/CMakeFiles/heif-dec.dir/heif_dec.cc.o.d -o examples/CMakeFiles/heif-dec.dir/heif_dec.cc.o -c /usr/ports/graphics/libheif/work/libheif-1.18.2/examples/heif_dec.cc
In file included from /usr/ports/graphics/libheif/work/libheif-1.18.2/examples/heif_dec.cc:52:
In file included from /usr/ports/graphics/libheif/work/libheif-1.18.2/examples/encoder_jpeg.h:30:
/usr/include/c++/v1/csetjmp:40:6: error: "If libc++ starts defining <setjmp.h>, the __has_include check should move to libc++'s <setjmp.h>"
   40 | #    error "If libc++ starts defining <setjmp.h>, the __has_include check should move to libc++'s <setjmp.h>"
      |      ^
1 error generated.
ninja: build stopped: subcommand failed.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/graphics/libheif
*** Error code 1

Stop.
make: stopped in /usr/ports/graphics/libheif
root@test_site_ru:/usr/ports/graphics/libheif #
How to fix?
Code:
# pkg version -v | grep 'ninja'
ninja-1.11.1,4                     =   up-to-date with index
My system FreeBSD 14.1-RELEASE-p5 amd64.
Did make MAKE_JOBS_UNSAFE=yes install clean
 
Looks like your system might have stable header files:


"On CURRENT, the user/writer did already "make delete-old" to eliminate all obsolete headers - on 14-STABLE he did not. Doing so means: problem solved."
After updating the system, I always do.
# yes | make delete-old
# yes | make delete-old-libs

Yes, I updated the system from 14.0 to 14.1, there were no errors during the update, at the end of the update I did yes | make delete-old, yes | make delete-old-libs and rebooted the server.
After I updated the jail environment, ezjail-admin update -i and started the VPS server, I started updating/installing the software and a libheif build error appeared.
 
Either way you should try to find out which headers were supposed to be moved and move them yourself.

Keep in mind they might have been left behind by other upgrades than the 14.0->14.1 one.
 
strange, it's not in the system itself.
ls -l /usr/include/c++/v1/setjmp.h
ls: /usr/include/c++/v1/setjmp.h: No such file or directory

but it is in jail.
# ls -l /usr/include/c++/v1/setjmp.h
-r--r--r-- 1 root wheel 847 Oct 5 09:55 /usr/include/c++/v1/setjmp.h

Please tell me how I can clean jail from old library garbage?
 
I would bring a src tree into the jail so that I can do `make delete-old` in there.

Or you could try just nuking the one file and see whether that fixes the problem.
 
I would bring a src tree into the jail so that I can do `make delete-old` in there.

Or you could try just nuking the one file and see whether that fixes the problem.
I have already rebuilt most of the servers without libheif support.
I don't want to experiment on production applications.

Hmm, I'll try to return the libheif dependency on the test server.
 
Back
Top