Skip to content

Commit bfbce6c

Browse files
committed
Merge bitcoin/bitcoin#24031: build: don't compress macOS DMG
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/bitcoin@1dd8cbf Tree-SHA512: 04c5bf78f26a9877777093ec4c50c457107bef59d720839ea5e7d7e4f7961dfee9f86b40cf791524a9e60e9e77403a797e9fcdae3849b60b759f9f66cc31b6ab
2 parents 6f55ab5 + 1dd8cbf commit bfbce6c

File tree

10 files changed

+7
-111
lines changed

10 files changed

+7
-111
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ src/qt/bitcoin-qt.includes
7777
*.log
7878
*.trs
7979
*.dmg
80-
*.iso
8180

8281
*.json.h
8382
*.raw.h

Makefile.am

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if ENABLE_MAN
1212
SUBDIRS += doc/man
1313
endif
1414
.PHONY: deploy FORCE
15-
.INTERMEDIATE: $(OSX_TEMP_ISO) $(COVERAGE_INFO)
15+
.INTERMEDIATE: $(COVERAGE_INFO)
1616

1717
export PYTHONPATH
1818

@@ -37,7 +37,6 @@ space := $(empty) $(empty)
3737
OSX_APP=Bitcoin-Qt.app
3838
OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME))
3939
OSX_DMG = $(OSX_VOLNAME).dmg
40-
OSX_TEMP_ISO = $(OSX_DMG:.dmg=).temp.iso
4140
OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
4241
OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns
4342
OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed
@@ -130,19 +129,15 @@ deploydir: $(OSX_DMG)
130129
else !BUILD_DARWIN
131130
APP_DIST_DIR=$(top_builddir)/dist
132131

133-
$(OSX_TEMP_ISO): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
132+
$(OSX_DMG): deploydir
134133
$(XORRISOFS) -D -l -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -o $@ $(APP_DIST_DIR) -- $(if $(SOURCE_DATE_EPOCH),-volume_date all_file_dates =$(SOURCE_DATE_EPOCH))
135134

136-
$(OSX_DMG): $(OSX_TEMP_ISO)
137-
$(DMG) dmg "$<" "$@"
138-
139135
$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
140136
INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR)
141137

142138
deploydir: $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
143139
endif !BUILD_DARWIN
144140

145-
appbundle: $(OSX_APP_BUILT)
146141
deploy: $(OSX_DMG)
147142
endif
148143

configure.ac

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,6 @@ case $host in
778778
AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], [install_name_tool])
779779
AC_PATH_TOOL([OTOOL], [otool], [otool])
780780
AC_PATH_PROGS([XORRISOFS], [xorrisofs], [xorrisofs])
781-
AC_PATH_PROGS([DMG], [dmg], [dmg])
782781

783782
dnl libtool will try to strip the static lib, which is a problem for
784783
dnl cross-builds because strip attempts to call a hard-coded ld,

contrib/guix/libexec/build.sh

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,6 @@ prepend_to_search_env_var() {
7979
export "${1}=${2}${!1:+:}${!1}"
8080
}
8181

82-
case "$HOST" in
83-
*darwin*)
84-
# When targeting darwin, zlib is required by native_libdmg-hfsplus.
85-
zlib_store_path=$(store_path "zlib")
86-
zlib_static_store_path=$(store_path "zlib" static)
87-
88-
prepend_to_search_env_var LIBRARY_PATH "${zlib_static_store_path}/lib:${zlib_store_path}/lib"
89-
prepend_to_search_env_var C_INCLUDE_PATH "${zlib_store_path}/include"
90-
prepend_to_search_env_var CPLUS_INCLUDE_PATH "${zlib_store_path}/include"
91-
prepend_to_search_env_var OBJC_INCLUDE_PATH "${zlib_store_path}/include"
92-
prepend_to_search_env_var OBJCPLUS_INCLUDE_PATH "${zlib_store_path}/include"
93-
esac
94-
9582
# Set environment variables to point the CROSS toolchain to the right
9683
# includes/libs for $HOST
9784
case "$HOST" in
@@ -332,8 +319,7 @@ mkdir -p "$DISTSRC"
332319
mkdir -p "unsigned-app-${HOST}"
333320
cp --target-directory="unsigned-app-${HOST}" \
334321
osx_volname \
335-
contrib/macdeploy/detached-sig-create.sh \
336-
"${BASEPREFIX}/${HOST}"/native/bin/dmg
322+
contrib/macdeploy/detached-sig-create.sh
337323
mv --target-directory="unsigned-app-${HOST}" dist
338324
(
339325
cd "unsigned-app-${HOST}"

contrib/guix/libexec/codesign.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,11 @@ mkdir -p "$DISTSRC"
8484
# Apply detached codesignatures to dist/ (in-place)
8585
signapple apply dist/Bitcoin-Qt.app codesignatures/osx/dist
8686

87-
# Make an uncompressed DMG from dist/
87+
# Make a DMG from dist/
8888
xorrisofs -D -l -V "$(< osx_volname)" -no-pad -r -dir-mode 0755 \
89-
-o uncompressed.dmg \
89+
-o "${OUTDIR}/${DISTNAME}-${HOST}.dmg" \
9090
dist \
9191
-- -volume_date all_file_dates ="$SOURCE_DATE_EPOCH"
92-
93-
# Compress uncompressed.dmg and output to OUTDIR
94-
./dmg dmg uncompressed.dmg "${OUTDIR}/${DISTNAME}-${HOST}.dmg"
9592
;;
9693
*)
9794
exit 1

contrib/guix/manifest.scm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,8 +573,6 @@ inspecting signatures in Mach-O binaries.")
573573
bzip2
574574
gzip
575575
xz
576-
zlib
577-
(list zlib "static")
578576
;; Build tools
579577
gnu-make
580578
libtool

contrib/macdeploy/README.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,7 @@ redistributed.
9595

9696
[`xorrisofs`](https://www.gnu.org/software/xorriso/) is used to create the DMG.
9797

98-
`xorrisofs` cannot compress DMGs, so afterwards, the DMG tool from the
99-
`libdmg-hfsplus` project is used to compress it. There are several bugs in this
100-
tool and its maintainer has seemingly abandoned the project.
101-
102-
The DMG tool has the ability to create DMGs from scratch as well, but this functionality is
103-
broken. Only the compression feature is currently used. Ideally, the creation could be fixed
104-
and `xorrisofs` would no longer be necessary.
105-
106-
Background images and other features can be added to DMG files by inserting a
107-
`.DS_Store` during creation.
98+
A background image is added to DMG files by inserting a `.DS_Store` during creation.
10899

109100
As of OS X 10.9 Mavericks, using an Apple-blessed key to sign binaries is a requirement in
110101
order to satisfy the new Gatekeeper requirements. Because this private key cannot be

depends/packages/native_libdmg-hfsplus.mk

Lines changed: 0 additions & 24 deletions
This file was deleted.

depends/packages/packages.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ usdt_linux_packages=systemtap
2626
darwin_native_packages = native_ds_store native_mac_alias
2727

2828
ifneq ($(build_os),darwin)
29-
darwin_native_packages += native_cctools native_libtapi native_libdmg-hfsplus
29+
darwin_native_packages += native_cctools native_libtapi
3030

3131
ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),)
3232
darwin_native_packages+= native_clang

depends/patches/native_libdmg-hfsplus/remove-libcrypto-dependency.patch

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)