~aasg/nixexprs

33cad4b3118d99214a20bb9a54f74d3686926edb — Aluísio Augusto Silva Gonçalves a month ago ef9c54e
ci: Push all built paths to Cachix, even in case of failure

I've been having [errors] while building the rtl8723bu driver for Linux
5.8 and that causes the whole build to fail, preventing successful paths
from being pushed to the cache.  Now we fail the build only at the very
end.

Additionally, we now push *all* new paths in the Nix store, including
dependencies of our top-level packages.  That should reduce build times
from the 20+ minutes we've begun experiencing after the introduction of
crate2nix-based derivations.  I borrowed this trick from
github:cachix/cachix-action after seeing local builds fetch crates from
the eigenvalue (crate2nix's) cache.

[errors]: https://wiki.gentoo.org/wiki/Binutils_2.32_upgrade_notes/elfutils_0.175:_unable_to_initialize_decompress_status_for_section_.debug_info
2 files changed, 18 insertions(+), 6 deletions(-)

M .builds/nixos-20.03.yml
M .builds/nixpkgs-unstable.yml
M .builds/nixos-20.03.yml => .builds/nixos-20.03.yml +9 -3
@@ 10,8 10,14 @@ secrets:
tasks:
  - prepare: |
      cachix use aasg-nixexprs
      nix path-info --all | grep -v '\.drv$' | sort >pre-build-paths
  - build: |
      set -o pipefail
      nix-build --no-out-link --keep-going --keep-failed nixexprs | tee built-paths
      nix-build --no-out-link --keep-going --keep-failed nixexprs || touch FAILED
  - cache: |
      cachix push aasg-nixexprs <built-paths
      nix path-info --all | grep -v '\.drv$' | sort >post-build-paths
      comm -13 pre-build-paths post-build-paths | cachix push aasg-nixexprs
  - finish: |
      if [[ -f FAILED ]]; then
        echo "Build failed. See logs of the build task for details."
        exit 1
      fi

M .builds/nixpkgs-unstable.yml => .builds/nixpkgs-unstable.yml +9 -3
@@ 10,8 10,14 @@ secrets:
tasks:
  - prepare: |
      cachix use aasg-nixexprs
      nix path-info --all | grep -v '\.drv$' | sort >pre-build-paths
  - build: |
      set -o pipefail
      nix-build --no-out-link --keep-going --keep-failed nixexprs | tee built-paths
      nix-build --no-out-link --keep-going --keep-failed nixexprs || touch FAILED
  - cache: |
      cachix push aasg-nixexprs <built-paths
      nix path-info --all | grep -v '\.drv$' | sort >post-build-paths
      comm -13 pre-build-paths post-build-paths | cachix push aasg-nixexprs
  - finish: |
      if [[ -f FAILED ]]; then
        echo "Build failed. See logs of the build task for details."
        exit 1
      fi