summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
m---------src/ext/rust0
-rw-r--r--src/rust/.cargo/config.in8
-rw-r--r--src/rust/Cargo.toml7
-rw-r--r--src/rust/include.am3
-rw-r--r--src/rust/tor_util/include.am1
-rw-r--r--src/test/include.am1
-rwxr-xr-xsrc/test/test_rust.sh2
7 files changed, 13 insertions, 9 deletions
diff --git a/src/ext/rust b/src/ext/rust
new file mode 160000
+Subproject 240296800824e40b10cb8c16da0e71156335394
diff --git a/src/rust/.cargo/config.in b/src/rust/.cargo/config.in
new file mode 100644
index 0000000000..414b253a57
--- /dev/null
+++ b/src/rust/.cargo/config.in
@@ -0,0 +1,8 @@
+[source]
+
+@RUST_DL@ [source.crates-io]
+@RUST_DL@ registry = 'https://github.com/rust-lang/crates.io-index'
+@RUST_DL@ replace-with = 'vendored-sources'
+
+@RUST_DL@ [source.vendored-sources]
+@RUST_DL@ directory = '@RUST_DEPENDENCIES@'
diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml
index 527c536323..fc4377e8b4 100644
--- a/src/rust/Cargo.toml
+++ b/src/rust/Cargo.toml
@@ -5,10 +5,3 @@ members = ["tor_util"]
debug = true
panic = "abort"
-[source.crates-io]
-registry = 'https://github.com/rust-lang/crates.io-index'
-replace-with = 'vendored-sources'
-
-[source.vendored-sources]
-directory = 'vendor'
-
diff --git a/src/rust/include.am b/src/rust/include.am
index e198049071..20afc6c4db 100644
--- a/src/rust/include.am
+++ b/src/rust/include.am
@@ -2,4 +2,5 @@ include src/rust/tor_util/include.am
EXTRA_DIST +=\
src/rust/Cargo.toml \
- src/rust/Cargo.lock
+ src/rust/Cargo.lock \
+ src/rust/.cargo/config.in
diff --git a/src/rust/tor_util/include.am b/src/rust/tor_util/include.am
index 863046b929..17a755fe09 100644
--- a/src/rust/tor_util/include.am
+++ b/src/rust/tor_util/include.am
@@ -7,6 +7,7 @@ EXTRA_DIST +=\
src/rust/target/release/libtor_util.a: FORCE
( cd "$(abs_top_srcdir)/src/rust/tor_util" ; \
CARGO_TARGET_DIR="$(abs_top_builddir)/src/rust/target" \
+ HOME="$(abs_top_builddir)/src/rust" \
$(CARGO) build --release --quiet $(CARGO_ONLINE) )
FORCE:
diff --git a/src/test/include.am b/src/test/include.am
index c0aca8afe2..829c282dd9 100644
--- a/src/test/include.am
+++ b/src/test/include.am
@@ -5,6 +5,7 @@ TESTS_ENVIRONMENT = \
export PYTHON="$(PYTHON)"; \
export SHELL="$(SHELL)"; \
export abs_top_srcdir="$(abs_top_srcdir)"; \
+ export abs_top_builddir="$(abs_top_builddir)"; \
export builddir="$(builddir)"; \
export TESTING_TOR_BINARY="$(TESTING_TOR_BINARY)"; \
export CARGO="$(CARGO)"; \
diff --git a/src/test/test_rust.sh b/src/test/test_rust.sh
index 7c71008e02..4427c70f13 100755
--- a/src/test/test_rust.sh
+++ b/src/test/test_rust.sh
@@ -7,7 +7,7 @@ exitcode=0
for crate in $crates; do
cd "${abs_top_srcdir:-.}/src/rust/${crate}"
- "${CARGO:-cargo}" test ${CARGO_ONLINE-"--frozen"} || exitcode=1
+ CARGO_TARGET_DIR="${abs_top_builddir}/src/rust/target" HOME="${abs_top_builddir}/src/rust" "${CARGO:-cargo}" test ${CARGO_ONLINE-"--frozen"} || exitcode=1
done
exit $exitcode