Skip to content

Commit 4f85b01

Browse files
committed
correctly link /usr/bin/cargo and /usr/bin/rustc
1 parent 9d37f45 commit 4f85b01

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

taskcluster/scripts/build/linux_build_dpkg.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,17 @@ fi
132132
sudo mk-build-deps --tool 'apt-get -y -o Debug::pkgProblemResolver=yes --no-install-recommends' \
133133
--install --remove $MK_BUILD_DEPS_ARGS "$(pwd)/mozillavpn-source/debian/control"
134134

135+
# /usr/bin/cargo and /usr/bin/rustc may be installed as cargo-<version> and rustc-<version>
136+
# Find the latest versions of these binaries as installed by the build dependencies and link them to /usr/bin.
137+
138+
if ! command -v cargo >/dev/null 2>&1; then
139+
CARGO_BIN=$(find /usr/bin -maxdepth 1 -type f -name 'cargo-*' | sort -V | tail -n1)
140+
RUSTC_BIN=$(find /usr/bin -maxdepth 1 -type f -name 'rustc-*' | sort -V | tail -n1)
141+
142+
[ -n "$CARGO_BIN" ] && sudo ln -sf "$CARGO_BIN" /usr/bin/cargo
143+
[ -n "$RUSTC_BIN" ] && sudo ln -sf "$RUSTC_BIN" /usr/bin/rustc
144+
else
145+
135146
(cd mozillavpn-source/ && dpkg-buildpackage $DPKG_PACKAGE_BUILD_ARGS)
136147

137148
# Compress all build artifacts into a tarball

0 commit comments

Comments
 (0)