From 2a35b085eeee977376b5c5e2dd084f9f505d8f8a Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 10 Aug 2018 11:09:18 +1000 Subject: Rust: backport src/test/test_rust.sh from master Preparation for 26497. --- src/test/test_rust.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/test/test_rust.sh b/src/test/test_rust.sh index d559f94ce0..4ecca7834d 100755 --- a/src/test/test_rust.sh +++ b/src/test/test_rust.sh @@ -1,13 +1,19 @@ #!/bin/sh -# Test all the Rust crates we're using +# Test all Rust crates -crates=tor_util +set -e -exitcode=0 +export LSAN_OPTIONS=suppressions=${abs_top_srcdir}/src/test/rust_supp.txt -for crate in $crates; do - cd "${abs_top_srcdir:-.}/src/rust/${crate}" - CARGO_TARGET_DIR="${abs_top_builddir}/src/rust/target" CARGO_HOME="${abs_top_builddir}/src/rust" "${CARGO:-cargo}" test ${CARGO_ONLINE-"--frozen"} || exitcode=1 +for cargo_toml_dir in "${abs_top_srcdir:-../../..}"/src/rust/*; do + if [ -e "${cargo_toml_dir}/Cargo.toml" ]; then + cd "${cargo_toml_dir}" && \ + CARGO_TARGET_DIR="${abs_top_builddir:-../../..}/src/rust/target" \ + CARGO_HOME="${abs_top_builddir:-../../..}/src/rust/.cargo" \ + "${CARGO:-cargo}" test ${CARGO_ONLINE-"--frozen"} \ + ${EXTRA_CARGO_OPTIONS} \ + --manifest-path "${cargo_toml_dir}/Cargo.toml" || exitcode=1 + fi done exit $exitcode -- cgit v1.2.3-54-g00ecf From ce19477ffcdf64255f050308182f3d682e6f6de1 Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 10 Aug 2018 11:00:46 +1000 Subject: Stop setting $CARGO_HOME cargo will use the user's $CARGO_HOME, or $HOME/.cargo by default. Fixes bug 26497; bugfix on 0.3.1.5-alpha. --- changes/bug26497 | 3 +++ src/rust/tor_util/include.am | 1 - src/test/test_rust.sh | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changes/bug26497 (limited to 'src') diff --git a/changes/bug26497 b/changes/bug26497 new file mode 100644 index 0000000000..d0c05ff3e4 --- /dev/null +++ b/changes/bug26497 @@ -0,0 +1,3 @@ + o Minor bugfixes (rust): + - Stop setting $CARGO_HOME. cargo will use the user's $CARGO_HOME, or + $HOME/.cargo by default. Fixes bug 26497; bugfix on 0.3.1.5-alpha. diff --git a/src/rust/tor_util/include.am b/src/rust/tor_util/include.am index ec3898577b..c110602895 100644 --- a/src/rust/tor_util/include.am +++ b/src/rust/tor_util/include.am @@ -7,7 +7,6 @@ EXTRA_DIST +=\ src/rust/target/release/@TOR_RUST_UTIL_STATIC_NAME@: FORCE ( cd "$(abs_top_srcdir)/src/rust/tor_util" ; \ CARGO_TARGET_DIR="$(abs_top_builddir)/src/rust/target" \ - CARGO_HOME="$(abs_top_builddir)/src/rust" \ $(CARGO) build --release --quiet $(CARGO_ONLINE) ) FORCE: diff --git a/src/test/test_rust.sh b/src/test/test_rust.sh index 4ecca7834d..9ad7a698ad 100755 --- a/src/test/test_rust.sh +++ b/src/test/test_rust.sh @@ -9,7 +9,6 @@ for cargo_toml_dir in "${abs_top_srcdir:-../../..}"/src/rust/*; do if [ -e "${cargo_toml_dir}/Cargo.toml" ]; then cd "${cargo_toml_dir}" && \ CARGO_TARGET_DIR="${abs_top_builddir:-../../..}/src/rust/target" \ - CARGO_HOME="${abs_top_builddir:-../../..}/src/rust/.cargo" \ "${CARGO:-cargo}" test ${CARGO_ONLINE-"--frozen"} \ ${EXTRA_CARGO_OPTIONS} \ --manifest-path "${cargo_toml_dir}/Cargo.toml" || exitcode=1 -- cgit v1.2.3-54-g00ecf From c9ad16ca2a2aff63fc4814c843cd376c76e43095 Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 10 Aug 2018 11:22:36 +1000 Subject: Fix $abs_top_srcdir in test_rust.sh Consistently use ../../.. as a fallback for $abs_top_srcdir in test_rust.sh. Fixes bug 27093; bugfix on 0.3.4.3-alpha. --- changes/bug27093 | 3 +++ src/test/test_rust.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changes/bug27093 (limited to 'src') diff --git a/changes/bug27093 b/changes/bug27093 new file mode 100644 index 0000000000..6c097f1196 --- /dev/null +++ b/changes/bug27093 @@ -0,0 +1,3 @@ + o Minor bugfixes (rust): + - Consistently use ../../.. as a fallback for $abs_top_srcdir in + test_rust.sh. Fixes bug 27093; bugfix on 0.3.4.3-alpha. diff --git a/src/test/test_rust.sh b/src/test/test_rust.sh index 9ad7a698ad..2761b612b5 100755 --- a/src/test/test_rust.sh +++ b/src/test/test_rust.sh @@ -3,7 +3,7 @@ set -e -export LSAN_OPTIONS=suppressions=${abs_top_srcdir}/src/test/rust_supp.txt +export LSAN_OPTIONS=suppressions=${abs_top_srcdir:-../../..}/src/test/rust_supp.txt for cargo_toml_dir in "${abs_top_srcdir:-../../..}"/src/rust/*; do if [ -e "${cargo_toml_dir}/Cargo.toml" ]; then -- cgit v1.2.3-54-g00ecf From 0f3fd10ee0f609cae6d2fe87fa437026f5e9e003 Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 10 Aug 2018 11:47:36 +1000 Subject: Stop setting $CARGO_HOME in src/rust/tor_rust/include.am cargo will use the user's $CARGO_HOME, or $HOME/.cargo by default. Fixes bug 26497; bugfix on 0.3.1.5-alpha. --- src/rust/tor_rust/include.am | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/rust/tor_rust/include.am b/src/rust/tor_rust/include.am index c02324cb77..40511bf9f2 100644 --- a/src/rust/tor_rust/include.am +++ b/src/rust/tor_rust/include.am @@ -7,7 +7,6 @@ EXTRA_CARGO_OPTIONS= src/rust/target/release/@TOR_RUST_STATIC_NAME@: FORCE ( cd "$(abs_top_builddir)/src/rust" ; \ CARGO_TARGET_DIR="$(abs_top_builddir)/src/rust/target" \ - CARGO_HOME="$(abs_top_builddir)/src/rust" \ $(CARGO) build --release $(EXTRA_CARGO_OPTIONS) \ $(CARGO_ONLINE) \ --manifest-path "$(abs_top_srcdir)/src/rust/tor_rust/Cargo.toml" ) @@ -15,7 +14,6 @@ src/rust/target/release/@TOR_RUST_STATIC_NAME@: FORCE distclean-rust: ( cd "$(abs_top_builddir)/src/rust" ; \ CARGO_TARGET_DIR="$(abs_top_builddir)/src/rust/target" \ - CARGO_HOME="$(abs_top_builddir)/src/rust" \ $(CARGO) clean $(EXTRA_CARGO_OPTIONS) \ $(CARGO_ONLINE) \ --manifest-path "$(abs_top_srcdir)/src/rust/tor_rust/Cargo.toml" ) -- cgit v1.2.3-54-g00ecf From 229a75a49a440e61c97dca820cf59360470e1560 Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 10 Aug 2018 11:54:26 +1000 Subject: Rust: use a consistent working directory in builds and tests cd to ${abs_top_builddir}/src/rust before running cargo in src/test/test_rust.sh. Fixes bug 26497; bugfix on 0.3.3.2-alpha. --- changes/bug26497-cd | 4 ++++ src/test/test_rust.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changes/bug26497-cd (limited to 'src') diff --git a/changes/bug26497-cd b/changes/bug26497-cd new file mode 100644 index 0000000000..37bf1bc956 --- /dev/null +++ b/changes/bug26497-cd @@ -0,0 +1,4 @@ + o Minor bugfixes (rust): + - cd to ${abs_top_builddir}/src/rust before running cargo in + src/test/test_rust.sh. This makes the working directory consistent + between builds and tests. Fixes bug 26497; bugfix on 0.3.3.2-alpha. diff --git a/src/test/test_rust.sh b/src/test/test_rust.sh index 2761b612b5..4afc84285f 100755 --- a/src/test/test_rust.sh +++ b/src/test/test_rust.sh @@ -7,7 +7,7 @@ export LSAN_OPTIONS=suppressions=${abs_top_srcdir:-../../..}/src/test/rust_supp. for cargo_toml_dir in "${abs_top_srcdir:-../../..}"/src/rust/*; do if [ -e "${cargo_toml_dir}/Cargo.toml" ]; then - cd "${cargo_toml_dir}" && \ + cd "${abs_top_builddir:-../../..}/src/rust" && \ CARGO_TARGET_DIR="${abs_top_builddir:-../../..}/src/rust/target" \ "${CARGO:-cargo}" test ${CARGO_ONLINE-"--frozen"} \ ${EXTRA_CARGO_OPTIONS} \ -- cgit v1.2.3-54-g00ecf From e1291aa84a04b8006130ce08338ee07a662e5ce0 Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 10 Aug 2018 13:11:27 +1000 Subject: Rust: Use --all-features in test_rust.sh for 0.3.3 and 0.3.4 Re-applies 0.3.3 changes after 24629. --- src/test/test_rust.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/test/test_rust.sh b/src/test/test_rust.sh index 4afc84285f..5405af436b 100755 --- a/src/test/test_rust.sh +++ b/src/test/test_rust.sh @@ -9,7 +9,7 @@ for cargo_toml_dir in "${abs_top_srcdir:-../../..}"/src/rust/*; do if [ -e "${cargo_toml_dir}/Cargo.toml" ]; then cd "${abs_top_builddir:-../../..}/src/rust" && \ CARGO_TARGET_DIR="${abs_top_builddir:-../../..}/src/rust/target" \ - "${CARGO:-cargo}" test ${CARGO_ONLINE-"--frozen"} \ + "${CARGO:-cargo}" test --all-features ${CARGO_ONLINE-"--frozen"} \ ${EXTRA_CARGO_OPTIONS} \ --manifest-path "${cargo_toml_dir}/Cargo.toml" || exitcode=1 fi -- cgit v1.2.3-54-g00ecf From 19038ff4bbcc50e0d9fa3d38c20689ea0da1b9c2 Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 10 Aug 2018 13:30:16 +1000 Subject: Revert "Rust: Use --all-features in test_rust.sh for 0.3.3 and 0.3.4" This reverts commit e1291aa84a04b8006130ce08338ee07a662e5ce0. --- src/test/test_rust.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/test/test_rust.sh b/src/test/test_rust.sh index 5405af436b..4afc84285f 100755 --- a/src/test/test_rust.sh +++ b/src/test/test_rust.sh @@ -9,7 +9,7 @@ for cargo_toml_dir in "${abs_top_srcdir:-../../..}"/src/rust/*; do if [ -e "${cargo_toml_dir}/Cargo.toml" ]; then cd "${abs_top_builddir:-../../..}/src/rust" && \ CARGO_TARGET_DIR="${abs_top_builddir:-../../..}/src/rust/target" \ - "${CARGO:-cargo}" test --all-features ${CARGO_ONLINE-"--frozen"} \ + "${CARGO:-cargo}" test ${CARGO_ONLINE-"--frozen"} \ ${EXTRA_CARGO_OPTIONS} \ --manifest-path "${cargo_toml_dir}/Cargo.toml" || exitcode=1 fi -- cgit v1.2.3-54-g00ecf