Skip to content

Toolset update: VS 2022 17.14 Preview 2, Clang 19.1.5 #5335

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

Merged
merged 27 commits into from
Mar 13, 2025

Conversation

StephanTLavavej
Copy link
Member

@StephanTLavavej StephanTLavavej commented Mar 12, 2025

Resolves #5074. Resolves #5282. Resolves DevCom-10863472 VSO-2411436.

📜 Changelog

  • Fixed bugs:
    • Fixed compiler errors when using <format> in a CUDA project, by adding a compiler bug workaround.
  • Code cleanups:
    • Removed compiler bug workarounds.
  • Infrastructure improvements:
    • Updated dependencies.
      • Updated build compiler to VS 2022 17.14 Preview 2 (now required).
      • Updated Clang to 19.1.5.

⚙️ Commits

  • Node.js 23.9.0.
    • Increasing our minimum required Node version for the Status Chart isn't necessary at this time, but I like to keep this updated on a semi-regular basis.
  • Require VS 2022 17.14.
    • The MSVC-internal toolset has finally been updated, allowing us to require 17.14.
  • Remove workaround for CUDA 9.2's lack of if constexpr.
  • Remove workaround for VSO-612785 "'expect_error' assertion when testing a constexpr 'hidden friend'".
    • This was fixed for VS by EDG 5.0 on 2018-12-15. In C++20 reverse_iterator changes #759 merged on 2020-04-30, I had to preserve the workaround because it was still needed for CUDA 9.2 (released 2018-05). Fortunately I commented it, although very poorly. It's been 5 years and we now require CUDA 12.4 (released 2024-03), so we can remove this workaround.
  • Remove workaround for VSO-1132704 "Bogus C3615 when implicitly-constexpr defaulted SMF calls non-trivial SMF in base class".
  • Remove workaround for VSO-1284799 "constexpr ICE: binding a reference to a temporary emits Assertion failed: Nerrors > 0".
  • Remove workaround for VSO-1664293 "/clr C++20 chk assertion failed: rhs.is_lvalue() in constexpr.cpp" in Dev11_0535636_functional_overhaul.
    • Update citation to VSO-2417635 "/clr C++20 chk assertion failed: rhs.is_lvalue() in constexpr.cpp, again" in P0466R5_layout_compatibility_and_pointer_interconvertibility_traits.
  • Remove workaround for VSO-2343282 "C1XX assertion 'If lookup found RDSymbol before it should find something this time, too' affecting STL atomic_ref test".
  • Remove workaround now that the internal toolset supports static call operators.
  • Remove workaround for DevCom-10841757 (CUDA's installer hangs for VS 2022 17.13 and later).
  • Skip a sporadic libcxx failure.
  • Work around VSO-2253317 "ICE when calling std::to_underlying()".
    • This is a very obscure bug that I encountered while modernizing the MSVC codebase to C++23. (It involves multiplying a float by the result of to_underlying().) As a compiler fix hasn't arrived in a timely manner, temporarily removing our "MSVC intrinsic" annotation is easy.
  • create-1es-hosted-pool.ps1: Opt-in early to disable default outbound access, before it's retired on 2025-09-30.
    • I verified that this takes effect (i.e. with no other changes, this prevents outbound Internet access, so the script can't download anything and totally fails).
  • create-1es-hosted-pool.ps1: Create a NAT gateway.
  • create-1es-hosted-pool.ps1: Consistently indent wrapped options.
  • create-1es-hosted-pool.ps1: Add more progress bar messages.
  • New pool.
  • VS 2022 17.14 Preview 2.
  • Add workaround to fix DevCom-10863472 VSO-2411436 "CUDA (12.8) host code compilation fails with std::format and VS2022".
    • And add test coverage, verified in a VM.
  • Remove CUDA workaround for __has_cpp_attribute(msvc::x).
  • Remove workarounds for CUDA/Intel, always use Standard _Pragma.
    • These were added by Replace __pragma with _Pragma #1342, merged 2021-05-20, for VSO-1329304 "EDG doesn't understand Standard _Pragma". We immediately fixed that locally and reported it upstream to EDG. In that release, VS 2019 16.10, we had just begun requiring CUDA 10.1 Update 2 (released Aug 2019). We now require CUDA 12.4 (released March 2024), and I observe that it understands Standard _Pragma just fine.
    • I've verified that Intel accepts Standard _Pragma on Windows, see below.
  • Remove all __INTEL_COMPILER workarounds.
    • Intel deprecated and removed their old compiler (icc), which we no longer attempt to avoid breaking in any way. (See DevCom-10200300.)
    • Their new compiler (icx) is LLVM-based and doesn't define __INTEL_COMPILER anymore, so all of our accumulated workarounds don't affect it and can be removed. Instead, icx uses __INTEL_LLVM_COMPILER to specifically distinguish itself. It also identifies itself as a __clang__, activating all of our Clang codepaths. For example, it accepts Clang-style diagnostic pragmas. See icx usage example below.
    • We still don't officially support or test icx. However, following our unofficial policy of avoiding gratuitous breakage should be easier now. (We were treating it as a Clang without realizing it, and it worked!)
  • Clarify comment: "TRANSITION, fixed in CUDA 12.5"
  • Add retryCountOnTaskFailure: 4 to checkout-self.yml.
  • Clang 19.1.5.
    • VS performed a minor version update. It doesn't affect clang-format output, or any of our product/test code, but we should still update our expected clang-format version to avoid emitting warnings during CMake configuration.

STL-ASan-CI passed.

💻 icx Usage Example

C:\Temp>type meow.cpp
#include <cstdio>
#include <vector>

[[deprecated]] int square(int x) { return x * x; }

int main() {
#ifdef __INTEL_COMPILER
    std::puts("__INTEL_COMPILER is defined.");
#else
    std::puts("__INTEL_COMPILER is NOT defined!");
#endif

#ifdef __INTEL_LLVM_COMPILER
    std::puts("__INTEL_LLVM_COMPILER is defined.");
#endif

#ifdef __clang__
    std::puts("__clang__ is defined.");
#endif

#ifdef SILENCE_DEPRECATED_WARNING
    _Pragma("clang diagnostic push")
    _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
    return square(0);
    _Pragma("clang diagnostic pop")
#else
    return square(0);
#endif
}
C:\Temp>icx --version
Intel(R) oneAPI DPC++/C++ Compiler for applications running on Intel(R) 64, Version 2025.0.4 Build 20241205
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.

Intel(R) oneAPI DPC++/C++ Compiler 2025.0.4 (2025.0.4.20241205)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files (x86)\Intel\oneAPI\compiler\2025.0\bin\compiler
Configuration file: C:\Program Files (x86)\Intel\oneAPI\compiler\2025.0\bin\compiler\..\icx.cfg

C:\Temp>icx /EHsc /nologo /W4 /DSILENCE_DEPRECATED_WARNING meow.cpp && meow
__INTEL_COMPILER is NOT defined!
__INTEL_LLVM_COMPILER is defined.
__clang__ is defined.

C:\Temp>icx /EHsc /nologo /W4 meow.cpp
C:\Temp\meow.cpp(27,12): warning: 'square' is deprecated [-Wdeprecated-declarations]
27 |     return square(0);
    |            ^
C:\Temp\meow.cpp(4,3): note: 'square' has been explicitly marked deprecated here
    4 | [[deprecated]] int square(int x) { return x * x; }
    |   ^
1 warning generated.

StephanTLavavej and others added 25 commits March 10, 2025 11:37
I added this workaround in GH 772, merged 2020-05-01.

We began using `if constexpr` unconditionally (requiring CUDA 10.1 Update 2) in GH 1544, merged 2021-01-05.

This workaround could have been removed then. At least I noticed this 4 years later!

I'm going back to always calling `_Integral_to_string()`, now enhanced with `if constexpr`.
…ng a constexpr 'hidden friend'".

This was fixed for VS by EDG 5.0 on 2018-12-15.
In GH 759 merged on 2020-04-30, I had to preserve the workaround because it was still needed for CUDA 9.2 (released 2018-05).
Fortunately I commented it, although very poorly.
It's been 5 years and we now require CUDA 12.4 (released 2024-03), so we can remove this workaround.
…xpr defaulted SMF calls non-trivial SMF in base class".
… to a temporary emits Assertion failed: Nerrors > 0".
…Symbol before it should find something this time, too' affecting STL atomic_ref test".
…staller hangs for VS 2022 17.13 and later).

Need to verify that GH_000639_nvcc_include_all is passing instead of being skipped.
This is the most preferred method for explicit outbound connectivity.
…ompilation fails with std::format and VS2022".

And add test coverage, verified in a VM.
This was added by GH 772, merged 2020-05-01, for CUDA 9.2 (released May 2018).
I don't observe this warning with CUDA 12.4 (released March 2024).
These were added by GH 1342, merged 2021-05-20, for VSO-1329304 "EDG doesn't understand Standard _Pragma".
We immediately fixed that locally and reported it upstream to EDG.

In that release, VS 2019 16.10, we had just begun requiring CUDA 10.1 Update 2 (released Aug 2019).
We now require CUDA 12.4 (released March 2024), and I observe that it understands Standard `_Pragma` just fine.

As for Intel, they deprecated and removed their old compiler (icc), which we no longer attempt to avoid breaking in any way. (See DevCom-10200300.)
For their new LLVM-based compiler (icx), I've verified that they accept Standard `_Pragma` on Windows.
Intel deprecated and removed their old compiler (icc), which we no longer attempt to avoid breaking in any way. (See DevCom-10200300.)

Their new compiler (icx) is LLVM-based and doesn't define `__INTEL_COMPILER` anymore, so all of our accumulated workarounds don't affect it and can be removed.

Instead, icx uses `__INTEL_LLVM_COMPILER` to specifically distinguish itself.

It also identifies itself as a `__clang__`, activating all of our Clang codepaths. For example, it accepts Clang-style diagnostic pragmas.

    C:\Temp>type meow.cpp
    #include <cstdio>
    #include <vector>

    [[deprecated]] int square(int x) { return x * x; }

    int main() {
    #ifdef __INTEL_COMPILER
        std::puts("__INTEL_COMPILER is defined.");
    #else
        std::puts("__INTEL_COMPILER is NOT defined!");
    #endif

    #ifdef __INTEL_LLVM_COMPILER
        std::puts("__INTEL_LLVM_COMPILER is defined.");
    #endif

    #ifdef __clang__
        std::puts("__clang__ is defined.");
    #endif

    #ifdef SILENCE_DEPRECATED_WARNING
        _Pragma("clang diagnostic push")
        _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
        return square(0);
        _Pragma("clang diagnostic pop")
    #else
        return square(0);
    #endif
    }

    C:\Temp>icx --version
    Intel(R) oneAPI DPC++/C++ Compiler for applications running on Intel(R) 64, Version 2025.0.4 Build 20241205
    Copyright (C) 1985-2024 Intel Corporation. All rights reserved.

    Intel(R) oneAPI DPC++/C++ Compiler 2025.0.4 (2025.0.4.20241205)
    Target: x86_64-pc-windows-msvc
    Thread model: posix
    InstalledDir: C:\Program Files (x86)\Intel\oneAPI\compiler\2025.0\bin\compiler
    Configuration file: C:\Program Files (x86)\Intel\oneAPI\compiler\2025.0\bin\compiler\..\icx.cfg

    C:\Temp>icx /EHsc /nologo /W4 /DSILENCE_DEPRECATED_WARNING meow.cpp && meow
    __INTEL_COMPILER is NOT defined!
    __INTEL_LLVM_COMPILER is defined.
    __clang__ is defined.

    C:\Temp>icx /EHsc /nologo /W4 meow.cpp
    C:\Temp\meow.cpp(27,12): warning: 'square' is deprecated [-Wdeprecated-declarations]
    27 |     return square(0);
        |            ^
    C:\Temp\meow.cpp(4,3): note: 'square' has been explicitly marked deprecated here
        4 | [[deprecated]] int square(int x) { return x * x; }
        |   ^
    1 warning generated.
See: https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/steps-checkout?view=azure-pipelines

This matches what we do in checkout-submodule.yml.

Retrying *tests* is an abomination. However, it's fine to retry checkouts, to be resilient to network gremlins.
@StephanTLavavej StephanTLavavej added the infrastructure Related to repository automation label Mar 12, 2025
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner March 12, 2025 05:26
@github-project-automation github-project-automation bot moved this to Initial Review in STL Code Reviews Mar 12, 2025
@StephanTLavavej

This comment was marked as resolved.

This comment was marked as resolved.

@StephanTLavavej StephanTLavavej moved this from Initial Review to Final Review in STL Code Reviews Mar 12, 2025
@StephanTLavavej
Copy link
Member Author

I'm speculatively mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

Copy link
Member

@davidmrdavid davidmrdavid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks ⭐!

No blockers, just two questions:

@StephanTLavavej StephanTLavavej moved this from Final Review to Merging in STL Code Reviews Mar 13, 2025
@StephanTLavavej StephanTLavavej merged commit 3804078 into microsoft:main Mar 13, 2025
39 checks passed
@github-project-automation github-project-automation bot moved this from Merging to Done in STL Code Reviews Mar 13, 2025
@StephanTLavavej StephanTLavavej deleted the vs17.14p2 branch March 13, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Related to repository automation
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

CUDA's installer hangs for VS 2022 17.13 and later libcxx: Sporadic crash in thread.thread.destr/dtor.pass.cpp
2 participants