Skip to content

CI complain about missing standard module interface for Windows build #68

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

Closed
filipsajdak opened this issue Apr 19, 2023 · 18 comments
Closed
Labels
bug Something isn't working

Comments

@filipsajdak
Copy link

Some tests are failing due to the following error:

cpp2util.h(48): fatal error C1011: cannot locate standard module interface. Did you install the library part of the C++ modules feature in VS setup?
@alexreinking
Copy link
Contributor

Thanks for opening this issue... I have not had a chance to look at this.

@alexreinking
Copy link
Contributor

@JohelEGP -- do you have any idea why this is happening? It used to work, then became intermittent, and now is consistently failing.

@JohelEGP
Copy link
Contributor

JohelEGP commented May 30, 2023

I suppose it's the pure2 tests that are failing because they're trying to use C++ modules.
I can't find platform-specific flags in the CMake sources, so perhaps it's missing one of the advertised ones at https://github.com/hsutter/cppfront#how-do-i-build-cppfront.

@alexreinking
Copy link
Contributor

so perhaps it's missing one of the advertised ones

No, unfortunately it's not so simple. Here's one of the command lines from the tests:

C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1434~1.319\bin\HostX64\x64\cl.exe  /nologo /TP  -external:ID:\a\cppfront\cppfront\_local\include -external:W0 /DWIN32 /D_WINDOWS /EHsc /O2 /Ob2 /DNDEBUG -std:c++20 -MD /experimental:module /showIncludes /FoCMakeFiles\test-case.dir\_cppfront\pure2-bounds-safety-span.cpp.obj /FdCMakeFiles\test-case.dir\ /FS -c D:\a\cppfront\cppfront\build\regression-tests\pure2-bounds-safety-span\build\_cppfront\pure2-bounds-safety-span.cpp

I can clearly see both -std:c++20 and /EHsc in there.

@JohelEGP
Copy link
Contributor

@alexreinking
Copy link
Contributor

Ugh, I wish I knew why that wasn't always needed. We can try adding that.

@JohelEGP
Copy link
Contributor

@alexreinking
Copy link
Contributor

It seems like it's already added

Oh, and sure enough, it's in the command line above... maybe removing it would help, if the MSVC version is new enough?

@JohelEGP
Copy link
Contributor

@alexreinking
Copy link
Contributor

alexreinking commented May 31, 2023

We could try this

target_compile_features(
    cppfront_cpp2util
    INTERFACE
    $<IF:$<CXX_COMPILER_ID:MSVC>,cxx_std_23,cxx_std_20>
)

instead of this:

target_compile_features(cppfront_cpp2util INTERFACE cxx_std_20)

That should give -std:c++latest for MSVC and will turn into -std:c++23 in future versions.

@JohelEGP
Copy link
Contributor

I don't think that's it. It still fails: https://compiler-explorer.com/z/aGaj5z58q.

@JohelEGP
Copy link
Contributor

Maybe it's just as the error message says,
and there's something that needs to be installed in the environment.

@JohelEGP
Copy link
Contributor

@alexreinking
Copy link
Contributor

See https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/fatal-error-c1011?view=msvc-170.

Yeah, that's not going to work on GitHub Actions, though.

@JohelEGP
Copy link
Contributor

Maybe you can downgrade the version of MSVC to one that works: https://github.com/ilammy/msvc-dev-cmd#inputs.

@alexreinking
Copy link
Contributor

This is frustrating... I cannot reproduce the error locally (with VS2022, v14.34 toolset, same as GHA). Everything "just works" here. The documentation suggests that the C++ modules are indeed installed (component Microsoft.VisualStudio.Component.VC.Modules.x86.x64)

@alexreinking
Copy link
Contributor

I've put in the time I have to look at this during the week. I'll try again on the weekend.

@alexreinking
Copy link
Contributor

This is no longer the issue with MSVC. Now we have issues in the build/check tests

@alexreinking alexreinking added the bug Something isn't working label Jun 20, 2024
@alexreinking alexreinking changed the title [BUG] CI complain about missing standard module interface for Windows build CI complain about missing standard module interface for Windows build Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants