You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Default child environment: HOME is not forwarded and a PATH change re-runs nothing, neither pinned by a requirement #480
putup's default child environment diverges from tup's default_env[] in two ways that no requirement in spec/requirements/ states, so a reader diffing against upstream finds them as defects rather than decisions.
HOME is not forwarded. tup's default_env[] (src/tup/environ.c) is PATH and HOME on POSIX, plus a Visual Studio set under _WIN32. putup's base_child_env() (src/platform/process-posix.cpp) gives PATH, and since Build commands get PATH only, so TMPDIR is dropped and GCC writes temporaries into the source tree when /tmp is read-only #478TMPDIR/TMP/TEMP when set. A probe rule : |> echo "HOME=[$HOME]" > %o |> out.txt prints HOME=[] under putup. Tools that resolve per-user state from HOME (ccache is why tup forwards it, and tup also injects CCACHE_NODIRECT=1 in tup_db_get_environ) fall back to getpwuid or fail; which tools break is not measured.
A PATH change re-runs nothing. tup makes every default-environment name a sticky env node of each command (environ_add_defaults, tup_db_check_env), so a changed PATH re-runs every command; the man page says so under export. putup forwards PATH without recording it. Reproduced on main 75c93ee with : |> echo "PATH=$PATH" > %o |> out.txt: build with PATH=/usr/bin:/bin, rebuild with PATH=/usr/bin:/bin:/opt/zzz, putup prints Nothing to do (up to date) and out.txt keeps the first value. The only route by which PATH reaches identity is CONFIG_TRACKED_TOOLS resolving a bare name through it.
Where this stands in the spec
#479 added REQ-ENV-TEMPDIR and REQ-ENV-TEMPDIR-IDENTITY for the temporary-directory variables and noted the HOME divergence in a reference: clause only. PATH's forwarded-not-recorded status has no requirement; docs/reference.md §export now states it in prose.
Decisions to make
Whether to forward HOME (conform to tup) or declare its absence as a deviation with a requirement. If forwarded, whether it joins identity: the same per-session concern that kept TMPDIR out applies less (a user's HOME rarely changes between builds), but tup's behaviour of re-running on any default-variable change is what a tup-conformant label would have to mean.
Whether PATH changes should re-run commands as in tup, or stay excluded with a requirement stating so and naming CONFIG_TRACKED_TOOLS as the deliberate route. Re-running on every PATH change is the tup behaviour the man page warns about ("if PATH is changed, all commands will run again").
Either way the outcome is a requirement per variable in command-record.ears.md's env-values group with a discharging scenario, so the divergence stops being silent.
Symptom
putup's default child environment diverges from tup's
default_env[]in two ways that no requirement inspec/requirements/states, so a reader diffing against upstream finds them as defects rather than decisions.HOMEis not forwarded. tup'sdefault_env[](src/tup/environ.c) isPATHandHOMEon POSIX, plus a Visual Studio set under_WIN32. putup'sbase_child_env()(src/platform/process-posix.cpp) givesPATH, and since Build commands get PATH only, so TMPDIR is dropped and GCC writes temporaries into the source tree when /tmp is read-only #478TMPDIR/TMP/TEMPwhen set. A probe rule: |> echo "HOME=[$HOME]" > %o |> out.txtprintsHOME=[]under putup. Tools that resolve per-user state fromHOME(ccache is why tup forwards it, and tup also injectsCCACHE_NODIRECT=1intup_db_get_environ) fall back togetpwuidor fail; which tools break is not measured.A
PATHchange re-runs nothing. tup makes every default-environment name a sticky env node of each command (environ_add_defaults,tup_db_check_env), so a changedPATHre-runs every command; the man page says so underexport. putup forwardsPATHwithout recording it. Reproduced on main 75c93ee with: |> echo "PATH=$PATH" > %o |> out.txt: build withPATH=/usr/bin:/bin, rebuild withPATH=/usr/bin:/bin:/opt/zzz, putup printsNothing to do (up to date)andout.txtkeeps the first value. The only route by whichPATHreaches identity isCONFIG_TRACKED_TOOLSresolving a bare name through it.Where this stands in the spec
#479 added
REQ-ENV-TEMPDIRandREQ-ENV-TEMPDIR-IDENTITYfor the temporary-directory variables and noted theHOMEdivergence in areference:clause only.PATH's forwarded-not-recorded status has no requirement;docs/reference.md§exportnow states it in prose.Decisions to make
HOME(conform to tup) or declare its absence as a deviation with a requirement. If forwarded, whether it joins identity: the same per-session concern that keptTMPDIRout applies less (a user'sHOMErarely changes between builds), but tup's behaviour of re-running on any default-variable change is what atup-conformantlabel would have to mean.PATHchanges should re-run commands as in tup, or stay excluded with a requirement stating so and namingCONFIG_TRACKED_TOOLSas the deliberate route. Re-running on everyPATHchange is the tup behaviour the man page warns about ("if PATH is changed, all commands will run again").Either way the outcome is a requirement per variable in
command-record.ears.md's env-values group with a discharging scenario, so the divergence stops being silent.Found by the #478 design and review passes.