Repository navigation
Conversation
SonnyRR
marked this pull request as ready for review
October 10, 2026 08:46
dennisdoomen
approved these changes
Oct 10, 2026
A parameter value the build could not parse used to abort the process through Assert.Fail. Built-in parameters are resolved inside FalloutBuild's static constructor, so the exception escaped before any target ran and before the consumer had a chance to handle it. The standard Unix HOST variable made this routine. Every zsh user has HOST exported, and Fallout reads it as the value for the Host parameter, so builds failed at startup with "Value 'M2' could not be converted to 'Host'". The same happened for any unusable value, for example VERBOSITY set to something that is not a verbosity level. Parameters now report a warning and use the default instead. Warnings go to standard error rather than Serilog, because Serilog is not configured yet at this point in startup. That also makes the existing "multiple values are provided" warning visible, which it never was. Fixes Fallout-build#705.
The documentation states that parameters can be set with a FALLOUT_ prefix, but the resolver only ever looked for NUKE_. A FALLOUT_ variable was ignored. The resolver now matches FALLOUT_ and NUKE_ before the bare parameter name. Prefixed names come first because the bare match is case-insensitive, so on Unix the HOST variable matches the Host parameter and would otherwise shadow FALLOUT_HOST. This also fixes a case where an explicit override was dropped. With HOST and NUKE_HOST both set, both were collected as candidates, the resolver saw more than one, and it fell back to the default. The prefixed value now wins. Fixes Fallout-build#457.
SonnyRR
force-pushed
the
fix/705-host-env-collision
branch
from
October 13, 2026 16:58
bc589bf to
5de7b9e
Compare
ChrisonSimtian
requested changes
Oct 13, 2026
ChrisonSimtian
left a comment
Collaborator
There was a problem hiding this comment.
lets look into the logger change please, we should avoid calling Console et al directly
Review feedback on the PR asked to keep logging on the logger and not
call Console directly.
- Restore the original Log.Warning call for the "multiple values" case.
- Log the conversion failure with Log.Warning and keep `ex` as the
exception variable name.
- Remove the Console.Error helper.
- Tests capture warnings through a Serilog sink filtered by the
VariableName property, so log output from test classes that run in
parallel cannot leak into the assertions.
- Docs: state the lookup order (exact name, prefixed name, bare fuzzy
match), drop "on standard error", and stop claiming every Unix shell
exports HOST. Only some login shells do, for example on openSUSE.
Contributor
Author
|
@ChrisonSimtian, I've addressed your feedback. Would appreciate a re-review when you have some spare time. :) |
ChrisonSimtian
approved these changes
Oct 16, 2026
ChrisonSimtian
left a comment
Collaborator
There was a problem hiding this comment.
awesome thanks :-) lgtm
Collaborator
|
@SonnyRR please close all review comments. |
Contributor
Author
Done. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An environment variable the build cannot read now falls back to the default instead of aborting the process. The
FALLOUT_prefix documented in the parameters page now works.What changed
FalloutBuild's static constructor, so throwing there killed the process before any target ran.FALLOUT_andNUKE_prefixed names are matched before the bare parameter name.Why the prefixes are matched first
The bare match is case-insensitive, so on Unix the
HOSTvariable matches theHostparameter. If the bare match ran first it would always shadowFALLOUT_HOST, and the documented prefix would have no effect on the parameter that needs it most.This also fixes an explicit override being dropped. With both
HOSTandNUKE_HOSTset, both were collected as candidates, the resolver saw more than one, and it fell back to the default.No behaviour is removed
Every environment variable spelling that resolved before still resolves:
Host=,host=in lower case,NUKE_HOST=,--host, and the bare fuzzy match. Nothing about matching was narrowed, so the change is identical on Windows, macOS and Linux.One case changes: a
FALLOUT_*variable that is set today and ignored will start taking effect. This is unavoidable, becauseHOSTandHostare the same string under case-insensitive comparison, so a bare match would always shadow the prefix.Verification
Fallout.Build.Specs: 254 passed.HOST=M2, the case from [Bug] Standard UnixHOSTenvironment variable hijacks the built-inHostparameter - every build crashes in the static constructor #705. Before:TypeInitializationException, exit 1. After: exit 0, one warning, help renders.HOST=M2 FALLOUT_HOST=Terminalproduces no warning. The prefixed value wins over the bareHOST.developafter Move ParameterService onto the BuildContext #452 movedParameterService. Re-ran the full suite and the same dogfood check afterwards.Where this reproduces
Only where something exports
HOST. On openSUSE the/etc/profilefromaaa_basedoes it for every login shell. macOS does not export it, and neither do non-login shells inCIimages or container entrypoints, which is likely why it has gone unnoticed. Details in #705.The two commits are separable. The first fixes the crash on its own; the second adds the
FALLOUT_prefix and the precedence rule.Closes #705
Fixes #457