-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Need to add `-all-time 0` to the mksquashfs args to prevent non-deterministic timestamps of files generated from the pseudo file definitions list. See plougher/squashfs-tools#288 Also add an integration test that checks if rebuilds have stable hashes. For some there were two minor issues regarding `bazel mod tidy` and a missing `program.sh`, fixed those as well.
- Loading branch information
Showing
5 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
# When an appimage is rebuilt, the sha256sum of the resulting file must be the same. | ||
# In other words, the build must be deterministic. | ||
# We check this by building the same targets twice and comparing the sha256sums. | ||
|
||
set -euxo pipefail | ||
|
||
query='kind("appimage rule", //...)' | ||
tempdir="$(mktemp -d)" | ||
targets="$tempdir/targets" | ||
files="$tempdir/files" | ||
trap 'rm -rf "$tempdir"' EXIT | ||
|
||
bazel query "$query" >"$targets" | ||
bazel cquery "$query" --output files >"$files" | ||
|
||
bazel build --target_pattern_file="$targets" | ||
xargs --arg-file="$files" sha256sum | tee "$tempdir/shas0.txt" | ||
|
||
xargs --arg-file="$files" rm -f | ||
|
||
bazel build --remote_cache= --disk_cache= --target_pattern_file="$targets" | ||
xargs --arg-file="$files" sha256sum | tee "$tempdir/shas1.txt" | ||
|
||
diff -u "$tempdir/shas0.txt" "$tempdir/shas1.txt" |