MSCommon: minor changes to prevent possible inconsistencies with the msvc runtime and/or external file cache. #4757
+35
−24
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.
The list of variables imported from the OS environment and added to the msvc environment was moved from inside a function to file-level in #4717 which could enable a user to extend the list of imported variables. This could yield unexpected behavior with the msvc runtime and/or external file cache.
The msvc cache key consists of the msvc batch file and the msvc batch file arguments. The cache contents are based on both the list of variables imported from the OS environment and the list of variables preserved from the msvc environment. Additions to the list of variables imported from the OS environment could introduce runtime and/or external file cache consistency issues. Under certain circumstances, due to runtime and/or external file caching, additions to the list of variables imported from the OS environment could be ignored entirely.
The tuple of variables retrieved from the msvc environment and added to the SCons environment is defined at file-level. The tuple of variables is specified as the default value of an argument in the function to process the msvc output. The optional argument is not passed from the vc code. As written, it is effectively impossible to extend the tuple of preserved variables and have the extended variables used within the function to process the msvc output.
The variables imported from the OS environment was changed from a list to a tuple.
The tuple of variables imported from the OS environment and added to the msvc environment is defined at file-level. The tuple of variables is now specified as the default value of an argument in the function to get the msvc output. The optional argument is not passed from the vc code. As written, it is effectively impossible to extend the tuple of imported variables and have the extended variables used within the function to get the msvc output.
This PR effectively restores the behavior of the imported and preserved variables list behavior to the behavior prior to acceptance of #4717 until the cache consistency issues can be addressed.
There may be some relevant discussion in #4727 which was abandoned.
This PR is internal only with nothing user-facing.
Contributor Checklist:
CHANGES.txtandRELEASE.txt(and read theREADME.rst).