Skip to content

Conversation

fanquake
Copy link
Member

@fanquake fanquake commented Jan 11, 2022

Skip compressing the macOS DMG, and drop related build steps and dependencies. Uncompressed the DMG increases from ~16mb to ~30mb, which compared to other software a user may download, (Firefox 125mb, VLC 52mb, Open Office 176mb), is still relatively small. When contrasted against the 100's of GB of blockchain data a node will download, an additional 15mb to get the release binary, isn't much additional overhead. Note that if / when we build with LTO enabled for releases, this size will shrink back down significantly again.

native_libdmg-hfsplus is not maintained, and I doubt the DMG creation feature will ever be fixed. If at some point xorrisofs supports compressing dmgs, we could enable that.

Guix Build on x86_64:

25b7c8bb7bc8ea014d43cebb844a842d2ac8d5a343039a820d24b649c9e6bc8a  guix-build-1dd8cbfbc631/output/arm64-apple-darwin/SHA256SUMS.part
16beb5c52c9bf51b5ce9ef5a0d17c0038238a833383586a1b14acbca78533e4b  guix-build-1dd8cbfbc631/output/arm64-apple-darwin/bitcoin-1dd8cbfbc631-arm64-apple-darwin-unsigned.dmg
d8f89a61a7448d6334dbb3639386a7b6340542393933f35421a9e6dfc724e455  guix-build-1dd8cbfbc631/output/arm64-apple-darwin/bitcoin-1dd8cbfbc631-arm64-apple-darwin-unsigned.tar.gz
11617dc261ef602433f5bb29956a40a9085dbc783f519f75fbe06e80970148d0  guix-build-1dd8cbfbc631/output/arm64-apple-darwin/bitcoin-1dd8cbfbc631-arm64-apple-darwin.tar.gz
aa8550d4a394d3161d14ec5e6012ed07354135afb022e905a1946785b4665664  guix-build-1dd8cbfbc631/output/dist-archive/bitcoin-1dd8cbfbc631.tar.gz
2b837f2f971a9738d0b7b8497f7ded740ef5e67c8baa7f30ca33e6b7d826eec8  guix-build-1dd8cbfbc631/output/x86_64-apple-darwin/SHA256SUMS.part
db972b2c06dbde5525a3f9e6ceb9c20a8120bc9a6f15e1d852a4bfac09d88569  guix-build-1dd8cbfbc631/output/x86_64-apple-darwin/bitcoin-1dd8cbfbc631-x86_64-apple-darwin-unsigned.dmg
50fe990c3f9923ee92195125faf6517396e7c1b017a8f4f7d52e991ebce52f0c  guix-build-1dd8cbfbc631/output/x86_64-apple-darwin/bitcoin-1dd8cbfbc631-x86_64-apple-darwin-unsigned.tar.gz
1d9022b0ae46ead41046c40f82291ce363760660a3cd6e6ef6a5b1128b90faef  guix-build-1dd8cbfbc631/output/x86_64-apple-darwin/bitcoin-1dd8cbfbc631-x86_64-apple-darwin.tar.gz

Guix Build on arm64:

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 11, 2022

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #21778 (build: LLVM 14 & LLD based macOS toolchain by fanquake)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@Sjors
Copy link
Member

Sjors commented Jan 13, 2022

Concept ACK

When I build locally on macOS 12.1 and without using depends, the difference in size between this commit and its parent is negligible. Both are 20 MB. Am I doing it wrong or is there something in the Guix build that lends itself more to compression?

Update: oh wait, when building on macOS it uses completely different tools (see if BUILD_DARWIN in Makefile)

Copy link

@monstrito monstrito left a comment

Choose a reason for hiding this comment

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

@fanquake fanquake linked an issue Jan 31, 2022 that may be closed by this pull request
@fanquake
Copy link
Member Author

fanquake commented Jan 31, 2022

An additional reason for merging this is that is will fix Guix building for arm64 darwin on arm64 darwin (#24211).

@fanquake fanquake force-pushed the dont_compress_macos_dmg branch from b38ef12 to abda6d4 Compare February 2, 2022 12:38
@fanquake fanquake marked this pull request as ready for review February 2, 2022 13:26
@fanquake fanquake force-pushed the dont_compress_macos_dmg branch from abda6d4 to da1cc40 Compare February 22, 2022 10:40
@fanquake fanquake force-pushed the dont_compress_macos_dmg branch from da1cc40 to 36493fc Compare March 9, 2022 10:27
@fanquake fanquake force-pushed the dont_compress_macos_dmg branch from 36493fc to 3a0aa73 Compare March 16, 2022 16:20
@fanquake
Copy link
Member Author

Rebased past #23565.

@Sjors
Copy link
Member

Sjors commented Mar 18, 2022

The code in 6c73e2a looks reasonable, but what's the process for testing this? I assume we need detached signatures to have guix bake the DMG? If that can be done with something self-signed, what's the incantation?

@jarolrod
Copy link
Member

Concept ACK

Guix hashes on x86

25b7c8bb7bc8ea014d43cebb844a842d2ac8d5a343039a820d24b649c9e6bc8a  guix-build-1dd8cbfbc631/output/arm64-apple-darwin/SHA256SUMS.part
16beb5c52c9bf51b5ce9ef5a0d17c0038238a833383586a1b14acbca78533e4b  guix-build-1dd8cbfbc631/output/arm64-apple-darwin/bitcoin-1dd8cbfbc631-arm64-apple-darwin-unsigned.dmg
d8f89a61a7448d6334dbb3639386a7b6340542393933f35421a9e6dfc724e455  guix-build-1dd8cbfbc631/output/arm64-apple-darwin/bitcoin-1dd8cbfbc631-arm64-apple-darwin-unsigned.tar.gz
11617dc261ef602433f5bb29956a40a9085dbc783f519f75fbe06e80970148d0  guix-build-1dd8cbfbc631/output/arm64-apple-darwin/bitcoin-1dd8cbfbc631-arm64-apple-darwin.tar.gz
aa8550d4a394d3161d14ec5e6012ed07354135afb022e905a1946785b4665664  guix-build-1dd8cbfbc631/output/dist-archive/bitcoin-1dd8cbfbc631.tar.gz
2b837f2f971a9738d0b7b8497f7ded740ef5e67c8baa7f30ca33e6b7d826eec8  guix-build-1dd8cbfbc631/output/x86_64-apple-darwin/SHA256SUMS.part
db972b2c06dbde5525a3f9e6ceb9c20a8120bc9a6f15e1d852a4bfac09d88569  guix-build-1dd8cbfbc631/output/x86_64-apple-darwin/bitcoin-1dd8cbfbc631-x86_64-apple-darwin-unsigned.dmg
50fe990c3f9923ee92195125faf6517396e7c1b017a8f4f7d52e991ebce52f0c  guix-build-1dd8cbfbc631/output/x86_64-apple-darwin/bitcoin-1dd8cbfbc631-x86_64-apple-darwin-unsigned.tar.gz
1d9022b0ae46ead41046c40f82291ce363760660a3cd6e6ef6a5b1128b90faef  guix-build-1dd8cbfbc631/output/x86_64-apple-darwin/bitcoin-1dd8cbfbc631-x86_64-apple-darwin.tar.gz

Guix hashes on arm64

e5c954168658b4e8347b96753b78cddb84f5fd8758260e26769b35e00f15ee02  guix-build-1dd8cbfbc631/output/arm64-apple-darwin/SHA256SUMS.part
23bf8ddde7c6850843a79843fa4c42f5d09f1dd11ed3492ed00462fd87d32583  guix-build-1dd8cbfbc631/output/arm64-apple-darwin/bitcoin-1dd8cbfbc631-arm64-apple-darwin-unsigned.dmg
f441b8695d26af1040ed5dfe7feb217561edc56bf693639774711502d27172c7  guix-build-1dd8cbfbc631/output/arm64-apple-darwin/bitcoin-1dd8cbfbc631-arm64-apple-darwin-unsigned.tar.gz
d7a3ccb47907db23f263d2f9c3ca548bb60e357d80f765a45bfdc38652030d68  guix-build-1dd8cbfbc631/output/arm64-apple-darwin/bitcoin-1dd8cbfbc631-arm64-apple-darwin.tar.gz
aa8550d4a394d3161d14ec5e6012ed07354135afb022e905a1946785b4665664  guix-build-1dd8cbfbc631/output/dist-archive/bitcoin-1dd8cbfbc631.tar.gz
2b837f2f971a9738d0b7b8497f7ded740ef5e67c8baa7f30ca33e6b7d826eec8  guix-build-1dd8cbfbc631/output/x86_64-apple-darwin/SHA256SUMS.part
db972b2c06dbde5525a3f9e6ceb9c20a8120bc9a6f15e1d852a4bfac09d88569  guix-build-1dd8cbfbc631/output/x86_64-apple-darwin/bitcoin-1dd8cbfbc631-x86_64-apple-darwin-unsigned.dmg
50fe990c3f9923ee92195125faf6517396e7c1b017a8f4f7d52e991ebce52f0c  guix-build-1dd8cbfbc631/output/x86_64-apple-darwin/bitcoin-1dd8cbfbc631-x86_64-apple-darwin-unsigned.tar.gz
1d9022b0ae46ead41046c40f82291ce363760660a3cd6e6ef6a5b1128b90faef  guix-build-1dd8cbfbc631/output/x86_64-apple-darwin/bitcoin-1dd8cbfbc631-x86_64-apple-darwin.tar.gz

@Sjors
Copy link
Member

Sjors commented Apr 13, 2022

re-tACK 1dd8cbf on Intel macOS

File is about 31 MB.

Only changes compared to 6c73e2a are in Makefile.am. Guix hashes match what @jarolrod found.

@laanwj
Copy link
Member

laanwj commented Apr 14, 2022

Build system changes code review ACK 1dd8cbf, I don't know anything about MacOS application formats and their internals so do not have an opinion on the contents of this change.

@hebasto
Copy link
Member

hebasto commented Apr 17, 2022

I think the reason this may no-longer pop up is because there isn't a hfsplus volume, which would have a specific bit set in it's header, to tell the OS/Finder to open a window on mount. Adding -hfsplus to the xorrisofs invocation doesn't seem to fix this, although maybe we should be adding that anyway.

Looks like a bug in the xorrisofs. Has it already been known/reported by someone?

If "yes", should we modify our macOS install instructions?

Which install instructions?

I mean, the change in user's steps to install Bitcoin Core on macOS should be documented somehow. Maybe, in release notes?

While touching this code, could the deploydir target be added to .PHONY:?

@jarolrod
Copy link
Member

Approach ACK. I have reviewed the code and done some testing, but still plan to do more testing before my final ack.

Confirming that the quix built dmg does not automatically open in a file window when double clicked, but does mount as expected. The DMG deployed through make deploy on a non-depends native compile build does open up automatically in a file window when double clicked.

This behavior change is fine with me, as we are getting rid of things (yay less things) and achieving cross-architecture reproducibility on a platform. If we need documentation on the behavior change, that can be picked up in a follow-up. Additionally, it could be possible to address the behavior change in a follow-up down the road.

@Sjors
Copy link
Member

Sjors commented Apr 19, 2022

Confirming that the quix built dmg does not automatically open in a file window when double clicked, but does mount as expected.

We should explain to the user that they have to do "open Bitcoin-Core.dmg". Could be fixed in a followup; I'd rather not have to run Guix again :-)

@fanquake
Copy link
Member Author

Looks like a bug in the xorrisofs. Has it already been known/reported by someone?

I'm not sure it is a bug. Aside from my not being sure if my assumption is correct, if it was, the same header bit that means something on macOS, probably doesn't mean anything on Linux for hfsplus volumes, which would likely be why the developers of the tool wouldn't have cared about this behaviour. I can look at following up.

I mean, the change in user's steps to install Bitcoin Core on macOS should be documented somehow. Maybe, in release notes?

Sure, we could add something to the release notes. I don't think it's a big deal either way.

While touching this code, could the deploydir target be added to .PHONY:?

If I touch this branch again I could do.

We should explain to the user that they have to do "open Bitcoin-Core.dmg".

They don't have to do open Bitcoin-Core.dmg. They can also just double click on it as usual, and pick the volume in Finder.

Copy link
Member

@jarolrod jarolrod left a comment

Choose a reason for hiding this comment

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

ACK 1dd8cbf

I've tested guix builds on x86 and arm64 to ensure that I can build and open the resulting dmg. This change looks good to me, While technically there is a behavior change in that the dmg doesn't automatically open up in the finder, I don't think this will reasonably cause any disturbance; I also don't think there will be any need for any documentation changes. One can reasonably be expected to know how to open up the dmg. The need for documentation can be revisited if there is ever an issue opened up on this topic.

@fanquake fanquake merged commit bfbce6c into bitcoin:master Apr 21, 2022
@fanquake fanquake deleted the dont_compress_macos_dmg branch April 21, 2022 07:54
fanquake added a commit to fanquake/bitcoin that referenced this pull request Apr 21, 2022
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Apr 22, 2022
@fanquake
Copy link
Member Author

I'm going to remove "Needs release note" here (this will be in 24.0), as I don't actually think it warrants one.

@jarolrod
Copy link
Member

I'm going to remove "Needs release note" here (this will be in 24.0), as I don't actually think it warrants one.

In regards to #26176, perhaps a release note is needed.

dekm pushed a commit to unigrid-project/daemon that referenced this pull request Oct 27, 2022
1dd8cbf build: don't compress macOS DMG (fanquake)

Pull request description:

  Skip compressing the macOS DMG, and drop related build steps and dependencies. Uncompressed the DMG increases from ~16mb to ~30mb, which compared to other software a user may download, (Firefox 125mb, VLC 52mb, Open Office 176mb), is still relatively small. When contrasted against the 100's of GB of blockchain data a node will download, an additional 15mb to get the release binary, isn't much additional overhead. Note that if / when we build with LTO enabled for releases, this size will shrink back down significantly again.

  `native_libdmg-hfsplus` is not maintained, and I doubt the DMG creation feature will ever be fixed. If at some point `xorrisofs` supports compressing dmgs, we could enable that.

  Guix Build on x86_64:
  ```bash
  25b7c8bb7bc8ea014d43cebb844a842d2ac8d5a343039a820d24b649c9e6bc8a  guix-build-1dd8cbfbc631/output/arm64-apple-darwin/SHA256SUMS.part
  16beb5c52c9bf51b5ce9ef5a0d17c0038238a833383586a1b14acbca78533e4b  guix-build-1dd8cbfbc631/output/arm64-apple-darwin/bitcoin-1dd8cbfbc631-arm64-apple-darwin-unsigned.dmg
  d8f89a61a7448d6334dbb3639386a7b6340542393933f35421a9e6dfc724e455  guix-build-1dd8cbfbc631/output/arm64-apple-darwin/bitcoin-1dd8cbfbc631-arm64-apple-darwin-unsigned.tar.gz
  11617dc261ef602433f5bb29956a40a9085dbc783f519f75fbe06e80970148d0  guix-build-1dd8cbfbc631/output/arm64-apple-darwin/bitcoin-1dd8cbfbc631-arm64-apple-darwin.tar.gz
  aa8550d4a394d3161d14ec5e6012ed07354135afb022e905a1946785b4665664  guix-build-1dd8cbfbc631/output/dist-archive/bitcoin-1dd8cbfbc631.tar.gz
  2b837f2f971a9738d0b7b8497f7ded740ef5e67c8baa7f30ca33e6b7d826eec8  guix-build-1dd8cbfbc631/output/x86_64-apple-darwin/SHA256SUMS.part
  db972b2c06dbde5525a3f9e6ceb9c20a8120bc9a6f15e1d852a4bfac09d88569  guix-build-1dd8cbfbc631/output/x86_64-apple-darwin/bitcoin-1dd8cbfbc631-x86_64-apple-darwin-unsigned.dmg
  50fe990c3f9923ee92195125faf6517396e7c1b017a8f4f7d52e991ebce52f0c  guix-build-1dd8cbfbc631/output/x86_64-apple-darwin/bitcoin-1dd8cbfbc631-x86_64-apple-darwin-unsigned.tar.gz
  1d9022b0ae46ead41046c40f82291ce363760660a3cd6e6ef6a5b1128b90faef  guix-build-1dd8cbfbc631/output/x86_64-apple-darwin/bitcoin-1dd8cbfbc631-x86_64-apple-darwin.tar.gz
  ```

  Guix Build on arm64:
  ```bash
  ```

ACKs for top commit:
  Sjors:
    re-tACK 1dd8cbf on Intel macOS
  laanwj:
    Build system changes code review ACK 1dd8cbf, I don't know anything about MacOS application formats and their internals so do not have an opinion on the contents of this change.
  jarolrod:
    ACK bitcoin@1dd8cbf

Tree-SHA512: 04c5bf78f26a9877777093ec4c50c457107bef59d720839ea5e7d7e4f7961dfee9f86b40cf791524a9e60e9e77403a797e9fcdae3849b60b759f9f66cc31b6ab
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request May 30, 2023
Summary:
Skip compressing the macOS DMG, and drop related build steps and dependencies. Uncompressed the DMG increases from ~16mb to ~30mb, which compared to other software a user may download, (Firefox 125mb, VLC 52mb, Open Office 176mb), is still relatively small.Note that if / when we build with LTO enabled for releases, this size will shrink back down significantly again.

native_libdmg-hfsplus is not maintained, and I doubt the DMG creation feature will ever be fixed. If at some point xorrisofs supports compressing dmgs, we could enable that.

This is a backport of [[bitcoin/bitcoin#24031 | core#24031]]

This is one step needed to make the MacOS build work with the current guix script.

Test Plan:
gitian-osx

`HOSTS="x86_64-apple-darwin" contrib/guix/guix-build`
This still fails with an exotic clang related error     `ld: unrecognised emulation mode: acosx_version_min`, but it no longer fails with a `cannot find lz` error.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D13950
kwvg added a commit to kwvg/dash that referenced this pull request Jun 20, 2023
kwvg added a commit to kwvg/dash that referenced this pull request Jun 20, 2023
kwvg added a commit to kwvg/dash that referenced this pull request Jun 20, 2023
kwvg added a commit to kwvg/dash that referenced this pull request Jun 20, 2023
kwvg added a commit to kwvg/dash that referenced this pull request Jun 20, 2023
kwvg added a commit to kwvg/dash that referenced this pull request Jun 20, 2023
kwvg added a commit to kwvg/dash that referenced this pull request Jun 28, 2023
@bitcoin bitcoin locked and limited conversation to collaborators Sep 26, 2023
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.

guix: building for arm64-apple-darwin fails on arm64-apple (M1)
7 participants