Skip to content

Make the release archive reproducible#6706

Merged
kit-ty-kate merged 2 commits intoocaml:masterfrom
kit-ty-kate:reproducible-release-archive
Oct 14, 2025
Merged

Make the release archive reproducible#6706
kit-ty-kate merged 2 commits intoocaml:masterfrom
kit-ty-kate:reproducible-release-archive

Conversation

@kit-ty-kate
Copy link
Copy Markdown
Member

Fixes #6619

While testing #6705 i encountered some failures due to extra ._* files in the archive (see https://superuser.com/questions/61185/why-do-i-get-files-like-foo-in-my-tarball-on-os-x) which made dune fail.

Using --no-mac-metadata fixes this problem but using git archive goes even further and should make the archive reproducible (same archive regardless of username, group, uid, gid, current time, …)

Extra ._* and .DS_Store files are present and can interfere with at least the OpenBSD build, in some cases
@kit-ty-kate kit-ty-kate added this to the 2.5.0~alpha1 milestone Sep 26, 2025
@kit-ty-kate kit-ty-kate force-pushed the reproducible-release-archive branch from 0904447 to 9200f4f Compare October 1, 2025 21:01
@kit-ty-kate kit-ty-kate requested a review from rjbou October 1, 2025 21:02
--prefix "opam-full-$(VERSION)/" \
--mtime "$$(git show -s --format=%ct "$(TAG)" | tail -1)" \
-o "$(abspath $(OUTDIR)/opam-full-$(VERSION).tar)" \
$$(for f in $$(git ls-files -i -o -x '*'); do echo "--add-file=$$f" || exit 1; done) && \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing it directly in make has the benefit that the displayed command explicitly shows what was added (I haven’t run it - I’m 99.9% sure the asterisk doesn’t want quoting when used with $(shell!)

Suggested change
$$(for f in $$(git ls-files -i -o -x '*'); do echo "--add-file=$$f" || exit 1; done) && \
$(addprefix --add-file=,$(shell git ls-files -i -o -x *)) && \

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed during the dev meeting last week, i've tried $(shell ...) before but given the change of directory using cd above in the same command string, these commands would have to use git -C which complicates the whole thing and it didn't work in my case for both git show and git ls-files for some reason. For now using sh subshells work out a bit better. I think we can improve later if needed

Copy link
Copy Markdown
Collaborator

@rjbou rjbou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed on dev meeting, lgtm!

@kit-ty-kate kit-ty-kate merged commit 41e12e3 into ocaml:master Oct 14, 2025
2 checks passed
@kit-ty-kate kit-ty-kate deleted the reproducible-release-archive branch October 14, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Release: The opam-full-*.tar.gz generation isn't reproducible

3 participants