Skip to content
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

dyndep: reconcile dyndep-specified outputs with depfile-specified inputs #1937

Merged
merged 2 commits into from
Mar 28, 2021

Conversation

bradking
Copy link
Contributor

When a path loaded from a depfile does not have a node, we create a new node with a phony edge producing it. If we later load a dyndep file that specifies the same node as an output of a known edge, we previously failed with a "multiple rules generate ..." error. Instead, since the conflicting edge was internally generated, replace the node's input edge with the now-known real edge that produces it.

While at it, add a dedicated test for dyndep-discovered implicit dependencies. Previously this was covered only as part of more complex tests.

Previously this was covered only as part of more complex tests.
@bradking
Copy link
Contributor Author

@jhasse this resolves a dyndep+depfile corner case I found while investigating #1932 and #1933.

When a path loaded from a depfile does not have a node, we create a new
node with a phony edge producing it.  If we later load a dyndep file
that specifies the same node as an output of a known edge, we previously
failed with a "multiple rules generate ..." error.  Instead, since the
conflicting edge was internally generated, replace the node's input edge
with the now-known real edge that produces it.
@bradking bradking force-pushed the dyndep-out-depfile-in branch from 6f706d2 to fa577b6 Compare March 24, 2021 21:15
@jhasse
Copy link
Collaborator

jhasse commented Mar 25, 2021

Thanks! Will this fix https://gitlab.kitware.com/cmake/cmake/-/issues/20025 ?

@jhasse jhasse added this to the 1.11.0 milestone Mar 25, 2021
@jhasse jhasse added the bug label Mar 25, 2021
@bradking
Copy link
Contributor Author

CMake Issue 20025 needs this change, but will also need changes to CMake to use this combination of features. The case in that issue has build-time-discovered outputs of the cmake_autogen command that are also build-time-discovered dependencies reported by the compiler in a depfile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants