Fix input environment not being respected by swift_build_support.shell.run() #40300
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.
In
swift_build_support
'sshell
module, therun()
function was removing the passed-in environment from the keyword arguments dictionary, preventing it from being passed along tosubprocess.Popen()
.This appears to only have affected
update_checkout
, and therein, the only usage ofrun()
with non-default environment was in theobtain_additional_swift_sources()
function. The effect was to ignore the attempt to setGIT_TERMINAL_PROMPT=0
for thegit clone
,git checkout
, andgit submodule
commands.Hardly catastrophic, but it's nonetheless a little unpleasant that this went completely unnoticed since at least 2017. (Admittedly because it didn't really affect much of anything.)
(Note: Also had to fix the actual use site in
update_checkout
to pass a string rather than a number as the environment value - this has been broken since at least 8c721de)