Skip to content

Commit 01bc9ad

Browse files
authored
honor XTASK_BIN in tools/install_*_prerequisites.sh (#5860)
Merging #5482 introduced breakage I didn't account for: being able to run `install_runner_prerequisites.sh` without having Cargo available, which is used by the a4x2 testbed. This change introduces the `XTASK_BIN` environment variable which will be used instead of `cargo xtask` if set. The companion PR in a4x2 is https://github.com/oxidecomputer/testbed/pull/49/files. Tested that all these work: - `./tools/install_builder_prerequisites.sh -y` - `XTASK_BIN=target/debug/xtask ./tools/install_builder_prerequisites.sh -y` (after building xtask) - `XTASK_BIN=target/debug/nonexistent-file ./tools/install_builder_prerequisites.sh -y` (correctly fails with ENOENT)
1 parent 9d67e42 commit 01bc9ad

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

tools/install_builder_prerequisites.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ function retry
8585
exit $retry_rc
8686
}
8787

88+
function xtask
89+
{
90+
if [ -z ${XTASK_BIN+x} ]; then
91+
cargo xtask "$@"
92+
else
93+
"$XTASK_BIN" "$@"
94+
fi
95+
}
96+
8897
# Packages to be installed on all OSes:
8998
#
9099
# - libpq, the PostgreSQL client lib.
@@ -191,7 +200,7 @@ retry install_packages
191200
# - Packaging: When constructing packages on Helios, these utilities
192201
# are packaged into zones which may be launched by the sled agent.
193202

194-
retry cargo xtask download \
203+
retry xtask download \
195204
cockroach \
196205
clickhouse \
197206
console \

tools/install_runner_prerequisites.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,15 @@ function retry
8484
exit $retry_rc
8585
}
8686

87+
function xtask
88+
{
89+
if [ -z ${XTASK_BIN+x} ]; then
90+
cargo xtask "$@"
91+
else
92+
"$XTASK_BIN" "$@"
93+
fi
94+
}
95+
8796
# Packages to be installed Helios:
8897
#
8998
# - libpq, the PostgreSQL client lib.
@@ -154,7 +163,7 @@ if [[ "${HOST_OS}" == "SunOS" ]]; then
154163
# Grab the SoftNPU machinery (ASIC simulator, scadm, P4 program, etc.)
155164
#
156165
# "cargo xtask virtual-hardware create" will use those to setup the softnpu zone
157-
retry cargo xtask download softnpu
166+
retry xtask download softnpu
158167
fi
159168

160169
echo "All runner prerequisites installed successfully"

0 commit comments

Comments
 (0)