A scratch directory per run, after two of them shared one
This commit is contained in:
parent
6c15eef5e5
commit
368866c63d
@ -54,8 +54,15 @@ test -x "$flan" || { echo "build failed" >&2; exit 1; }
|
|||||||
# Not mktemp under /tmp by default: this writes a few hundred executables of
|
# Not mktemp under /tmp by default: this writes a few hundred executables of
|
||||||
# a megabyte or two, and a full /tmp on this machine has already frozen one
|
# a megabyte or two, and a full /tmp on this machine has already frozen one
|
||||||
# session. The guard is cheap and a wedged run is not.
|
# session. The guard is cheap and a wedged run is not.
|
||||||
out=${COST_OUT:-${TMPDIR:-/tmp}/flan-cost.$$}
|
# A directory of this run's own, made with a plain mkdir so that a second
|
||||||
mkdir -p "$out" || exit 1
|
# copy of this script cannot land in the first one's: two runs sharing a
|
||||||
|
# scratch directory overwrite each other's `l` and `x` between the build and
|
||||||
|
# the timing, and the result is a row of numbers that belong to two different
|
||||||
|
# programs. That happened once here and the numbers looked entirely ordinary.
|
||||||
|
work=${COST_OUT:-${TMPDIR:-/tmp}/flan-cost}
|
||||||
|
mkdir -p "$work" || exit 1
|
||||||
|
out=$work/run.$$
|
||||||
|
mkdir "$out" || exit 1
|
||||||
trap 'rm -rf "$out"' EXIT
|
trap 'rm -rf "$out"' EXIT
|
||||||
free=$(df -Pk "$out" | awk 'NR==2 {print $4}')
|
free=$(df -Pk "$out" | awk 'NR==2 {print $4}')
|
||||||
[ "$free" -gt 2000000 ] || { echo "less than 2GB free at $out" >&2; exit 1; }
|
[ "$free" -gt 2000000 ] || { echo "less than 2GB free at $out" >&2; exit 1; }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user