File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -724,11 +724,23 @@ def _correct_path_variable(toolchain, env):
724724 corrected_env [key ] = ";" .join (path_paths )
725725 env = corrected_env
726726
727- value = env .get ("PATH" , "" )
728- if not value :
727+ value = env .get ("PATH" )
728+ if value == None :
729+ # avoid setting PATH if it isn't set, and vice-versa
729730 return env
730- value = _normalize_path (env .get ("PATH" , "" ))
731- env ["PATH" ] = "$PATH:" + value
731+
732+ value = _normalize_path (value )
733+
734+ if "$PATH" not in value :
735+ # Since we end up overriding the value of PATH here, we need to make
736+ # sure we preserve the current value of the PATH (in case
737+ # strict_action_env is not in use). If one of the toolchains has
738+ # already overridden where the PATH self-reference falls (in order to
739+ # put toolchain items first, for example) we want to trust that, but
740+ # otherwise we need to make sure it's referenced _somewhere_.
741+ value = "$PATH:" + value
742+
743+ env ["PATH" ] = value
732744 return env
733745
734746def _list (item ):
You can’t perform that action at this time.
0 commit comments