I would like to add a new .gn variable named add_rlib_link_libraries to unbreak the Fuchsia build, which cannot use upstream GN at the moment.
Because recent changes to the way the Ninja command for Rlib artifacts is generated break our remote builds, so we are stuck with an older version of GN right now :-/
I have uploaded
https://gn-review.googlesource.com/c/gn/+/15760 which contains more information about the problem, but in a nutshell:
1) The Ninja command generated by Ninja for Rlib artifacts was recently changed in
[1] to omit linked libraries from the Ninja command
2) This broke Fuchsia local builds, so a fix was submitted in
[2] to add missing -Cnative=<libdir> arguments which are necessary for the rustc compiler to find now-implicit linked libraries.
3) Unfortunately, our remote builds are still broken, because we process the Ninja command to find all input files to send to remote builders. I.e. we really need the -Clink-arg=libfoo.a arguments to appear on the command line.
So the new add_rlib_link_libraries variable would restore the old behavior. My CL sets its default value to true, in order to be able to roll the newest GN into the Fuchsia tree, then we can add `add_rlib_link_libraries = true` to the Fuchsia .gn file, then the GN default value can be changed to false.
Let me know if this sounds too crazy, or if you have a better idea on how to solve this.
Thanks
- Digit (for the Fuchsia team)