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

build: replace libdmg and genisoimage with xorriso #18151

Closed

Conversation

fanquake
Copy link
Member

TLDR: Replace two tools that we build and maintain in depends, as part of our macOS deployment, with one that we don't.

Carl mentioned that xorriso (Debian package) could replace our usage of libdmg-hfsplus and genisoimage. Looks like that's possible. Have tested gitian builds, and reproducibility looks good. Looking for Concept ACKs.

Also related to #18128, as this eliminates some dependencies. Will post thoughts on using a .zip for distribution there.

TODO:

  • xorrisofs vs calling xorriso -as mkisofs
  • Compression. Passing zisofs level=9 etc.

@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 15, 2020

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

No conflicts as of last run.

@dongcarl
Copy link
Contributor

Should we add native_xorriso to depends?

@jonasschnelli
Copy link
Contributor

Nice work!
Gitian build works. Tested the DMG https://bitcointools.jonasschnelli.ch/gitian/build/10.

The only difference I observed is, that the new image is not compressed:

Master is around 12 MB (bitcoin-0.19.99-osx-unsigned-2.dmg) where this PR is around 27 (uncompressed).

-rw-r--r--@ 1 jonasschnelli  staff  12494037 15 Feb 21:38 bitcoin-0.19.99-osx-unsigned-2.dmg
-rw-r--r--@ 1 jonasschnelli  staff  27015168 15 Feb 21:36 bitcoin-0.19.99-osx-unsigned.dmg

@DrahtBot
Copy link
Contributor

Gitian builds

File commit 2a2631f
(master)
commit ff5a90b
(master and this pull)
bitcoin-0.19.99-aarch64-linux-gnu-debug.tar.gz 51392e3413128845... deff60fe783e43e7...
bitcoin-0.19.99-aarch64-linux-gnu.tar.gz 9c68060f909b176a... 6f7b0130323955cb...
bitcoin-0.19.99-arm-linux-gnueabihf-debug.tar.gz a4c6bc9d98b02c39... f32fc46496444507...
bitcoin-0.19.99-arm-linux-gnueabihf.tar.gz 91c276c85c6ea8f0... 4643219d4e06c9fe...
bitcoin-0.19.99-osx-unsigned.dmg 71c8478f6158f433... e0646d2545ed59d9...
bitcoin-0.19.99-osx64.tar.gz e9f498c9b0694e08... cb8058f79c96afa6...
bitcoin-0.19.99-riscv64-linux-gnu-debug.tar.gz e53b974b60b018a7... 57a588c874ae80d1...
bitcoin-0.19.99-riscv64-linux-gnu.tar.gz 3ae4b4f4bf44d8ed... 6821aa555aa4ba34...
bitcoin-0.19.99-win64-debug.zip 88fc928933abadaf... d698a2196041500c...
bitcoin-0.19.99-win64-setup-unsigned.exe 78c96ebfdbda69a3... edc68b0d42f434c6...
bitcoin-0.19.99-win64.zip be3e701005cfa682... 22c5f0c34591243e...
bitcoin-0.19.99-x86_64-linux-gnu-debug.tar.gz bdbbb809f6569067... 0f406d82706569ae...
bitcoin-0.19.99-x86_64-linux-gnu.tar.gz 185e77d19a57404c... 9d7bfb48554374bd...
bitcoin-0.19.99.tar.gz bd8f4dff76b14fe8... e9ad2d0b24c463aa...
bitcoin-core-linux-0.20-res.yml c3a41885d43ad9c1... bdb62a704c0b378b...
bitcoin-core-osx-0.20-res.yml 2ea28d851bd7def3... 5088786c9950106b...
bitcoin-core-win-0.20-res.yml db5c46d54aa23a95... b45a5bd753ac2cb5...
linux-build.log 67c5b5639d5edc84... 77fd68c99f98ae45...
osx-build.log 635adff0cbd384f3... 8880da5992e6112c...
win-build.log f9061ed05f12c5c0... 36988d1d134e8b53...
bitcoin-core-linux-0.20-res.yml.diff 51da68c70def5930...
bitcoin-core-osx-0.20-res.yml.diff 2c923ed3c4fbcaef...
bitcoin-core-win-0.20-res.yml.diff 8ac8ef5190910b1f...
linux-build.log.diff 3156db2725d9d2e6...
osx-build.log.diff dcce07030b94b395...
win-build.log.diff f4fd72042720144a...

@laanwj
Copy link
Member

laanwj commented Feb 26, 2020

Concept ACK. Nice. Having to maintain less software as part of the build is good.
Travis failure seemed unrelated so restarted.

@jonasschnelli
Copy link
Contributor

I'm unsure if xorriso supports HFS+ compression.
The libdmg-hfsplus code for compression looks quite extensive planetbeing/libdmg-hfsplus@fc8a216
and I haven't seen a similar implementation in xorrisofs code.

If it doesn't support HFS+ compression, we might want to discuss if a uncompressed disk image is acceptable (27MB instead of 12).

@laanwj
Copy link
Member

laanwj commented Mar 12, 2020

That's a good point. I think that'd be a waste. We might first want to wait (or encourage someone to work on) adding compression there then.

@maflcko
Copy link
Member

maflcko commented Mar 12, 2020

Even with pruning enabled, the savings of 15 MB are negligible when compared to the minimum disk usage Bitcoin Core requires. So while the savings are nice, it shouldn't be a requirement?

@laanwj laanwj added this to the 0.21.0 milestone Mar 27, 2020
@fanquake
Copy link
Member Author

Rather than doing this, I think switching to a .zip is the better solution, and will result in even less macOS specific code/dependencies for the project to maintain going forward. Going to close this and PR some other changes shortly.

@fanquake fanquake closed this May 25, 2020
laanwj added a commit to bitcoin-core/gui that referenced this pull request Dec 16, 2020
7587d11 build: remove cdrkit package from depends (fanquake)
0df9819 build: Replace genisoimage with xorriso (fanquake)
22437fc build: Run libdmg-hfsplus's DMG tool in make deploy (Carl Dong)

Pull request description:

  This is a redo of fanquake's bitcoin/bitcoin#18151, which, aside from switching us from the deprecated `genisoimage` to the maintained `xorriso`, is also necessary for Guix to achieve determinism without using faketime.

  > xorriso and its mkisofs/genisoimage emulation alter-ego xorrisofs are
  > more maintained, and has the right toggles for us to achieve output
  > determinism without using blunt tools like faketime.
  >
  > In this commit, we use xorrisofs from the build environment rather than
  > building it ourselves using depends. This is not necessary and can be
  > changed in the future.
  >
  > From wiki.debian.org/genisoimage?action=recall&rev=11 :
  >
  > > The classical command line interface for production of ISO 9660
  > > filesystem images is the option set established by program mkisofs.
  > > For reasons of licensing and other problems with its author, Debian
  > > ships a fork of mkisofs, called genisoimage, which was split off in
  > > 2006 and then developed independently.
  > >
  > > Meanwhile, genisoimage gets no new features and not even bug fixes. It
  > > is first choice only if its options -udf or -hfs are needed.
  > >
  > > Replacement in most uses cases, especially for bootable ISO 9660
  > > filesystems, archiving, and backup, is xorrisofs which starts the -as
  > > mkisofs emulation mode of program xorriso.

ACKs for top commit:
  laanwj:
    ACK 7587d11

Tree-SHA512: 62f3aad08fa8bf21192e951d7dd33b24975586d76834cfa3498f4b8cdb586cefec8cab2c073d1951a0884b5e182fd71ef2cf3accad98f84455016776ad3c5422
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
@fanquake fanquake deleted the xorriso_replaces_libdmg_genisoimage branch September 29, 2022 14:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants