aboutsummaryrefslogtreecommitdiff
path: root/src/rust/tor_rust
diff options
context:
space:
mode:
Diffstat (limited to 'src/rust/tor_rust')
-rw-r--r--src/rust/tor_rust/Cargo.toml6
-rw-r--r--src/rust/tor_rust/include.am12
-rw-r--r--src/rust/tor_rust/lib.rs4
3 files changed, 14 insertions, 8 deletions
diff --git a/src/rust/tor_rust/Cargo.toml b/src/rust/tor_rust/Cargo.toml
index 86fad3ee76..1523ee0dd1 100644
--- a/src/rust/tor_rust/Cargo.toml
+++ b/src/rust/tor_rust/Cargo.toml
@@ -14,3 +14,9 @@ path = "../tor_util"
[dependencies.protover]
path = "../protover"
+[features]
+# We have to define a feature here because doctests don't get cfg(test),
+# and we need to disable some C dependencies when running the doctests
+# because of the various linker issues. See
+# https://github.com/rust-lang/rust/issues/45599
+test_linking_hack = []
diff --git a/src/rust/tor_rust/include.am b/src/rust/tor_rust/include.am
index 40511bf9f2..ce673abbee 100644
--- a/src/rust/tor_rust/include.am
+++ b/src/rust/tor_rust/include.am
@@ -4,23 +4,23 @@ EXTRA_DIST +=\
EXTRA_CARGO_OPTIONS=
-src/rust/target/release/@TOR_RUST_STATIC_NAME@: FORCE
+@TOR_RUST_LIB_PATH@: FORCE
( cd "$(abs_top_builddir)/src/rust" ; \
CARGO_TARGET_DIR="$(abs_top_builddir)/src/rust/target" \
$(CARGO) build --release $(EXTRA_CARGO_OPTIONS) \
- $(CARGO_ONLINE) \
- --manifest-path "$(abs_top_srcdir)/src/rust/tor_rust/Cargo.toml" )
+ $(CARGO_ONLINE) \
+ --manifest-path "$(abs_top_srcdir)/src/rust/tor_rust/Cargo.toml" )
distclean-rust:
( cd "$(abs_top_builddir)/src/rust" ; \
CARGO_TARGET_DIR="$(abs_top_builddir)/src/rust/target" \
$(CARGO) clean $(EXTRA_CARGO_OPTIONS) \
- $(CARGO_ONLINE) \
- --manifest-path "$(abs_top_srcdir)/src/rust/tor_rust/Cargo.toml" )
+ $(CARGO_ONLINE) \
+ --manifest-path "$(abs_top_srcdir)/src/rust/tor_rust/Cargo.toml" )
rm -rf "$(abs_top_builddir)/src/rust/registry"
if USE_RUST
-build-rust: src/rust/target/release/@TOR_RUST_STATIC_NAME@
+build-rust: @TOR_RUST_LIB_PATH@
else
build-rust:
endif
diff --git a/src/rust/tor_rust/lib.rs b/src/rust/tor_rust/lib.rs
index c1585c0480..18519f8497 100644
--- a/src/rust/tor_rust/lib.rs
+++ b/src/rust/tor_rust/lib.rs
@@ -1,5 +1,5 @@
-extern crate tor_util;
extern crate protover;
+extern crate tor_util;
-pub use tor_util::*;
pub use protover::*;
+pub use tor_util::*;