-
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
CanonicalizePath should resolve symbolic links #2528
Comments
The problem seems to be that your compiler is producing paths that appear to be ambiguous, i.e. whose interpretation depends on the file system state (which in general is a mutable thing out of control from Ninja).
An alternative would be to change how depfiles are processed by Ninja, but again, this introduces a ton of complexity, and will slow down builds in general. I suggest you instead use a compiler wrapper to rewrite the depfile paths instead before Ninja parses them. Another option is to use an option like |
Thanks! It seems to be a clang problem (while GCC does expands symlinked paths).
|
I did a simple benchmark. When compiling clang, ~3.6k object files, on Ninja's startup, I think this is does not introduce a huge performance impact, so I still think that the canonicalization process should involve symbolic link resolving.
I am not sure how the path is ambiguous, it should always only point to the underlying file. There seem not to be any filesystems who allows users to change the path canonicalization process' behavior. |
Performance of I would be very wary about anything that makes startup slower. Do you have an actual PR to benchmark against real use cases? |
On AOSC OS (a usr-merged distribution), when using Ninja + CMake + Clang, here is a issue:
clang -M
generate things like this:/bin/../lib64/gcc/x86_64-aosc-linux-gnu/13.2.0/../../../../include/c++/13.2.0/iosfwd
/bin
is symbolically linked to/usr/bin
on usr-merged systems, so it is actually/usr/include
/include/xxx
, without realizing/bin
is a symbolic link.ninja_deps
, and sees/include/xxx
as missing and dirty, thus rebuilding all sources, everytimeninja/src/graph.cc
Lines 712 to 719 in a3fda2b
The text was updated successfully, but these errors were encountered: