-
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 not executing archive command despite its presence in build.ninja file #2553
Comments
Can you be more specific about what's going on here, what I mean is:
A minimal |
It is a clean build and it creates glib/libglib-2.0.so.0 file but not glib/libglib-2.0.a. "ninja -t commands glib/libglib-2.0.a" command ends with the ar command as follows: The output of "ninja -t inputs all" doesn't include glib/libglib-2.0.a. This is the same even in the working case. |
I just wanted to understand more. Can you tell why "ninja -t inputs all" should have "glib/libglib-2.0.a" in the output? |
If Are you sure the archive is listed in your |
Yes, the archive is listed in "build all:" and is not a validation target. Even in a clean build,it doesn't create the archive. How can we make sure |
Then this looks like a bug in the A reproduction case is needed to inspect what's going on here. Can you share your Ninja build plan somewhere? We don't need build artifacts or source files, just the |
Please ignore the echo commands in rules c_LINKER and AIX_LINKER. I added those for debugging. |
A small update on this issue. I have rebuilt Ninja 1.11.1, 1.12.1 and tip-of-tree to compare results. It appears that the logic for Unfortunately, this is not enough to understand why the issue exists. I couldn´t find any other difference when using other tools (i.e. without building anything) with the build plan you provided. For example, all three versions, the command appears properly with Can I ask you to try a build with a Ninja binary built from the current tip-of-tree to see if the issue still persists? Also, the full output of Note that the |
Thanks for the update. I tried with the master branch, unfortunately the issue still exists. |
We tried with a simple example where ninja executed the archive command but not in this case. |
Thanks for the In the log you shared, the first command to fail is trying to link Inspection of the build plan shows that the corresponding build rules does not list libglib-2.0.a as an input, though it does list it in the
And the build command for
As such, there is nothing that tells Ninja that these targets require glib/libglib-2.0.a to be built first, and Ninja starts to build the gobject library before the archive is available, hence the failure. Note that how Ninja determines the order of unrelated parallel commands has changed after 1.11.1 (probably through PR#2177, to optimize it for common cases). I assume that before that, your builds were working by mere chance, i.e. because Ninja happened to select a dispatch order that didn´t trigger the invalid dependencies in your build plan. In other words, the generator has created a Ninja build plan with missing / invalid dependencies. Hope this helps. |
This seems related to mesonbuild/meson#11850, @KamathForAIX may know more. We (meson) currently rely on external contributions for AIX. Please do open that Meson bug report. |
Thank you, @eli-schwartz, for tagging me. I have reproduced this issue in my environment. Your analysis is spot on @digit-google. Thank you very much. Yes,
This here is a problem. This indeed made Ninja feel the archive was dummy and had nothing to do apart from being just an archive. In AIX, we archive shared libraries. I need to get glib/libglib-2.0.a in the SHSYM to tell Ninja we need the symbols from the archived shared library and not from the shared object. And then I have fixed the issue by making changes here. Please find the log of a successful compile and install of glib2 below this message with any version of Ninja >= 1.12 or the master after the fix. I will work with @eli-schwartz to raise a PR and fix this in the meson page. We can close this issue here. Have a nice day ahead.
|
We are trying to build glib2 with the latest ninja 1.12.1.
In AIX, we archive shared libraries. The rule for the same is written in build.ninja as follows:
rule AIX_LINKER
command = ar -q -v $out $in && rm -f $in
description = Archiving AIX shared library
and the command to build the archive is as follows.
build glib/libglib-2.0.a: AIX_LINKER glib/libglib-2.0.so.0
This command is not being executed.
In the build all: section of the build.ninja file, we do have the "glib/libglib-2.0.a" target.
Ninja was working fine till 1.11.1 in AIX. Please let me know what could be the reason for this.
The text was updated successfully, but these errors were encountered: