Skip to content

Commit 5eb093d

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

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

taskcluster/docker/linux-dpkg-build/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ RUN /root/setup-worker.sh
5050
WORKDIR /builds/worker/
5151

5252
# Grant the worker user the ability to install packages without login
53-
RUN echo "worker ALL=(ALL) SETENV:NOPASSWD:/usr/bin/apt,/usr/bin/apt-get,/usr/bin/dpkg,/usr/bin/mk-build-deps" > /etc/sudoers.d/worker-packages
53+
RUN echo "worker ALL=(ALL) SETENV:NOPASSWD:/usr/bin/apt,/usr/bin/apt-get,/usr/bin/dpkg,/usr/bin/mk-build-deps,/usr/bin/ln" > /etc/sudoers.d/worker-packages
5454

5555
#----------------------------------------------------------------------------------------------------------------------
5656
#-- Task Setup --------------------------------------------------------------------------------------------------------

taskcluster/docker/linux-qt6-build/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ RUN /root/setup-worker.sh
115115
WORKDIR /builds/worker/
116116

117117
# Grant the worker user the ability to install packages without login
118-
RUN echo "worker ALL=(ALL) SETENV:NOPASSWD:/usr/bin/apt,/usr/bin/apt-get,/usr/bin/dpkg,/usr/bin/mk-build-deps" > /etc/sudoers.d/worker-packages
118+
RUN echo "worker ALL=(ALL) SETENV:NOPASSWD:/usr/bin/apt,/usr/bin/apt-get,/usr/bin/dpkg,/usr/bin/mk-build-deps,/usr/bin/ln" > /etc/sudoers.d/worker-packages
119119

120120
#----------------------------------------------------------------------------------------------------------------------
121121
#-- Task Setup --------------------------------------------------------------------------------------------------------

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)