Skip to content

Commit 0ef3fb0

Browse files
committed
Fix deterministic builds.
Remove DB before changing. Report version of sqlite3 during testing.
1 parent 41cf3b8 commit 0ef3fb0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

test.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,9 @@ fi
6060
popd
6161

6262
bash test-ruleset-coverage.sh
63+
# Echo the version of sqlite3, since the determinism of the build depends on
64+
# having the same version.
65+
echo "To reproduce this build (https://wiki.debian.org/ReproducibleBuilds)," \
66+
"please use this version of sqlite3:"
67+
sqlite3 -version
6368
echo -e "Git commit `git rev-parse HEAD`\nsha256sum `sha256sum $XPI_NAME`"

utils/make-sqlite.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
# It's also helpful to ensure consistency for the lowercase check below.
1919
locale.setlocale(locale.LC_ALL, 'C')
2020

21-
conn = sqlite3.connect(os.path.join(os.path.dirname(__file__), '../src/defaults/rulesets.sqlite'))
21+
# Removing the file before we create it avoids some non-determinism.
22+
db_path = os.path.join(os.path.dirname(__file__), '../src/defaults/rulesets.sqlite')
23+
if os.path.isfile(db_path):
24+
os.remove(db_path)
25+
conn = sqlite3.connect(db_path)
2226
c = conn.cursor()
2327
c.execute('''DROP TABLE IF EXISTS rulesets''')
2428
c.execute('''CREATE TABLE rulesets

0 commit comments

Comments
 (0)