diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2017-05-02 04:21:42 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-05-19 08:47:11 -0400 |
commit | 70c067102b7d2576fa456d2872bb41abf559dff6 (patch) | |
tree | 6feae5f63d84b607fe1e5c196473239ce4919471 /src/rust | |
parent | aeba64efad02e596dc3f15832d4bb96184c366a3 (diff) | |
download | tor-70c067102b7d2576fa456d2872bb41abf559dff6.tar.gz tor-70c067102b7d2576fa456d2872bb41abf559dff6.zip |
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.
Diffstat (limited to 'src/rust')
-rw-r--r-- | src/rust/.cargo/config.in | 8 | ||||
-rw-r--r-- | src/rust/Cargo.toml | 7 | ||||
-rw-r--r-- | src/rust/include.am | 3 | ||||
-rw-r--r-- | src/rust/tor_util/include.am | 1 |
4 files changed, 11 insertions, 8 deletions
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: |