-
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
ninja_workdir: reconcile relative and absolute paths in depfile,dyndep files with build manifest #1924
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Convert a working directory path to forward slashes, with a trailing slash.
This will allow per-parser behavior after loading.
Top-level bindings in the build manifest allow generators to give ninja information that is not tied to a specific rule or build statement. We already have a two top-level bindings with dedicated implementations: * builddir: used by NinjaMain * ninja_required_version: checked directly by parser Add infrastructure to allow the manifest parser itself to check more top-level bindings at the end of parsing.
Add a binding that the build manifest generator can use to tell ninja the working directory to use for the build. This allows a command like `ninja -f /path/to/some/build.ninja` to work, regardless of the caller's working directory, if `build.ninja` has the binding.
Previously this was covered only as part of more complex tests.
Based on #1917. |
lukka
reviewed
Mar 6, 2021
A depfile may contain relative and/or absolute paths based on compiler behavior and the include directory flags given. It is not always possible to make these exactly match corresponding paths in the build manifest. If Ninja does not find an exact match for a depfile path, try converting it to the opposite kind of path (absolute or relative) and look again. If neither matches, add a node with the path as-is. Issue: ninja-build#1251
A dyndep file may contain relative and/or absolute paths generated by external tooling just as a depfile might. Apply the same lookup rules we use for depfile paths to dyndep file paths too. Fixes: ninja-build#1251
bradking
force-pushed
the
depfile-path-matching
branch
from
March 8, 2021 14:44
c01bd4e
to
78068ee
Compare
bradking
changed the title
depfile,dyndep: reconcile relative and absolute paths with build manifest
ninja_workdir: reconcile relative and absolute paths in depfile,dyndep files with build manifest
Mar 9, 2021
Closing for now. I have some ideas on a more general solution. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A depfile (or dyndep file) may contain relative and/or absolute paths based on compiler
behavior and the include directory flags given. It is not always
possible to make these exactly match corresponding paths in the build
manifest. If Ninja does not find an exact match for a depfile path, try
converting it to the opposite kind of path (absolute or relative) and
look again. If neither matches, add a node with the path as-is.
Fixes: #1251