Closed pkgw closed 4 years ago
I think https://github.com/tectonic-typesetting/tectonic/pull/664 should fix what you are seeing.
The static=
was dropped when vcpkg-rs only supported Windows. As I understand it, static=
is definitely at least unnecessary on Windows, and possibly broken. There is a nightly static-nobundle
feature that (I think) is supposed to fix whatever was not working.
I tried making the Linux build mark everything as static=
but this resulted in duplicate symbols instead of missing symbols. (I wonder if this is because both the tectonic rlib and the test binaries have the same build.rs run for them since they are in the same crate?)
As an aside, I just had to fix the Linux tests for vcpkg-rs by manually printing cargo:rustc-link-lib=brotlicommon-static
from build.rs because the libraries were in the wrong order. The particular test links to harfbuzz since it's one of the more complex things I could find. For some reason, tectonic does not seem to have the same problem. I still do not have a solution for guaranteeing the correct link order from vcpkg. (vcpkg itself works fine when it is used as intended.)
OK, thanks for investigating! I'll close this since it sounds like there isn't anything to be changed in this crate.
See #27 for potential solution to library ordering problem described above.
I'm testing out some new Linux builds of tectonic using vcpkg-rs. My
cargo build
commands works OK, butcargo test
doesn't because of missing symbols. As far as I can tell, the root cause is that the link information being emitted by vcpkg-rs doesn't tell Rust that it should be linking with static libraries. That is, the output from build.rs is like this:instead of
rustc-link-lib=static=harfbuzz
, etc.I notice that there used to be a test for
vcpkg_target.is_static
that would emit thestatic=
variant, but it was removed in 34292487ce112e69d99e561c38f49d1a9ba8e0eb . It is not obvious to me what the motivation for that was, but my best understanding is that there should be a codepath that at least makes sure thatstatic=
comes back on Linux static builds.