Skip to content

Commit 4acbcfa

Browse files
committed
Merge #20470: build: Replace genisoimage with xorriso
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
2 parents ae9ee5b + 7587d11 commit 4acbcfa

File tree

10 files changed

+25
-136
lines changed

10 files changed

+25
-136
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ src/qt/bitcoin-qt.includes
7676
*.log
7777
*.trs
7878
*.dmg
79+
*.iso
7980

8081
*.json.h
8182
*.raw.h

Makefile.am

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ space := $(empty) $(empty)
3535
OSX_APP=Bitcoin-Qt.app
3636
OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME))
3737
OSX_DMG = $(OSX_VOLNAME).dmg
38+
OSX_TEMP_ISO = $(OSX_DMG:.dmg=).temp.iso
3839
OSX_BACKGROUND_SVG=background.svg
3940
OSX_BACKGROUND_IMAGE=background.tiff
4041
OSX_BACKGROUND_IMAGE_DPIS=36 72
@@ -135,8 +136,12 @@ $(APP_DIST_DIR)/Applications:
135136

136137
$(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
137138

138-
$(OSX_DMG): $(APP_DIST_EXTRAS)
139-
$(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -apple -o $@ dist
139+
.INTERMEDIATE: $(OSX_TEMP_ISO)
140+
$(OSX_TEMP_ISO): $(APP_DIST_EXTRAS)
141+
$(XORRISOFS) -D -l -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -o $@ dist
142+
143+
$(OSX_DMG): $(OSX_TEMP_ISO)
144+
$(DMG) dmg "$<" "$@"
140145

141146
dpi%.$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_SVG)
142147
sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d $* -p $* | $(IMAGEMAGICK_CONVERT) - $@

ci/test/00_setup_env_mac.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export LC_ALL=C.UTF-8
99
export CONTAINER_NAME=ci_macos_cross
1010
export DOCKER_NAME_TAG=ubuntu:18.04 # Check that bionic can cross-compile to macos (bionic is used in the gitian build as well)
1111
export HOST=x86_64-apple-darwin18
12-
export PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python3-dev python3-setuptools"
12+
export PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python3-dev python3-setuptools xorriso"
1313
export XCODE_VERSION=11.3.1
1414
export XCODE_BUILD_ID=11C505
1515
export RUN_UNIT_TESTS=false

configure.ac

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,8 @@ case $host in
675675
AC_PATH_TOOL([DSYMUTIL], [dsymutil], dsymutil)
676676
AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], install_name_tool)
677677
AC_PATH_TOOL([OTOOL], [otool], otool)
678-
AC_PATH_PROGS([GENISOIMAGE], [genisoimage mkisofs],genisoimage)
678+
AC_PATH_PROGS([XORRISOFS], [xorrisofs], xorrisofs)
679+
AC_PATH_PROGS([DMG], [dmg], dmg)
679680
AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg],rsvg-convert)
680681
AC_PATH_PROGS([IMAGEMAGICK_CONVERT], [convert],convert)
681682
AC_PATH_PROGS([TIFFCP], [tiffcp],tiffcp)

contrib/gitian-descriptors/gitian-osx-signer.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ architectures:
77
- "amd64"
88
packages:
99
- "faketime"
10+
- "xorriso"
1011
remotes:
1112
- "url": "https://github.com/bitcoin-core/bitcoin-detached-sigs.git"
1213
"dir": "signature"
@@ -18,7 +19,7 @@ script: |
1819
WRAP_DIR=$HOME/wrapped
1920
mkdir -p ${WRAP_DIR}
2021
export PATH="$PWD":$PATH
21-
FAKETIME_PROGS="dmg genisoimage"
22+
FAKETIME_PROGS="dmg xorrisofs"
2223
2324
# Create global faketime wrappers
2425
for prog in ${FAKETIME_PROGS}; do
@@ -36,5 +37,5 @@ script: |
3637
tar -xf ${UNSIGNED}
3738
OSX_VOLNAME="$(cat osx_volname)"
3839
./detached-sig-apply.sh ${UNSIGNED} signature/osx
39-
${WRAP_DIR}/genisoimage -no-cache-inodes -D -l -probe -V "${OSX_VOLNAME}" -no-pad -r -dir-mode 0755 -apple -o uncompressed.dmg signed-app
40+
${WRAP_DIR}/xorrisofs -D -l -V "${OSX_VOLNAME}" -no-pad -r -dir-mode 0755 -o uncompressed.dmg signed-app
4041
${WRAP_DIR}/dmg dmg uncompressed.dmg ${OUTDIR}/${SIGNED}

contrib/gitian-descriptors/gitian-osx.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ packages:
2828
- "python3-dev"
2929
- "python3-setuptools"
3030
- "fonts-tuffy"
31+
- "xorriso"
3132
remotes:
3233
- "url": "https://github.com/bitcoin/bitcoin.git"
3334
"dir": "bitcoin"
@@ -38,9 +39,9 @@ script: |
3839
3940
WRAP_DIR=$HOME/wrapped
4041
HOSTS="x86_64-apple-darwin18"
41-
CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests GENISOIMAGE=$WRAP_DIR/genisoimage"
42+
CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests XORRISOFS=${WRAP_DIR}/xorrisofs DMG=${WRAP_DIR}/dmg"
4243
FAKETIME_HOST_PROGS=""
43-
FAKETIME_PROGS="ar ranlib date dmg genisoimage"
44+
FAKETIME_PROGS="ar ranlib date dmg xorrisofs"
4445
4546
export QT_RCC_TEST=1
4647
export QT_RCC_SOURCE_DATE_OVERRIDE=1
@@ -132,21 +133,19 @@ script: |
132133
133134
make osx_volname
134135
make deploydir
135-
OSX_VOLNAME="$(cat osx_volname)"
136136
mkdir -p unsigned-app-${i}
137137
cp osx_volname unsigned-app-${i}/
138138
cp contrib/macdeploy/detached-sig-apply.sh unsigned-app-${i}
139139
cp contrib/macdeploy/detached-sig-create.sh unsigned-app-${i}
140-
cp ${BASEPREFIX}/${i}/native/bin/dmg ${BASEPREFIX}/${i}/native/bin/genisoimage unsigned-app-${i}
140+
cp ${BASEPREFIX}/${i}/native/bin/dmg unsigned-app-${i}
141141
cp ${BASEPREFIX}/${i}/native/bin/${i}-codesign_allocate unsigned-app-${i}/codesign_allocate
142142
cp ${BASEPREFIX}/${i}/native/bin/${i}-pagestuff unsigned-app-${i}/pagestuff
143143
mv dist unsigned-app-${i}
144144
pushd unsigned-app-${i}
145145
find . | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-osx-unsigned.tar.gz
146146
popd
147147
148-
make deploy
149-
${WRAP_DIR}/dmg dmg "${OSX_VOLNAME}.dmg" ${OUTDIR}/${DISTNAME}-osx-unsigned.dmg
148+
make deploy OSX_DMG="${OUTDIR}/${DISTNAME}-osx-unsigned.dmg"
150149
151150
cd installed
152151
find . -name "lib*.la" -delete

contrib/macdeploy/README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,15 @@ created using these tools. The build process has been designed to avoid includin
9292
SDK's files in Gitian's outputs. All interim tarballs are fully deterministic and may be freely
9393
redistributed.
9494

95-
`genisoimage` is used to create the initial DMG. It is not deterministic as-is, so it has been
96-
patched. A system `genisoimage` will work fine, but it will not be deterministic because
97-
the file-order will change between invocations. The patch can be seen here: [cdrkit-deterministic.patch](https://github.com/bitcoin/bitcoin/blob/master/depends/patches/native_cdrkit/cdrkit-deterministic.patch).
98-
No effort was made to fix this cleanly, so it likely leaks memory badly, however it's only used for
99-
a single invocation, so that's no real concern.
95+
[`xorrisofs`](https://www.gnu.org/software/xorriso/) is used to create the DMG.
10096

101-
`genisoimage` cannot compress DMGs, so afterwards, the DMG tool from the
102-
`libdmg-hfsplus` project is used to compress it. There are several bugs in this tool and its
103-
maintainer has seemingly abandoned the project.
97+
`xorrisofs` cannot compress DMGs, so afterwards, the DMG tool from the
98+
`libdmg-hfsplus` project is used to compress it. There are several bugs in this
99+
tool and its maintainer has seemingly abandoned the project.
104100

105101
The DMG tool has the ability to create DMGs from scratch as well, but this functionality is
106102
broken. Only the compression feature is currently used. Ideally, the creation could be fixed
107-
and `genisoimage` would no longer be necessary.
103+
and `xorrisofs` would no longer be necessary.
108104

109105
Background images and other features can be added to DMG files by inserting a
110106
`.DS_Store` during creation.

depends/packages/native_cdrkit.mk

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

depends/packages/packages.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ darwin_native_packages = native_ds_store native_mac_alias
2525
$(host_arch)_$(host_os)_native_packages += native_b2
2626

2727
ifneq ($(build_os),darwin)
28-
darwin_native_packages += native_cctools native_cdrkit native_libdmg-hfsplus
28+
darwin_native_packages += native_cctools native_libdmg-hfsplus
2929
endif

depends/patches/native_cdrkit/cdrkit-deterministic.patch

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

0 commit comments

Comments
 (0)