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

Sort input filenames to SHA256STAMP #4053

Merged
merged 2 commits into from
Sep 17, 2020

Conversation

whitslack
Copy link
Collaborator

Make's wildcard function returns matching file paths in an unpredictable order, thereby causing false mismatches in the produced SHA256STAMPs from system to system. This pull request sorts the file paths given to cat to make the stamps deterministic.

This change is crucial if you really want people to be able to build C-Lightning without having Mako installed.

Make's 'wildcard' function returns matching file paths in an
unpredictable order, thereby causing false mismatches in the produced
SHA256STAMPs from system to system. This commit sorts the file paths
given to 'cat' to make the stamps deterministic.

Changelog-Fixed: The build system no longer spuriously regenerates generated sources due to differences in `readdir`(3) sort order.
@whitslack whitslack marked this pull request as draft September 16, 2020 01:35
@whitslack whitslack marked this pull request as ready for review September 16, 2020 01:42
Copy link
Member

@cdecker cdecker left a comment

Choose a reason for hiding this comment

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

ACK bcfdcaa

@rustyrussell
Copy link
Contributor

It's weird, I thought about this but couldn't find anywhere it was a problem.

Even so, this is harmless, so applied!

Thanks!

@rustyrussell rustyrussell merged commit eab1476 into ElementsProject:master Sep 17, 2020
@whitslack
Copy link
Collaborator Author

It's weird, I thought about this but couldn't find anywhere it was a problem.

@rustyrussell: I noticed it while working on the Gentoo ebuilds for C-Lightning. My main system would build 0.9.1 without running generate-wire.py, but a chroot system I have for testing the stable Gentoo environment was always running generate-wire.py. I noticed that the only changes to the generated sources were the SHA256STAMPs, and I had a hunch about the ordering of the dependencies, so I sha256sum'd every permutation of the dependency files and found both the checked-in SHA256STAMP and the one that my build had stamped, so this told me my hunch was right.

@whitslack whitslack deleted the sha256stamp-sorted branch September 24, 2020 06:04
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.

3 participants