-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Spurious error parsing depfiles: inputs may not also have inputs? #1962
Comments
Do you think this is a different bug? I have a module When I compile the module without a dependency on the importable header, I do get
But when I compile with parallelization, I get
because the module builds in parallel with the importable header, even though I have set the build dependency in CMake (even with
even though GCC doesn't generate an object file for an importable header. |
FYI, |
It has to do with Nathan's GNU make work to support modules. See this paper: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1602r0.pdf |
This is useful, but really a proper fix. Things like this should work out of the box with default values |
I am also disappointed at the depfiles being more Make syntax by default as well (I believe I expressed this to Nathan at the time in 2019, but it had already been merged by then). |
I'm trying to get C++20 modules working with CMake/Ninja, for some definition of "working". I'm using GCC, CMake, and Ninja compiled from github (today). The compilation rule for a single file is this:
Which produces the following .d file:
The error happens on the last line. The input is poisoned on the line above because
gcm.cache/project.core.gcm
is registered as an input for the phonyproject.core.c++m
target. And apparently, there's some prohibition against inputs (dependencies) also appearing as outputs (targets), but apparently, not the reverse. Or at least maybe all outputs need to appear lexically before their appearance as inputs?I'm also not sure why GCC is producing a secondary dependency for the gcm target. It might have something to do with building module interface partitions. I'm currently looking at GCC to see why it's producing these things and in this order.
I'd submit a PR disabling the error, but I'm pretty sure that's not the right solution. I don't know enough about the internals of ninja to propose a better resolution.
The text was updated successfully, but these errors were encountered: