Commit Graph

12 Commits

Author SHA1 Message Date
Alex Crichton
74c1e44746 Fix segfaults related to sanitizers+jemalloc
It looks to be the case that Rust's standard allocator, jemalloc, is
incompatible with sanitizers. The incompatibility, for whatever reason,
seems to cause segfaults at runtime when jemalloc is linked with
sanitizers.

Without actually trying to figure out what's going on here this commit
instead takes the hammer of "let's remove jemalloc when testing". The
`tor_allocate` crate now by default switches to the system allocator
(eventually this will want to be the tor allocator). Most crates then
link to `tor_allocate` ot pick this up, but the `smartlist` crate had to
manually switch to the system allocator in testing and the `external`
crate had to be sure to link to `tor_allocate`.

The final gotcha here is that this patch also switches to
unconditionally passing `--target` to Cargo. For weird and arcane
reasons passing `--target` with the host target of the compiler (which
Cargo otherwise uses as the default) is different than not passing
`--target` at all. This ensure that our custom `RUSTFLAGS` with
sanitizer options doesn't make its way into build scripts, just the
final testing artifacts.
2018-10-01 22:55:59 -07:00
Nick Mathewson
a8ac21fbb5 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.
2018-09-16 14:34:31 -04:00
teor
19038ff4bb
Revert "Rust: Use --all-features in test_rust.sh for 0.3.3 and 0.3.4"
This reverts commit e1291aa84a.
2018-08-10 13:30:16 +10:00
teor
e1291aa84a
Rust: Use --all-features in test_rust.sh for 0.3.3 and 0.3.4
Re-applies 0.3.3 changes after 24629.
2018-08-10 13:11:27 +10:00
teor
229a75a49a
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.
2018-08-10 11:54:26 +10:00
teor
c9ad16ca2a
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.
2018-08-10 11:22:36 +10:00
teor
ce19477ffc
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.
2018-08-10 11:14:32 +10:00
teor
2a35b085ee
Rust: backport src/test/test_rust.sh from master
Preparation for 26497.
2018-08-10 11:09:18 +10:00
Chelsea H. Komlo
eb355e031e
use CARGO_HOME instead of HOME when building with rust 2017-07-13 18:12:35 +00:00
Sebastian Hahn
70c067102b Allow Rust build using locally supplied crates or crates.io
This adds a couple of configure commands to control whether we're
requiring all dependencies to be available locally (default) or not
(--enable-cargo-online-mode). When building from a tarball, we require
the RUST_DEPENDENCIES variable to point to the local repository of
crates. This also adds src/ext/rust as a git submodule that contains
such a local repository for easy setup.
2017-05-19 08:47:11 -04:00
Sebastian Hahn
d6f9a4f11a cargo-online-mode configure argument
Passing --enable-cargo-online-mode during configure allows cargo to make
network requests while building Tor or running tests. If this flag is
not supplied, the dependencies need to be available in the form of a
local mirror.
2017-05-19 08:47:11 -04:00
Sebastian Hahn
f0516ed348 Run cargo test during make check 2017-05-19 08:47:11 -04:00