guix: Construct $OUTDIR in ${DISTSRC}/output
While files are being output to $OUTDIR, it will be under
${DISTSRC}/output, and only when everything is done, will
${DISTSRC}/output be moved to the actual $OUTDIR.
This makes it so that a Ctrl-C in the middle of a build is less likely
to result in a partially-constructed $OUTDIR. In fact, if I understand
correctly, if $OUTDIR and $DISTSRC reside on the same filesystem, the
move (rename) is likely atomic.
Also, since the "working $OUTDIR" is under ${DISTSRC}/output, it will be
cleaned properly by the guix-clean script.
This commit is contained in:
1 parent
022abc85fc
commit
f9e2960c01
1 file changed
+5
@@ -33,6 +33,9 @@ Required environment variables as seen inside the container:
|
|||||||
OUTDIR: ${OUTDIR:?not set}
|
OUTDIR: ${OUTDIR:?not set}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
ACTUAL_OUTDIR="${OUTDIR}"
|
||||||
|
OUTDIR="${DISTSRC}/output"
|
||||||
|
|
||||||
#####################
|
#####################
|
||||||
# Environment Setup #
|
# Environment Setup #
|
||||||
#####################
|
#####################
|
||||||
@@ -429,3 +432,5 @@ mkdir -p "$DISTSRC"
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
) # $DISTSRC
|
) # $DISTSRC
|
||||||
|
|
||||||
|
mv --no-target-directory "$OUTDIR" "$ACTUAL_OUTDIR"
|
||||||
Reference in new issue
Block a user