mirror of
https://github.com/pezkuwichain/pezkuwi-extension.git
synced 2026-11-05 00:41:07 +00:00
Make the Firefox source build reproducible, and let its check fail
The diff step rebuilds the extension from master-ff-src.zip (the source archive AMO reviews) and compares the result with our build. It had never worked, which the removed continue-on-error was hiding: - The source zip left out .yarn/releases (yarnPath points there, so yarn could not start in the unpacked source) and scripts/ (build:ff runs scripts/postbuild-cleanup.cjs). Both are now included. - diff.sh used `[ a || b ]`, which is not valid test syntax, and piped `diff -qr` into `sort`, so the check exited 0 whatever diff found. It now goes by diff's own exit status; with a file altered it fails. - With those fixed, the builds still differed: webpack inlined import.meta.url from @pezkuwi/* packageInfo.js as the absolute file:// path of the build machine, which also put our build directory into the published extension. DefinePlugin now gives it a fixed value; it is only shown in duplicate-version warnings. Also fail-fast: false on the matrix. Without continue-on-error, the first red step cancelled the others, so their results were lost. Checked locally with node_modules as locked: "Builds are identical".
This commit is contained in:
1 parent
865bce54ae
commit
758d346078
4 files changed
+17
-21
No files matched your search
+7
-19
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2025 @polkadot/extension-compat-metamask authors & contributors
|
||||
# Copyright 2019-2026 @pezkuwi/extension authors & contributors
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#!/bin/bash
|
||||
@@ -9,14 +9,15 @@ yarn build:ff
|
||||
# Reorg the builds to
|
||||
mkdir ff-diff
|
||||
|
||||
OS=$(uname)
|
||||
FILE_PATH="./ff-diff"
|
||||
|
||||
compare_directories() {
|
||||
local dir1=$1
|
||||
local dir2=$2
|
||||
|
||||
if diff -qr "$dir1" "$dir2" | sort; then
|
||||
# diff's own exit status decides; piped into sort it was always 0, so builds
|
||||
# that differed were reported as identical.
|
||||
if diff -qr "$dir1" "$dir2"; then
|
||||
echo "Builds are identical"
|
||||
exit 0
|
||||
else
|
||||
@@ -33,21 +34,8 @@ unzip_ff() {
|
||||
cd ./master-ff-src && yarn install && yarn build:ff && cd ..
|
||||
}
|
||||
|
||||
if [ "$OS" == "Darwin" || "$RUNNER_OS" == "Linux" ]; then
|
||||
echo "Running on macOS"
|
||||
# macOS-specific commands go here
|
||||
mv ./master-ff-src.zip ./master-ff-build.zip "$FILE_PATH" && cd "$FILE_PATH"
|
||||
|
||||
mv ./master-ff-src.zip ./master-ff-build.zip $FILE_PATH && cd $FILE_PATH
|
||||
unzip_ff
|
||||
|
||||
unzip_ff
|
||||
|
||||
compare_directories ./master-ff-build ./master-ff-src/packages/extension/build
|
||||
else # Assuming it will be Linux
|
||||
echo "Running on Linux"
|
||||
# Linux-specific commands go here
|
||||
|
||||
mv -t $FILE_PATH ./master-ff-src.zip ./master-ff-build.zip && cd $FILE_PATH
|
||||
unzip_ff
|
||||
|
||||
compare_directories ./master-ff-build ./master-ff-src/packages/extension/build
|
||||
fi
|
||||
compare_directories ./master-ff-build ./master-ff-src/packages/extension/build
|
||||
Reference in new issue
Block a user