Bug 281373 - devel/gprbuild: don't let MAKEFLAGS pollute gprbuild gmake invocation
Summary: devel/gprbuild: don't let MAKEFLAGS pollute gprbuild gmake invocation
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Thierry Thomas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-08 20:32 UTC by John Hein
Modified: 2025-01-12 15:30 UTC (History)
3 users (show)

See Also:


Attachments
[patch] use SETENVI to clear MAKEFLAGS before sub-gmake (598 bytes, patch)
2024-09-08 20:38 UTC, John Hein
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Hein 2024-09-08 20:32:52 UTC
Arguments passed to make for the top level port build for devel/gprbuild can be consumed by gmake used to build the actual upstream project (vs the ports infrastructure 'make' operations).

For instance, 'make -DNO_DEPENDS stage' will pass "MAKEFLAGS= -D NO_DEPENDS ..." in the environment to the gmake invocation.  gmake chokes on that with the following:


: invalid option -- D
Usage: gmake [options] [target] ...
Options:
  -b, -m                      Ignored for compatibility.
  -B, --always-make           Unconditionally make all targets.
 .
 .

A fix for that is to clear the environment as with the ports 572f2361692640bc27729191b1267aa3fcc354a7 commit that added SETENVI and WRK_ENV.
Comment 1 John Hein 2024-09-08 20:38:50 UTC
Created attachment 253435 [details]
[patch] use SETENVI to clear MAKEFLAGS before sub-gmake

This patch clears the environment (specifically for MAKEFLAGS) before calling gmake in 'stage'.  The do-install in devel/gprbuild/Makefile was nearly a copy of do-install from bsd.port.mk.  This change just catches up to the same change from bsd.port.mk's do-install in ports 572f2361692640bc27729191b1267aa3fcc354a7

QA:
 poudriere testport - ok
 portlint - no errors, no new warnings
 portclippy - no new out of order directives
Comment 2 John Hein 2024-09-08 20:40:52 UTC
No maintainer, but CC'd recent committer.

No need for PORTREVISION bump.
Comment 3 Thierry Thomas freebsd_committer freebsd_triage 2025-01-12 15:30:11 UTC
Committed, thanks!
Comment 4 commit-hook freebsd_committer freebsd_triage 2025-01-12 15:30:29 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b1e0fa4c74455d9a71d57d3d1107ecd8380deab0

commit b1e0fa4c74455d9a71d57d3d1107ecd8380deab0
Author:     John Hein <jcfyecrayz@liamekaens.com>
AuthorDate: 2025-01-12 11:13:37 +0000
Commit:     Thierry Thomas <thierry@FreeBSD.org>
CommitDate: 2025-01-12 15:25:26 +0000

    devel/gprbuild: don't let MAKEFLAGS pollute gprbuild gmake invocation

    PR:             281373
    Reported by:    John Hein <jcfyecrayz (at) liamekaens.com>

 devel/gprbuild/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)