-
-
Notifications
You must be signed in to change notification settings - Fork 356
Fix for vcpkg run time issue in windows runner #4717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
7467042
39b4937
7ba488e
063ba57
700190c
9ee4e50
096fc51
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -342,6 +342,18 @@ def normalize_env(env, keys, force: bool=False): | |
| if sys32_wbem_dir not in normenv['PATH']: | ||
| normenv['PATH'] = normenv['PATH'] + os.pathsep + sys32_wbem_dir | ||
|
|
||
| # ProgramFiles for PowerShell 7 Path and PSModulePath | ||
| progfiles_dir = os.environ.get("ProgramFiles") | ||
| if not progfiles_dir: | ||
| sysroot_drive, _ = os.path.splitdrive(sys32_dir) | ||
| sysroot_path = sysroot_drive + os.sep | ||
| progfiles_dir = os.path.join(sysroot_path, "Program Files") | ||
|
|
||
| # Powershell 7 | ||
| progfiles_ps_dir = os.path.join(progfiles_dir, r"PowerShell\7") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why r"PowerShell\7"? is that a single path element and not PowerShell \ 7 ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. raw string it is os.path.join(os.environ["ProgramFiles"], r"Powershell\7")
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you prefer
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pushed change. |
||
| if progfiles_ps_dir not in normenv["PATH"]: | ||
| normenv["PATH"] = normenv["PATH"] + os.pathsep + progfiles_ps_dir | ||
|
|
||
| # Without Powershell in PATH, an internal call to a telemetry | ||
| # function (starting with a VS2019 update) can fail | ||
| # Note can also set VSCMD_SKIP_SENDTELEMETRY to avoid this. | ||
|
|
@@ -389,12 +401,16 @@ def get_output(vcbat, args=None, env=None, skip_sendtelemetry=False): | |
| 'VSCMD_DEBUG', # enable logging and other debug aids | ||
| 'VSCMD_SKIP_SENDTELEMETRY', | ||
| 'windir', # windows directory (SystemRoot not available in 95/98/ME) | ||
| 'VCPKG_DISABLE_METRICS', | ||
| 'VCPKG_ROOT', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we move this list to be a package variable? That way it can be changed from a SConscript/SConstruct if desired..
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Absolutely
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How would that work? Seems a bit awkward to have to deal with a variable in the vastly more common default case - we've only had the one issue/PR relating to someone trying to use vcpkg, so it can't be very common in the world SCons reaches.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mwichmann I believe that @bdbaddog is talking about moving the constant list of variables from inside the function to file-level. This way it could be modified externally if desired but not necessarily recommended.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pushed change.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah... "package variable" is a defined term in SCons (https://scons.org/doc/production/HTML/scons-man.html#v-PackageVariable) so I thought that's what it meant. If the intent was module global, yes, that's a good idea: things that are "constants" (even if they're changeable) are better at the top of the file than embedded in a function.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was only moved immediately above the function using the list rather than the top of the file. It is only used in one place (Captain Obvious). Hope that is ok.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Personally prefer them at the top for visibility, but there's some argument that something with only one use is also good kept close to the place of use. There are few absolutes with Python.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. better to have all the constants at the top of the file if possible.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. None of the current constants in |
||
| ] | ||
| env['ENV'] = normalize_env(env['ENV'], vs_vc_vars, force=False) | ||
|
|
||
| if skip_sendtelemetry: | ||
| _force_vscmd_skip_sendtelemetry(env) | ||
|
|
||
| # debug("ENV=%r", env['ENV']) | ||
|
|
||
| if args: | ||
| debug("Calling '%s %s'", vcbat, args) | ||
| cmd_str = '"%s" %s & set' % (vcbat, args) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.