Skip to content

Commit 5805dd4

Browse files
craig[bot]golgeek
andcommitted
Merge #157759
157759: roachtest: fix conditional build for arm64 and fips r=herkolategan a=golgeek PR #157158 introduced a conditional build for ARM64 and FIPS architectures based on the metamorphic probability flags. The initial implementation used `bc` to compare floating point, but the command is not available on the TeamCity agents: ``` build/teamcity/cockroach/nightlies/roachtest_nightly_impl.sh: line 39: bc: command not found ``` This patch uses `awk` in place of `bc`. Epic: none Release note: None Co-authored-by: Ludovic Leroux <[email protected]>
2 parents 275290a + a93b1e5 commit 5805dd4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

build/teamcity/cockroach/nightlies/roachtest_nightly_impl.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ fi
2929
$root/build/teamcity/cockroach/nightlies/roachtest_compile_bits.sh $arch
3030
if [[ $arch != "s390x" ]]; then
3131
# Do not build arm64 if the probability is 0.
32-
# Use `bc` for float comparison, bash supports only integer comparison.
33-
if (( $(echo "$arm_probability > 0" | bc -l) )); then
32+
# Using `awk` because bash only supports integer comparison, and `bc` is not installed.
33+
if awk -v n="$arm_probability" 'BEGIN { exit (n+0 > 0) ? 0 : 1 }'; then
3434
$root/build/teamcity/cockroach/nightlies/roachtest_compile_bits.sh arm64
3535
fi
3636
# N.B. FIPS is metamoprhically always on as of PR#139510
3737
# Do not build fips if the probability is 0.
38-
# Use `bc` for float comparison, bash supports only integer comparison.
39-
if (( $(echo "$fips_probability > 0" | bc -l) )); then
38+
# Using `awk` because bash only supports integer comparison, and `bc` is not installed.
39+
if awk -v n="$fips_probability" 'BEGIN { exit (n+0 > 0) ? 0 : 1 }'; then
4040
$root/build/teamcity/cockroach/nightlies/roachtest_compile_bits.sh amd64-fips
4141
fi
4242
fi

0 commit comments

Comments
 (0)