When building static libraries rustc currently prints required dependencies:
note: link against the following native artifacts when linking against this static library
note: library: System
note: library: resolv
note: library: c
note: library: m
I've recently made a PR to change the format it uses and display only when --print=native-static-libs
flag is added, but I'm having doubts whether this was a good idea:
- printing of all other things is done instead of compilation, but this option is an exception that it prints while building
- it still prints as a "note:", requiring parsing of rustc output.
- This overlaps with RFC for build system integration eRFC: Cargo build system integration by aturon · Pull Request #2136 · rust-lang/rfcs · GitHub and from integration perspective, it's not good.
Any suggestions what, if anything, should be done with it? I wonder whether releasing this flag now will create a feature that becomes obsolete by future build system integration, causing unnecessary churn.
I've changed the list of libraries to be printed in a more useful format, but in retrospect, printing is probably inappropriate method. I think these flags should be written to a file in the same location as the .a
file produced (e.g. in libfoo.a.linkflags
), so that users of the library can find the metadata after the build, and rustc regular text output is not abused as loosely structured data format for interchange.