Permalink
1 comment
on commit
sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Don't try to link C from rust doctests for nss detection
This is really annoying, since we can't use cfg(test) for doctests.
- Loading branch information
Showing
with
65 additions
and 3 deletions.
- +6 −0 src/rust/Cargo.toml
- +6 −0 src/rust/crypto/Cargo.toml
- +6 −0 src/rust/external/Cargo.toml
- +5 −1 src/rust/protover/Cargo.toml
- +12 −2 src/rust/protover/protover.rs
- +6 −0 src/rust/smartlist/Cargo.toml
- +6 −0 src/rust/tor_allocate/Cargo.toml
- +5 −0 src/rust/tor_log/Cargo.toml
- +6 −0 src/rust/tor_rust/Cargo.toml
- +6 −0 src/rust/tor_util/Cargo.toml
- +1 −0 src/test/test_rust.sh
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This comment has been minimized.
a8ac21fI did some investigation here because I couldn't quite figure out why this was necessary, and it seemed suspicious!
At least on the current master branch (may not have been true at the time though!) I think doctests are a red herring. The problem here was that the
protovercrate links to theexternalcrate which requires C symbols but doesn't link to them. (or rather it doesn't emit directives necessary to link those symbols in with the Rust compiler).The
protovercrate then has two test suites. One is the library itself compiled with--test, and the other is thetests/protover.rsfile. Both are compiled with--test, but thetests/protover.rsintegration test links against an actual copy oflibprotover.rlib, which is itself not compiled with--test. That's why I think you needed the extra feature here, you want both tests to not link toexternal, but only one is compiled with--cfg test.(there may have also been an issue with doctests too! I'd have to look further into the failures)
FWIW I think the best long term fix for this is to update the
externalcrate to use../build.rslike thecryptocrate does and have it print the various directives necessary to link in the C symbols it needs. Once that's done I believe this commit/feature hack can be removed (yay!)