Skip to content

Conversation

@ptrus
Copy link
Member

@ptrus ptrus commented Nov 10, 2025

Fixes: #592

This change refactors the squashfs build to produce bit-for-bit identical outputs across multiple environments, but the resulting images differ from those built with previous versions. We should probably do a major bump of CLI to 0.17 once this is merged.

I have tested this change on:

  • Ubuntu host
  • Ubuntu Docker container on Ubuntu host
  • Debian Bookworm Docker container on Ubuntu host
  • Ubuntu Docker container on macOS host

In all cases, the resulting rofl app builds produced identical Enclave IDs.

I wasn't able to avoid fakeroot: even with adding -all-root -force-uid 0, -force-gid 0 to sqfstar.
Also, I wasn't able to get it working without tar -> sqfstar.
I also added a warning to check for version version 4.5, because using 4.7.4 i get a different Enclave IDs.

Edit:

  • Maybe it would be worth finding out where the difference between 4.5 and 4.7.4 comes from, because based on the changelog, it's not apparent to me. Then we could achieve even greater reproducibility. Will try a bit, but don't want to spend too much time on this.
    • 4.6.x and 4.7.x produce identical images, while 4.5.x produces different. So the change is in 4.6 .

I have confirmed the difference comes from the following bug fix in 4.6:

8.4 Sqfstar would incorrectly strip pathname components in PAX header linkpath if symbolic.

Will try switching from "--format=pax to "--format=gnu in the tar command.

This fixed the issue 🎉 This is now also reproducable across squashfs-tools >= 4.5

@netlify
Copy link

netlify bot commented Nov 10, 2025

Deploy Preview for oasisprotocol-cli canceled.

Name Link
🔨 Latest commit 92b87b2
🔍 Latest deploy log https://app.netlify.com/projects/oasisprotocol-cli/deploys/6912eb7650803e0008e9be7a

@ptrus ptrus requested review from abukosek and kostko November 10, 2025 17:52
@ptrus ptrus force-pushed the ptrus/feature/reproducable-build branch from 40cec55 to 3b8dcba Compare November 10, 2025 18:00
Copy link
Contributor

@abukosek abukosek left a comment

Choose a reason for hiding this comment

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

Looks good! :) I've given it a quick try on my macOS and Linux dev machines and it generates the exact same output.

Going via tar was also one of my considerations for fixing the UTF-8 normalization differences between Linux and macOS, it's good to see that this also fixes other problems.

@ptrus ptrus force-pushed the ptrus/feature/reproducable-build branch from 3b8dcba to 38b48ef Compare November 11, 2025 07:28
@ptrus
Copy link
Member Author

ptrus commented Nov 11, 2025

I have also made it reproducible across different squashfs tools versions (see updated description).

Copy link
Member

@kostko kostko left a comment

Choose a reason for hiding this comment

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

Very cool, great work!

@ptrus ptrus force-pushed the ptrus/feature/reproducable-build branch from 38b48ef to 28f66d9 Compare November 11, 2025 07:43
@ptrus ptrus force-pushed the ptrus/feature/reproducable-build branch from 28f66d9 to 92b87b2 Compare November 11, 2025 07:53
@ptrus ptrus merged commit e696ff3 into master Nov 11, 2025
5 checks passed
@ptrus ptrus deleted the ptrus/feature/reproducable-build branch November 11, 2025 07:58
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.

Ensure rofl build command creates the same ORC bundles across Linux and macOS

4 participants