-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #211 from freedomofpress/196-reproducible-wheels
Makes wheel builds reproducible, with tests
- Loading branch information
Showing
6 changed files
with
110 additions
and
15 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
tests/__pycache__/ | ||
debhelper-build-stamp | ||
*.debhelper.log |
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,43 @@ | ||
import pytest | ||
import subprocess | ||
|
||
|
||
# These are the SDW repositories that we build wheels for. | ||
REPOS_WITH_WHEELS = [ | ||
"securedrop-client", | ||
"securedrop-log", | ||
"securedrop-proxy", | ||
] | ||
|
||
|
||
def get_repo_root(): | ||
cmd = "git rev-parse --show-toplevel".split() | ||
top_level = subprocess.check_output(cmd).decode("utf-8").rstrip() | ||
return top_level | ||
|
||
|
||
@pytest.mark.parametrize("repo_name", REPOS_WITH_WHEELS) | ||
def test_wheel_builds_are_reproducible(repo_name): | ||
""" | ||
Uses 'reprotest' to confirm that the wheel build process, per repo, | ||
is deterministic, i.e. all .whl files are created with the same checksum | ||
across multiple builds. | ||
Explanations of the excluded reproducibility checks: | ||
* time: breaks HTTPS, so pip calls fail | ||
* locales: some locales fail, would be nice to fix, but low priority | ||
* kernel: x86_64 is the supported architecure, we don't ship others | ||
""" | ||
repo_url = f"https://github.com/freedomofpress/{repo_name}" | ||
cmd = [ | ||
"reprotest", | ||
"-c", | ||
f"./scripts/build-sync-wheels -p {repo_url} --clobber", | ||
"--vary", | ||
"+all, -time, -locales, -kernel", | ||
".", | ||
"localwheels/*.whl", | ||
] | ||
repo_root = get_repo_root() | ||
subprocess.check_call(cmd, cwd=repo_root) |