Created
June 16, 2020 18:50
-
-
Save hotsphink/ce18bdd0915eab9356e22e08cd698670 to your computer and use it in GitHub Desktop.
mkgist-created gist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Suppress build: | |
# % touch $srcdir/NOBUILD | |
# Suppress clobber: | |
# % touch $srcdir/NOCLOBBER | |
message="" | |
function msg () { | |
message="$message"$'\n'"$@" | |
} | |
failed=0 | |
for d in mozilla mozilla2 mozilla3; do | |
for m in mozconfig.opt mozconfig.debug; do | |
cd $HOME/src/$d | |
export MOZCONFIG=$(pwd)/$m | |
if [ -f NOCLOBBER ]; then | |
msg "Did not clobber $d/$m objdir" | |
else | |
if ! ./mach -l clobber.${m#mozconfig.}.log clobber; then | |
msg "$d/$m: clobber failed" | |
failed=1 | |
fi | |
fi | |
if [ -f NOBUILD ]; then | |
msg "Skipped build with $d/$m" | |
else | |
buildlog=build.${m#mozconfig.}.log | |
./mach -l $buildlog build | |
buildst=$? | |
msg "$d/$m : build exited $buildst" | |
if ! [ $buildst = 0 ]; then | |
if grep -F 'ERROR: cbindgen version' $buildlog; then | |
cargo install cbindgen --force | |
./mach -l $buildlog build | |
buildst=$? | |
msg "$d/$m : rebuild exited $buildst" | |
fi | |
failed=$buildst | |
fi | |
# Nuke the incremental compilation info for Rust, since it | |
# seems to become enormous after a while. | |
objdir="$(./mach environment --format json | jq -r .topobjdir)" | |
rm -rf "$objdir/x86_64-unknown-linux-gnu/*/incremental" | |
fi | |
done | |
done | |
if [ $failed = 0 ]; then | |
message=$'SUCCEEDED\n'"$message" | |
else | |
message=$'FAILED\n'"$message" | |
fi | |
echo "$message" | |
DISPLAY=:1.0 notify-send -t 86400000 "$message" | |
exit $failed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment