-
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
build.ninja not reloaded if generated with an absolute path #1240
Comments
This comment was marked as abuse.
This comment was marked as abuse.
I don't know, don't use Ninja lately |
This comment was marked as abuse.
This comment was marked as abuse.
Hi @jonesmz, this is still reproducible with Ninja justin@rhea ~/t/ninja> cat build.txt
rule message
command = echo "messaging"; cp $in $out
rule regen
command = echo "regenerating"; cp $in $out
generator = 1
build /home/justin/tmp/ninja/other.txt: message /home/justin/tmp/ninja/other.in
build /home/justin/tmp/ninja/build.ninja: regen /home/justin/tmp/ninja/build.txt
justin@rhea ~/t/ninja> cp build.txt build.ninja
justin@rhea ~/t/ninja> echo "some text" > other.in
justin@rhea ~/t/ninja> ~/src/external/ninja/ninja -j1 -v
[1/1] echo "messaging"; cp /home/justin/tmp/ninja/other.in /home/justin/tmp/ninja/other.txt
messaging
justin@rhea ~/t/ninja> touch build.txt other.in
justin@rhea ~/t/ninja> ~/src/external/ninja/ninja -j1 -v
[1/2] echo "messaging"; cp /home/justin/tmp/ninja/other.in /home/justin/tmp/ninja/other.txt
messaging
[2/2] echo "regenerating"; cp /home/justin/tmp/ninja/build.txt /home/justin/tmp/ninja/build.ninja
regenerating
justin@rhea ~/t/ninja> # edit build.txt and build.ninja to use just 'build.ninja' as the rule output
justin@rhea ~/t/ninja> touch build.txt other.in justin@rhea ~/t/ninja> ~/src/external/ninja/ninja -j1 -v [1/1] echo "regenerating"; cp /home/justin/tmp/ninja/build.txt build.ninja
regenerating
[1/1] echo "messaging"; cp /home/justin/tmp/ninja/other.in /home/justin/tmp/ninja/other.txt
messaging
justin@rhea ~/t/ninja> ~/src/external/ninja/ninja --version
1.10.0.git |
I encountered the same problem. If the build statement uses a relative path, but uses |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
According to the manual,
If the top-level Ninja file is specified as an output of any build statement and it is out of date, Ninja will rebuild and reload it before building the targets requested by the user.
I have a
build.ninja
file where all paths are absolute. I have a rule that re-runs generator if configuration script changed, i.e./home/user/project/build.ninja: regenerate /home/user/project/configure.py
All build targets have depend on
/home/user/project/build.ninja
as an order-only dependency.If I run Ninja without arguments after a change in
configure.py
, it runs the generator to re-generatebuild.ninja
, but doesn't reload the file, and uses old, no longer valid rules to build the project. However, if I run it asninja -f /home/user/project/build.ninja
, it would re-run the generator, reloadbuild.ninja
and rebuild the changed rule. Looks like a path normalization bug.The text was updated successfully, but these errors were encountered: