Bug 273938 - Environment leakage causes build failures in some ports
Summary: Environment leakage causes build failures in some ports
Status: Closed Unable to Reproduce
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Port Management Team
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2023-09-19 02:00 UTC by Greg Lehey
Modified: 2024-12-04 22:27 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Lehey freebsd_committer freebsd_triage 2023-09-19 02:00:36 UTC
This bug report is a follow-up on https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273490.  In that case, tex-wb2c failed to build due to something (presumably a variable) inherited from the environment.  The workaround was to remove all environment and start a new shell:

  $ env -i HOME="$HOME" bash --norc

This is clearly not an isolated case, and finding the variable in question is difficult (I still haven't found mine).  But it should be possible to remove the environment at the start of the build.  This would affect the deliberate passing of variables to the build, so it needs some consideration.  This report is intended as a place holder during discussion.
Comment 1 Jamie Landeg-Jones 2024-11-30 21:05:08 UTC
This has bitten me too in the past, so often that I created a command "cleanmake" which I always use for ports, which cleans the env apart from HOME, PWD, TERM, TMPDIR, USER before exec'ing make.

However, I feel this environment should be the default. (with maybe some other allowed ENVs I haven't thought of)
Comment 2 Tijl Coosemans freebsd_committer freebsd_triage 2024-12-01 10:32:20 UTC
Ports are built with a clean environment since ports 572f23616926.  Can this bug be closed?
Comment 3 Jamie Landeg-Jones 2024-12-01 15:01:06 UTC
(In reply to Tijl Coosemans from comment #2)

Apologies! I hadn't realised this has been done! LGTM, though obviously, it's Gregs PR
Comment 4 Greg Lehey freebsd_committer freebsd_triage 2024-12-04 22:26:59 UTC
This problem no longer occurs as originally described.  But the port itself has changed, using different tools, so it's not clear why it no longer occurs.   I'm closing the report.