Skip to content

regression_tests/test_output has not been updated #383

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
ntrel opened this issue Apr 18, 2023 · 6 comments
Closed

regression_tests/test_output has not been updated #383

ntrel opened this issue Apr 18, 2023 · 6 comments
Labels
question - further information requested Further information is requested

Comments

@ntrel
Copy link
Contributor

ntrel commented Apr 18, 2023

(I'm still trying to figure out how to get ctest to work).

Tests are failing after b34f23a: https://github.com/modern-cmake/cppfront/actions/workflows/ci.yml

Just as a random example:

@@ -1,5 +1,4 @@
 
-#define CPP2_USE_MODULES         Yes
 
 //=== Cpp2 type declarations ====================================================
 
@@ -24,7 +23,7 @@ auto print_and_decorate(auto const& thing) -> void;
 #line 2 "pure2-bounds-safety-span.cpp2"
 [[nodiscard]] auto main() -> int
 {
-    std::vector<std::string> words {"decorated", "hello", "world"}; 
+    std::vector<std::std::move(string)> words {"decorated", "hello", "world"}; 
 
     std::span<std::string> s {words}; 
@hsutter hsutter added the question - further information requested Further information is requested label Apr 19, 2023
@hsutter
Copy link
Owner

hsutter commented Apr 19, 2023

Thanks. Do you have a repro test case that generates that bad code?

@filipsajdak
Copy link
Contributor

Hm... I have checked the @alexreinking repo, and failures might be due to wrong configuration of the CI pipeline:

[2/3] Building CXX object CMakeFiles\test-case.dir\_cppfront\pure2-bounds-safety-span.cpp.obj
FAILED: CMakeFiles/test-case.dir/_cppfront/pure2-bounds-safety-span.cpp.obj 
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 -MD /experimental:module -std:c++20 /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
D:\a\cppfront\cppfront\_local\include\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?
ninja: build stopped: subcommand failed.

So, it complains about:

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?

The newest builds are failing due to change from load.h to io.h :

CMake Error at CMakeLists.txt:28 (add_executable):
  Cannot find source file:

    D:/a/cppfront/cppfront/cppfront/source/load.h

I have created the issues in modern-cmake/cppfront repository to let @alexreinking know about them: modern-cmake/cppfront#67 & modern-cmake/cppfront#68

@ntrel
Copy link
Contributor Author

ntrel commented Apr 22, 2023

Do you have a repro test case that generates that bad code?

On that I just ran my cppfront build on regression_tests/pure2-bounds-safety-span.cpp2 and diff'd it with the .cpp one in test_output. I may be doing something wrong.

@hsutter
Copy link
Owner

hsutter commented Apr 22, 2023

Odd. If you just build cppfront.exe itself using the instructions here and then use it to build that file you should get the same .cpp that's checked in. That's what I do before every commit.

I'll close this for now, but please reopen if you get a repro using those steps.

@hsutter hsutter closed this as completed Apr 22, 2023
@hsutter
Copy link
Owner

hsutter commented Apr 22, 2023

BTW another thing you can try is Goldbolt and select language "Cpp2 / cppfront."

When I cut-and-paste the code from regression_tests/pure2-bounds-safety-span.cpp2 there, it looks fine:
https://godbolt.org/z/zs3ashW94

I don't know how it could try to stick a move into a template parameter list, but I also tried to trick it by having a local variable named string and that doesn't seem to fool it:
https://godbolt.org/z/v4jdWTMeq

So for now I don't have a repro, but please reopen if you can make a repro that works on Godbolt. If it ever does bad code gen like that, I'd want to know about it and fix it. Thanks for taking the time to look into this!

@alexreinking
Copy link

I've updated the modern-cmake/cppfront repo to work with the new header structure. However, the regression tests are still failing on msvc because it looks like the windows-2022 runner has a broken Visual Studio installation and the windows-2019 runner's libraries/headers are too old to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question - further information requested Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants