Since the import of games/godot4 there have been at least two build
failures that naddy reported to me.  Both stems from the same issue:
scons' CPP parser limitations.

In a nutsell, given the following bit of code

#ifdef USE_FOO
# include <foo.h>
#endif

scons is not smart enough to realize that without -DUSE_FOO, foo.h is
not used, so it records it as dependency.  If than foo gets junked,
scons fails with an error like:

scons: *** [thirdparty/oidn/mkl-dnn/src/common/rnn.linuxbsd.editor.o]
Implicit dependency `/usr/local/include/cblas.h' not found, needed by target
`thirdparty/oidn/mkl-dnn/src/common/rnn.linuxbsd.editor.o'.

(actually, scons has another C parser that should be smart enough to
interpret CPP' #ifs but it's not the default one and AFAIK needs
explicit opt-in via SConstruct file.)

So, is DPB_PROPERTIES=nojunk the way to go?  Technically the only port
suffering from this so far has been godot4 as far as I'm aware
(curiously I never got build failures for games/godot due to this), but
since the issue is in scons itself I'm wondering whether it makes sense
to fix scons.port.mk


Thanks,

Omar Polo


Index: scons.port.mk
===================================================================
RCS file: /home/cvs/ports/devel/scons/scons.port.mk,v
diff -u -p -r1.13 scons.port.mk
--- scons.port.mk       13 May 2023 19:06:09 -0000      1.13
+++ scons.port.mk       28 Jan 2024 22:20:28 -0000
@@ -24,6 +24,9 @@ MODSCONS_INSTALL_TARGET = \
                ${MODSCONS_ENV} ${MODSCONS_FLAGS} ${INSTALL_TARGET} \
                DESTDIR=${WRKINST}
 
+# XXX scons include parser is bogus
+DPB_PROPERTIES += nojunk
+
 .if !target(do-build)
 do-build:
        @${MODSCONS_BUILD_TARGET}

Reply via email to