ci: enable parallel building
Use `nix build --print-build-logs` to prefix the build output with the name of its derivation. This helps to distinguish build outputs when output is interleaved in parallel builds.
This commit is contained in:
parent
a52bf46031
commit
fb56684999
2 changed files with 7 additions and 6 deletions
|
|
@ -17,9 +17,10 @@ trap 'rm -rf $tmpDir' EXIT
|
|||
## Instantiate
|
||||
|
||||
time nix-instantiate "$@" --add-root "$tmpDir/drv" --indirect > /dev/null
|
||||
printf "instantiated "; realpath "$tmpDir/drv"
|
||||
drv=$(realpath "$tmpDir/drv")
|
||||
echo "instantiated $drv"
|
||||
|
||||
outPath=$(nix-store --query "$tmpDir/drv")
|
||||
outPath=$(nix-store --query "$drv")
|
||||
if nix path-info --store "https://${cachixCache}.cachix.org" "$outPath" &>/dev/null; then
|
||||
echo "$outPath has already been built successfully."
|
||||
exit 0
|
||||
|
|
@ -33,12 +34,12 @@ fi
|
|||
|
||||
if [[ $CACHIX_SIGNING_KEY ]]; then
|
||||
# Speed up task by uploading store paths as soon as they are created
|
||||
buildCmd="cachix watch-exec $cachixCache nix-build --"
|
||||
buildCmd="cachix watch-exec $cachixCache nix -- build"
|
||||
else
|
||||
buildCmd=nix-build
|
||||
buildCmd="nix build"
|
||||
fi
|
||||
|
||||
$buildCmd --out-link "$tmpDir/result" "$tmpDir/drv" >/dev/null
|
||||
$buildCmd --out-link "$tmpDir/result" --print-build-logs "$drv^*"
|
||||
|
||||
if [[ $CACHIX_SIGNING_KEY ]]; then
|
||||
cachix push "$cachixCache" "$outPath"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue