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
Turn duplicate rules for the same target into an error #931
Milestone
Comments
#940 was another bug in this area. |
nico
added a commit
to nico/ninja
that referenced
this issue
Mar 24, 2015
This is step 1 on ninja-build#931. Duplicated edges will become an error by default in the future.
nico
added a commit
to nico/ninja
that referenced
this issue
Mar 24, 2015
This is step 1 on ninja-build#931. Duplicated edges will become an error by default in the future.
nico
added a commit
to nico/ninja
that referenced
this issue
Mar 24, 2015
This is step 1 on ninja-build#931. Duplicated edges will become an error by default in the future.
nico
added a commit
to nico/ninja
that referenced
this issue
Mar 24, 2015
This is step 1 on ninja-build#931. Duplicated edges will become an error by default in the future.
RfC to make this err by default from a while ago (no concerns): https://groups.google.com/forum/#!topic/ninja-build/ob5vhaGvvTc |
nico
added a commit
to nico/ninja
that referenced
this issue
Apr 5, 2018
You can still opt out of this by passing `-w dupbuild=warn`. But if you're getting this diagnostic, your build files are incorrect and you should ideally just fix them. This is step 3 on ninja-build#931 I sent an RfC to ninja-build a few months ago; nobody objected.
projectgus
pushed a commit
to projectgus/ninja
that referenced
this issue
Apr 26, 2018
You can still opt out of this by passing `-w dupbuild=warn`. But if you're getting this diagnostic, your build files are incorrect and you should ideally just fix them. This is step 3 on ninja-build#931 I sent an RfC to ninja-build a few months ago; nobody objected.
kdesysadmin
pushed a commit
to KDE/krita
that referenced
this issue
Mar 9, 2019
Because the Ninja people, in their infinite meddlesomeness have decided that you shouldn't have two unittests with the same name in a body of code (ninja-build/ninja#931) we need to rename one of these tests to something else. Whatever.
kasbah
pushed a commit
to kasbah/ninja
that referenced
this issue
Mar 23, 2021
This is step 4 on ninja-build#931.
rascani
pushed a commit
to rascani/ninja
that referenced
this issue
Apr 29, 2021
This is step 4 on ninja-build#931.
jhasse
added a commit
to jhasse/ninja
that referenced
this issue
Nov 29, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If multiple build edges generate the same output, ninja currently warns with
Internally, ninja just ignores all but the last rule. In practice, this usually happens if people accidentally repeat a rule in their meta-buildsystem. But for rules with multiple targets, ninja's current handling of this can lead to inconsistent build graphs that can lead to crashes (see e.g. #867). Also, some people mistake this diagnostic for a bug in ninja instead of a bug in their build files (e.g. #543 last comment). Arguably, ninja could try to check if the two rules are exactly the same and not complain in that case, but
cd ../.. && foo/bar.sh
andcd ../../.. && baz/foo/bar.sh
, or they could set slightly different env vars (which happen to not make a difference in practice, but ninja can't know that)So this should be an error, not a warning. However, this is something that happens in practice every now and then (examples: http://reviews.llvm.org/D6166#109619 http://crbug.com/351052), so the rollout for this should look something like this:
--dupeedge=[warn|error]
?), make a release with this. (Mention the flag name in the warning text.)Not sure if we ever actually want to do 5, but the rest all seem like Obviously Good steps.
The text was updated successfully, but these errors were encountered: