-
Notifications
You must be signed in to change notification settings - Fork 224
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
Fix build failures with latest MSVC (main) #2598
Fix build failures with latest MSVC (main) #2598
Conversation
.github/workflows/reusable-build.yml
Outdated
@@ -176,7 +176,7 @@ jobs: | |||
- name: Copy LLVM libs for Fuzzing & Address Sanitizing | |||
if: steps.skip_check.outputs.should_skip != 'true' | |||
working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}} | |||
run: copy "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64\clang*" . | |||
run: copy "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.36.32532\bin\Hostx64\x64\clang*" . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you use the VCToolsInstallDir environment variable to automatically get the right path and not have to change it when github updates the msvc version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it can be done, but still the VS version and product type would have to be hard-coded (i.e. "2022", and "Enterprise"/"Community"/etc.), if the current console does not have the VC environment variables:
# Generate the Visual Studio environment variables (if not already done)
> call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
# Parse the output string (or just use the variable)
> echo %VCToolsInstallDir%
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.36.32532\
Something like
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
copy %VCToolsInstallDir%bin\Hostx64\x64\clang*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
github preinstalls Visual Studio so that variable should always be set I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The VS environment variables are not installed as System defaults, i.e. that's why VS offers a "VS Command Prompt", which basically just runs that .bat
script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a quick test and %VCToolsInstallDir%
is not available by default in the runner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use the VSVARS32 script to get the variable set to save to github environment variables then for future steps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated PR to use environment variable. Also updated the cache hash to use the VS tool version.
Codecov Report
@@ Coverage Diff @@
## main #2598 +/- ##
==========================================
+ Coverage 83.91% 83.96% +0.05%
==========================================
Files 157 157
Lines 29173 29177 +4
==========================================
+ Hits 24480 24499 +19
+ Misses 4693 4678 -15
|
Description
Looks like the MSVC version has again changed from
14.35.32215
to14.36.32532
and broke the build for themain
branch. This PR fixes the build failures and contains the following changes:vcvars64
and set the environment variables forVCToolsInstallDir
andVCToolsVersion
, so that we dont hardcode path in the yml.Testing
Existing CICD
Documentation
NA