From 7f4d14c60da6031733af08a0c85d572f60c56fb8 Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Mon, 5 Feb 2024 19:06:59 -0600 Subject: [PATCH] fixup! build(agd): rely on checksums, not timestamps --- .github/actions/restore-node/action.yml | 10 +++++++--- bin/agd | 8 ++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/actions/restore-node/action.yml b/.github/actions/restore-node/action.yml index a1e17d50f60d..8fdd666edf15 100644 --- a/.github/actions/restore-node/action.yml +++ b/.github/actions/restore-node/action.yml @@ -133,7 +133,7 @@ runs: if ! cmp -s <(git cat-file blob HEAD:package.json) package.json; then # In the event that the package.json has been modified by Endo - # replacements, We need to generate a yarn-installed.sum that matches + # replacements, we need to have a yarn-installed.sum that matches # the unmodified package.json. As long as we don't explicitly `yarn # install` anywhere other than in this action and in the bin/agd # script, we should be able to reuse even Endo-overridden built caches @@ -145,10 +145,14 @@ runs: stamp=$1 shift find ${1+"$@"} -exec sha1sum {} \; | sort +1 > "$stamp.new" || true - if test ! -s "$stamp.new" -a ! -e "$stamp"; then - echo "No dependencies found for $stamp" 1>&2 + if test ! -s "$stamp.new"; then + echo "No new dependencies found for $stamp" 1>&2 return 0 fi + if test ! -e "$stamp"; then + echo "No cached dependencies found for $stamp" 1>&2 + return 1 + fi diff -u "$stamp" "$stamp.new" || return 1 return 0 } diff --git a/bin/agd b/bin/agd index f111f7adde32..02ad93b65436 100755 --- a/bin/agd +++ b/bin/agd @@ -23,10 +23,14 @@ function diffsha1() { stamp=$1 shift find ${1+"$@"} -exec sha1sum {} \; | sort +1 > "$stamp.new" || true - if test ! -s "$stamp.new" -a ! -e "$stamp"; then - echo "No dependencies found for $stamp" 1>&2 + if test ! -s "$stamp.new"; then + echo "No new dependencies found for $stamp" 1>&2 return 0 fi + if test ! -e "$stamp"; then + echo "No cached dependencies found for $stamp" 1>&2 + return 1 + fi diff -u "$stamp" "$stamp.new" || return 1 return 0 }