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
Subdoc fails with missing modmap files #437
Comments
Same error occurs in clang 17, seems to be something else. Maybe a cmake change? |
Yeah it's CMake 3.28 which added C++20 module support. CMake's ninja generator puts something like this into the command line for each file:
And libclang doesn't seem to know what to do with it. |
No clang docs seem to mention what the |
it's from here: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8611/diffs Which adds the @foo.modmap to the command line, which CL docs say is a command-file which has other commands in it? https://learn.microsoft.com/en-us/cpp/build/reference/cl-command-files?view=msvc-170 But the files don't exist for me after building actual binaries either. The test expects |
Oh this blog post discusses it: https://nibblestew.blogspot.com/2023/10/the-road-to-hell-is-paved-with-good.html
This is a file that cmake generates before running the compile command. Since clang tools are not cmake... the file does not exist and the resulting compile_commands.json is broken for any other use. Oh no. |
Since only CMake will generate these files during compilation, we can't use them obviously. I think our only option is to strip them out of the command line. This will work until code actually uses modules at which point CMake will not provide a command line in compile_commands.json that is suitable to reproduce building the C++ file. And we may need to get off of CMake or something. |
Posted to the cmake discussion here: https://discourse.cmake.org/t/how-to-control-the-location-of-the-c-20-binary-module-interface-bmi-output-directory/7968/13 For now, we will strip out the modmap command-file from the command-line that CMake generates specifically by looking for |
CMake 3.28 adds a modmap command file to the command line that it writes into compile_commands.json but the file does not actually exist outside of cmake compiling. This means the command line in the compile_commands.json fails with an error about the missing file: ``` error: no such file or directory: '@sus/CMakeFiles/subspace_unittests.dir/mem/addressof_unittest.cc.o.modmap' ``` To work around this we can strip out the use of the modmap command-file for now. This will break compilation later when C++ 20 modules are being used though. CMake will need to find a way to provide a command line in the compile_commands.json file which can actually be used by other tools to reproduce the compilation step. CMake discussion: https://discourse.cmake.org/t/how-to-control-the-location-of-the-c-20-binary-module-interface-bmi-output-directory/7968/13 Fixes chromium#437
CMake 3.28 adds a modmap command file to the command line that it writes into compile_commands.json but the file does not actually exist outside of cmake compiling. This means the command line in the compile_commands.json fails with an error about the missing file: ``` error: no such file or directory: '@sus/CMakeFiles/subspace_unittests.dir/mem/addressof_unittest.cc.o.modmap' ``` To work around this we can strip out the use of the modmap command-file for now. This will break compilation later when C++ 20 modules are being used though. CMake will need to find a way to provide a command line in the compile_commands.json file which can actually be used by other tools to reproduce the compilation step. CMake discussion: https://discourse.cmake.org/t/how-to-control-the-location-of-the-c-20-binary-module-interface-bmi-output-directory/7968/13 Fixes #437
A followup blog post was made about this issue specifically: https://nibblestew.blogspot.com/2023/12/even-more-breakage-in-c-module-world.html |
A recent change in Clang 18 has made subdoc fail to execute the clang tool through libclang, generating an error for every .cc file it attempts to compile:
Subspace is not using modules so there's no modmaps expected.
llvm/llvm-project#75142 looks like it could be the reason.
First appeared on the try run here: #436
The text was updated successfully, but these errors were encountered: