-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Makes wheel builds reproducible, with tests #211
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
07083fb
Attempts to build wheels reproducibly
09ac375
Builds wheels only for x86_64 architecture
kushaldas 10c9234
Adds tests for reproducible wheels
59fa94f
Adds reprotest as dependency to be instlaled
kushaldas d66213b
Adds install-deps step for tests too
kushaldas e293606
Use machine executor to allow reprotests to setarch
emkll fbe4010
Enables wheel tests for log & proxy
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there other repositories for which we build wheels, that should be added to this list?