Skip to content

Commit

Permalink
fixup! build(agd): rely on checksums, not timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Feb 6, 2024
1 parent b58f3bb commit 7f4d14c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 7 additions & 3 deletions .github/actions/restore-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down
8 changes: 6 additions & 2 deletions bin/agd
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 7f4d14c

Please sign in to comment.