diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05dc7e6f..ffa3dbff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -138,24 +138,7 @@ jobs: - name: Cache CI dependencies run: | - # attic nix binary cache server is very, very terribly flakey. nothing i can do to fix it other than retry multiple times here - set +e # Don't exit on errors - ATTEMPTS=3 - SUCCESS=false - while (( ATTEMPTS-- > 0 )) - do - bin/nix-build-and-cache ci - if [[ $? == 0 ]]; then - SUCCESS=true - break - else - sleep 3 - fi - done - - if [[ $SUCCESS == "false" ]]; then - exit 1 - fi + bin/nix-build-and-cache ci # use sccache for Rust - name: Run sccache-cache @@ -305,24 +288,7 @@ jobs: CARGO_DEB_TARGET_TUPLE=$(echo ${{ matrix.target }} | grep -o -E '^([^-]*-){3}[^-]*') SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) - # attic nix binary cache server is very, very terribly flakey. nothing i can do to fix it other than retry multiple times here - set +e # Don't exit on errors - ATTEMPTS=3 - SUCCESS=false - while (( ATTEMPTS-- > 0 )) - do - bin/nix-build-and-cache just .#static-${{ matrix.target }}-all-features - if [[ $? == 0 ]]; then - SUCCESS=true - break - else - sleep 3 - fi - done - - if [[ $SUCCESS == "false" ]]; then - exit 1 - fi + bin/nix-build-and-cache just .#static-${{ matrix.target }}-all-features mkdir -v -p target/release/ mkdir -v -p target/$CARGO_DEB_TARGET_TUPLE/release/ @@ -346,24 +312,7 @@ jobs: CARGO_DEB_TARGET_TUPLE=$(echo ${{ matrix.target }} | grep -o -E '^([^-]*-){3}[^-]*') SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) - # attic nix binary cache server is very, very terribly flakey. nothing i can do to fix it other than retry multiple times here - set +e # Don't exit on errors - ATTEMPTS=3 - SUCCESS=false - while (( ATTEMPTS-- > 0 )) - do - bin/nix-build-and-cache just .#static-${{ matrix.target }}-all-features-debug - if [[ $? == 0 ]]; then - SUCCESS=true - break - else - sleep 3 - fi - done - - if [[ $SUCCESS == "false" ]]; then - exit 1 - fi + bin/nix-build-and-cache just .#static-${{ matrix.target }}-all-features-debug # > warning: dev profile is not supported and will be a hard error in the future. cargo-deb is for making releases, and it doesn't make sense to use it with dev profiles. # so we need to coerce cargo-deb into thinking this is a release binary @@ -426,47 +375,13 @@ jobs: - name: Build OCI image ${{ matrix.target }} run: | - # attic nix binary cache server is very, very terribly flakey. nothing i can do to fix it other than retry multiple times here - set +e # Don't exit on errors - ATTEMPTS=3 - SUCCESS=false - while (( ATTEMPTS-- > 0 )) - do - bin/nix-build-and-cache just .#oci-image-${{ matrix.target }}-all-features - if [[ $? == 0 ]]; then - SUCCESS=true - break - else - sleep 3 - fi - done - - if [[ $SUCCESS == "false" ]]; then - exit 1 - fi + bin/nix-build-and-cache just .#oci-image-${{ matrix.target }}-all-features cp -v -f result oci-image-${{ matrix.target }}.tar.gz - name: Build debug OCI image ${{ matrix.target }} run: | - # attic nix binary cache server is very, very terribly flakey. nothing i can do to fix it other than retry multiple times here - set +e # Don't exit on errors - ATTEMPTS=3 - SUCCESS=false - while (( ATTEMPTS-- > 0 )) - do - bin/nix-build-and-cache just .#oci-image-${{ matrix.target }}-all-features-debug - if [[ $? == 0 ]]; then - SUCCESS=true - break - else - sleep 3 - fi - done - - if [[ $SUCCESS == "false" ]]; then - exit 1 - fi + bin/nix-build-and-cache just .#oci-image-${{ matrix.target }}-all-features-debug cp -v -f result oci-image-${{ matrix.target }}-debug.tar.gz diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 68fe3557..58f1dd9c 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -110,24 +110,7 @@ jobs: - name: Cache CI dependencies run: | - # attic nix binary cache server is very, very terribly flakey. nothing i can do to fix it other than retry multiple times here - set +e # Don't exit on errors - ATTEMPTS=3 - SUCCESS=false - while (( ATTEMPTS-- > 0 )) - do - bin/nix-build-and-cache ci - if [[ $? == 0 ]]; then - SUCCESS=true - break - else - sleep 3 - fi - done - - if [[ $SUCCESS == "false" ]]; then - exit 1 - fi + bin/nix-build-and-cache ci - name: Run lychee and markdownlint run: | @@ -136,24 +119,7 @@ jobs: - name: Build documentation (book) run: | - # attic nix binary cache server is very, very terribly flakey. nothing i can do to fix it other than retry multiple times here - set +e # Don't exit on errors - ATTEMPTS=3 - SUCCESS=false - while (( ATTEMPTS-- > 0 )) - do - bin/nix-build-and-cache just .#book - if [[ $? == 0 ]]; then - SUCCESS=true - break - else - sleep 3 - fi - done - - if [[ $SUCCESS == "false" ]]; then - exit 1 - fi + bin/nix-build-and-cache just .#book cp -r --dereference result public diff --git a/bin/nix-build-and-cache b/bin/nix-build-and-cache index 3e39e91f..f6b471a6 100755 --- a/bin/nix-build-and-cache +++ b/bin/nix-build-and-cache @@ -34,6 +34,9 @@ just() { ) done + withattic() { + nix shell --inputs-from "$toplevel" attic --command xargs attic push "$@" <<< "${cache[*]}" + } # Upload them to Attic (conduit store) # # Use `xargs` and a here-string because something would probably explode if @@ -41,8 +44,7 @@ just() { # store paths include a newline in them. ( IFS=$'\n' - nix shell --inputs-from "$toplevel" attic -c xargs \ - attic push conduit <<< "${cache[*]}" + withattic conduit || withattic conduit || withattic conduit || true ) # main "conduwuit" store @@ -59,8 +61,7 @@ just() { # store paths include a newline in them. ( IFS=$'\n' - nix shell --inputs-from "$toplevel" attic -c xargs \ - attic push conduwuit <<< "${cache[*]}" + withattic conduwuit || withattic conduwuit || withattic conduwuit || true # push to cachix if available if [ "$CACHIX_AUTH_TOKEN" ]; then