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 .sprockets-manifest and gzip reproducibility issues #761

Closed
wants to merge 1 commit into from

Conversation

ryantm
Copy link

@ryantm ryantm commented Sep 20, 2022

When building Rails assets with Nix, I found they are almost completely reproducible save the manifest file, and the gzipped files. This commit fixes those issues. For more information about why it is good for a build to be reproducible see:

https://reproducible-builds.org/

Here are the reproducibility issues and how they were fixed:

  1. .sprckets-manifest contained the time when the assets were generated. Instead use timestamp 1.
  2. gzip encoded the file mtime in the archive, which is not reproducible. Instead use timestamp 1.
  3. .sprockets-manifest generating a random path for this file is not reproducible. Instead use the file's data to generate a digest.

Fixes #707

@ryantm ryantm marked this pull request as draft September 20, 2022 22:07
When building Rails assets with Nix, I found they are almost
completely reproducible save the manifest file, and the gzipped
files. This commit fixes those issues. For more information about why
it is good for a build to be reproducible see:

https://reproducible-builds.org/

Here are the reproducibility issues and how they were fixed:

1. .sprckets-manifest contained the time when the assets were
generated. Instead use timestamp 1.
2. gzip encoded the file mtime in the archive, which is not
reproducible. Instead use timestamp 1.
3. .sprockets-manifest generating a random path for this file is not
reproducible. Instead use the file's data to generate a digest.
@ryantm
Copy link
Author

ryantm commented Sep 20, 2022

I'm closing this in favor of separate PRs for each fix.

@ryantm ryantm closed this Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

assets:precompile always modifies mtime in the generated manifest
1 participant