Skip to content
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

Fix stability of reproducible tarballs from git repos #4517

Merged
merged 2 commits into from
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions easybuild/tools/filetools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2680,13 +2680,13 @@ def get_source_tarball_from_git(filename, target_dir, git_config):
tar_cmd = [
# print names of all files and folders excluding .git directory
'find', repo_name, '-name ".git"', '-prune', '-o', '-print0',
# reset access and modification timestamps
'-exec', 'touch', '-t 197001010100', '{}', r'\;', '|',
# reset access and modification timestamps to epoch 0
'-exec', 'touch', '--date=@0', '{}', r'\;', '|',
# sort file list
'LC_ALL=C', 'sort', '--zero-terminated', '|',
# create tarball in GNU format with ownership reset
'tar', '--create', '--no-recursion', '--owner=0', '--group=0', '--numeric-owner', '--format=gnu',
'--null', '--files-from', '-', '|',
# create tarball in GNU format with ownership and permissions reset
'tar', '--create', '--no-recursion', '--owner=0', '--group=0', '--numeric-owner', '--mode="go+u,go-w"',
lexming marked this conversation as resolved.
Show resolved Hide resolved
'--format=gnu', '--null', '--files-from', '-', '|',
# compress tarball with gzip without original file name and timestamp
'gzip', '--no-name', '>', archive_path
]
Expand Down
Loading