Closed zeroomega closed 1 year ago
C.C. @petrhosek @mstorsjo
I tried to reproduce this, by running the libcxx tests with a freshly built clang-cl from git main, but I don't hit this issue. So it's most probably not a code change in upstream clang-cl.
It's possible that it's caused by a newer MSVC than the one used in the CI environment (and in my test environment). The MSVC used to compile clang doesn't affect things, but libc++ in Clang-cl environments builds on top of parts of the MSVC STL and vcruntime, so it's plausible that upstream changes there affects the situation. Let me see if I can try that somehow easily...
Even if linking against the most recent MSVC libraries, I can't reproduce your situation.
I also tested building the test executable with the exact command from COMPILED WITH
above in your example, but it still fails expectedly. Since you can reproduce it in two separate locations, it sounds like it is some configuration that differs, that seem to affect this.
Can you share the __config_site
for your libc++ build? I doubt that it contains something of relevance though...
As it seems to be some difference in how it is configured (systematically) in your builds, can you try building in plain standalone mode, with the most basic default configuration? Adapted from the steps at https://libcxx.llvm.org/BuildingLibcxx.html#cmake-ninja-msvc, can you do e.g. this:
> cd llvm-project
> set PATH=c:\path\to\recent\build\bin;%PATH%
> mkdir build-libcxx
> cd build-libcxx
> cmake -G Ninja ../runtimes -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DLLVM_ENABLE_RUNTIMES=libcxx
> ninja
> python bin/llvm-lit.py -a ../libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp
If that works, you can use that as basis to try to pinpoint the difference to the build/test environment in your full runtimes build.
Thanks for looking into this.
I put the __config_site
content to https://gist.github.com/zeroomega/e0cce833375b8e0c99828dca870571c2 . This file is also available in our clang toolchain package for Windows x64: https://chrome-infra-packages.appspot.com/p/fuchsia/third_party/clang/windows-amd64/+/git_revision:ebd0b8a0472b865b7eb6e1a32af97ae31d829033
I will try to build libcxx in standalone mode and see if I can reproduce it.
I see what the relevant bit is now; if building libcxx with LIBCXX_ABI_VERSION=2
, then this test does pass unexpectedly.
Shall we modify the test or disable the test if LIBCXX_ABI_VERSION=2
?
Overall, for non-MSVC environments, we definitely should keep testing this with LIBCXX_ABI_VERSION=2
. If it were possible, I guess the best thing would be to change the xfail into XFAIL: target=x86_64-pc-windows-msvc && stdlib=libc++ && libcxx-abi-version-1
. I don't know if we have such a test tag, but it should be fairly straightforward to define it if we don't have it yet.
We are working on enable
check-runtimes-x86_64-pc-windows-msvc
test on our Clang Windows bots and we noticed thatstd/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp
which is expected to fail when targetingx86_64-pc-windows-msvc
while usinglibc++
, is passing under this environment.failing bot run: https://luci-milo.appspot.com/raw/build/logs.chromium.org/fuchsia/led/trev_google.com/e3b2824e614fce4acbd79a4b580878bc10a4fa9ac26086aaf5189b0bb88b51aa/+/build.proto
and error message (locally reproduced):
We have some suspicion that it might be related to https://devblogs.microsoft.com/cppblog/improving-copy-and-move-elision/ , however, while we use the Windows SDK came with the VS2022 to build the clang on Windows, we use the clang-cl to build our stage 1 Clang for Windows instead of using the cl from msvc, so in theory, this msvc side change shouldn't affect us.
Is it a behavior change from clang-cl side? Should we update this test to expect to PASS to match the actual behavior we saw?