Bug 281554 - devel/build2: portmaster build failure: : invalid option -- D
Summary: devel/build2: portmaster build failure: : invalid option -- D
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Robert Clausecker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-17 16:41 UTC by O. Hartmann
Modified: 2024-09-25 06:38 UTC (History)
1 user (show)

See Also:
fuz: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2024-09-17 16:41:55 UTC
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.
Comment 1 Robert Clausecker freebsd_committer freebsd_triage 2024-09-17 16:49:49 UTC
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.
Comment 2 O. Hartmann 2024-09-17 16:58:25 UTC
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.
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-09-25 06:31:27 UTC
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(-)
Comment 4 Robert Clausecker freebsd_committer freebsd_triage 2024-09-25 06:38:50 UTC
Thank you for your report.

It should be all fine now.