In order to better understand if we've broken something when Rust support is enabled, we should start additionally building Tor on our Jenkins setup with Rust. See https://trac.torproject.org/projects/tor/wiki/RustInTor for the different ways to do this (one pulls the dependencies down and the other is given a local directory).
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items
0
Link issues together to show that they're related.
Learn more.
We talked about this a bit at the meeting. We need to up the priority of this ticket since we're now discussing a future where Rust is required to build tor, and having early feedback on breakage would be better while Rust is still optional.
For an update, every time I've tried to build debian-tor using the following (with multiple versions between 0.3.1.x and 0.3.2.x) with --enable-rust has failed:
user@build-tor:~$ cat code/torproject/tor/build-tor.sh #!/bin/bashtag=tor-0.3.1.6-rcdebian_tag=debian-tor-0.3.1.6-rcif test $# -lt 2 ; then printf "Usage: %s TOR_TAG DEBIAN_TOR_TAG\n\n" "$(basename $0)" printf "Need tag numbers for tor and debian, e.g. '%s' '%s' \n" "$tag" "$debian_tag" exit 1else tag=$1 debian_tag=$2fisudo apt-get updatesudo apt-get install -y dpkg dpkg-dev libevent-dev libssl-dev asciidoc quilt dh-apparmor libseccomp-dev dh-systemd libsystemd-dev pkg-config dh-autoreconf libfakeroot zlib1g zlib1g-dev automake liblzma-dev libzstd-devgit checkout $tag# Fetch the newest debian packaging and checkout the tagcd ../debian-new && git fetch origin && git checkout $debian_tag# Move the new packaging into the tor source treecp -R ./debian ../debian-oldcp -R ../debian-new/debian ./rm -rf debian/patches/improve-geoip-warningecho > debian/patches/seriesprintf "Please remove the --with-quilt line!\n"sleep 5emacs -nw debian/rulesmake distclean./configure \ --enable-fatal-warnings --enable-rust --enable-cargo-online-mode dh_auto_builddpkg-buildpackage -rfakeroot
This is due to part of the cargo source code, init_git_transports(config); in the execute function of cargo.git/src/bin/cargo.rs, trying to obtain a copy of the registry (the git repo that tells you about which crates are published). Alex Crichton realised that it's due to building in a directory which doesn't have a cargo subdirectory (nor do any of its parents), which is due to us doing jenkins builds out-of-tree. The solution, or at least a workaround, is to do cp -aR build-tree/src/rust/.cargo ~/ after running ../tor/configure.
Good bug hunting! I hope that the Cargo folks regard this as a bug?
The solution is a bit scary though -- I'd rather not be touching $HOME. Though I guess it's okay if this is in a container that will get blown away completely after the build. But I wonder if there's any other workaround we could use.
What if we try running cargo from inside builddir, and specifying the Cargo.toml location with --manifest-path ? I'm attaching a patch that works for me, though it may be messed up in some way.