Again, I tripped over a ${SETENV} vs. ${SETENVI} issue using portmaster! Building port devel/build2 fails with: ===>>> All >> build2-0.16.0 (1/5) ===> Cleaning for build2-0.17.0 ===> License BSD2CLAUSE BSD3CLAUSE MIT accepted by the user ===> build2-0.17.0 depends on file: /usr/local/sbin/pkg - found ===> Fetching all distfiles required by build2-0.17.0 for building ===> Extracting for build2-0.17.0 => SHA256 Checksum OK for build2-toolchain-0.17.0.tar.xz. ===> Patching for build2-0.17.0 ===> build2-0.17.0 depends on package: gmake>=4.4.1 - found ===> build2-0.17.0 depends on package: pkgconf>=1.3.0_1 - found ===> build2-0.17.0 depends on shared library: libsqlite3.so - found (/usr/local/lib/libsqlite3.so) ===> Configuring for build2-0.17.0 ===> Building for build2-0.17.0 : invalid option -- D Usage: gmake [options] [target] ... Options: -b, -m Ignored for compatibility. -B, --always-make Unconditionally make all targets. -C DIRECTORY, --directory=DIRECTORY Change to DIRECTORY before doing anything. -d Print lots of debugging information. --debug[=FLAGS] Print various types of debugging information. -e, --environment-overrides Environment variables override makefiles. -E STRING, --eval=STRING Evaluate STRING as a makefile statement. -f FILE, --file=FILE, --makefile=FILE Read FILE as a makefile. -h, --help Print this message and exit. -i, --ignore-errors Ignore errors from recipes. -I DIRECTORY, --include-dir=DIRECTORY [...] make -C devel/build2 all followed by portmaster -C devel/build2 works as workaround.
If portmaster sets weird environment variables that cause the build to fail, this looks like an issue portmaster needs to fix. CC'd se@, the portmaster maintainer for a second opinion.
In most cases - if not all - the problem refers to /usr/ports/CHANGES, [...] 20240229: AUTHOR: tijl@FreeBSD.org A new command SETENVI that clears the environment and a new variable WRK_ENV that contains a basic environment to use with SETENVI have been added. Ports that run (parts of) the upstream build system directly using commands like "${SETENV} ${MAKE_ENV} ${MAKE_CMD} ..." should change that to "${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${MAKE_CMD} ...". This way the build system runs with a clean environment without interference from the user environment or ports framework environment. Ports can add extra environment variables to WRK_ENV similar to CONFIGURE_ENV, MAKE_ENV, TEST_ENV, and so on, but WRK_ENV is used in all targets while the latter are target-specific. Since portmaster seems to be the BLOB free native variant of having a package tool, I think it relies on the "environmental" changes made to the Makefile ecosystem. To the notes: I never said or implied portmaster "setting weirs environments". I guess the changes in the Makefile/Mk build framework has changed, but portmaster hasn't come along with it.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=74f60cecc5f6ee5421694d92dc8cd10936911095 commit 74f60cecc5f6ee5421694d92dc8cd10936911095 Author: Robert Clausecker <fuz@FreeBSD.org> AuthorDate: 2024-09-20 14:16:59 +0000 Commit: Robert Clausecker <fuz@FreeBSD.org> CommitDate: 2024-09-25 06:28:02 +0000 devel/build2: use SETENVI Apparently this is needed when building with portmaster. PR: 281554 Reported by: O. Hartmann <ohartmann@walstatt.org> Event: EuroBSDcon 2024 devel/build2/Makefile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
Thank you for your report. It should be all fine now.