Auto merge of #95050 - ehuss:fix-cmake-build, r=Mark-Simulacrum

Fix cmake build.

This is an attempt to fix the cmake build. For some reason, it has recently started failing with a permission denied trying to overwrite `/tmp/build.log`.  This file exists from the `build-toolchains.sh` step, which is owned by the rustbuild user. I think there is some behavior where a sticky `/tmp` directory doesn't allow overwriting files owned by other users even when running as root.  I do not know why this has suddenly started, and I can't reproduce locally with my own docker setup. However, this fix seems to work on CI.
This commit is contained in:
bors 2022-03-17 18:52:14 +00:00
commit 58f11791af

View file

@ -5,16 +5,16 @@ hide_output() {
set +x
on_err="
echo ERROR: An error was encountered with the build.
cat /tmp/build.log
cat /tmp/cmake_build.log
exit 1
"
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
"$@" &> /tmp/build.log
"$@" &> /tmp/cmake_build.log
trap - ERR
kill $PING_LOOP_PID
rm /tmp/build.log
rm /tmp/cmake_build.log
set -x
}