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

Ensure our generated tar files are reproducible #103

Open
andir opened this issue Sep 13, 2021 · 0 comments
Open

Ensure our generated tar files are reproducible #103

andir opened this issue Sep 13, 2021 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@andir
Copy link
Collaborator

andir commented Sep 13, 2021

Right now we are using the file systems order when creating tar files (for e.g. Git dependencies). We should at least provide the --sort flag to the tar command:

       --sort=ORDER
              When creating an archive, sort directory entries according to ORDER, which is one of none, name, or inode.

              The default is --sort=none, which stores archive members in the same order as returned by the operating system.

              Using --sort=name ensures the member ordering in the created archive is uniform and reproducible.

              Using  --sort=inode  reduces the number of disk seeks made when creating the archive and thus can considerably speed up archivation.  This sorting order is supported only if the underlying system provides the necessary
              information.

Code that has to be adjusted:

tar -C ${src} -czf $out ./

It is worth checking what other options we should be setting. Perhaps nixpkgs already has this solved for us.

@andir andir added enhancement New feature or request good first issue Good for newcomers labels Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant