91
91
# ###############
92
92
93
93
# Default to building for all supported HOSTs (overridable by environment)
94
- export HOSTS=" ${HOSTS:- x86_64-w64-mingw32 x86_64-apple-darwin arm64-apple-darwin } "
94
+ export HOSTS=" ${HOSTS:- x86_64-w64-mingw32 x86_64-w64-mingw32.installer } "
95
95
96
96
# Usage: distsrc_for_host HOST
97
97
#
@@ -149,13 +149,13 @@ outdir_for_host() {
149
149
}
150
150
151
151
152
- unsigned_tarball_for_host () {
152
+ unsigned_file_for_host () {
153
153
case " $1 " in
154
- * mingw* )
155
- echo " $( outdir_for_host " $1 " ) /${DISTNAME} -win64- unsigned.tar.gz "
154
+ * mingw.installer )
155
+ echo " $( outdir_for_host " $1 " ) /FeatherWalletSetup- ${DISTNAME} -unsigned.exe "
156
156
;;
157
- * darwin * )
158
- echo " $( outdir_for_host " $1 " ) /${DISTNAME} -${1} - unsigned.tar.gz "
157
+ * mingw * )
158
+ echo " $( outdir_for_host " $1 " ) /${DISTNAME} -unsigned.exe "
159
159
;;
160
160
* )
161
161
exit 1
@@ -164,22 +164,22 @@ unsigned_tarball_for_host() {
164
164
}
165
165
166
166
# Accumulate a list of build directories that already exist...
167
- hosts_unsigned_tarball_missing =" "
167
+ hosts_file_tarball_missing =" "
168
168
for host in $HOSTS ; do
169
- if [ ! -e " $( unsigned_tarball_for_host " $host " ) " ]; then
170
- hosts_unsigned_tarball_missing +=" ${host} "
169
+ if [ ! -e " $( unsigned_file_for_host " $host " ) " ]; then
170
+ hosts_file_tarball_missing +=" ${host} "
171
171
fi
172
172
done
173
173
174
- if [ -n " $hosts_unsigned_tarball_missing " ]; then
174
+ if [ -n " $hosts_file_tarball_missing " ]; then
175
175
# ...so that we can print them out nicely in an error message
176
176
cat << EOF
177
- ERR: Unsigned tarballs do not exist
177
+ ERR: Unsigned files do not exist
178
178
...
179
179
180
180
EOF
181
- for host in $hosts_unsigned_tarball_missing ; do
182
- echo " ${host} '$( unsigned_tarball_for_host " $host " ) '"
181
+ for host in $hosts_file_tarball_missing ; do
182
+ echo " ${host} '$( unsigned_file_for_host " $host " ) '"
183
183
done
184
184
exit 1
185
185
fi
@@ -256,7 +256,6 @@ output directory.
256
256
EOF
257
257
}
258
258
259
- # Deterministically build Bitcoin Core
260
259
# shellcheck disable=SC2153
261
260
for host in $HOSTS ; do
262
261
@@ -282,66 +281,6 @@ INFO: Codesigning ${VERSION:?not set} for platform triple ${HOST:?not set}:
282
281
...bind-mounted in container to: '/detached-sigs'
283
282
EOF
284
283
285
-
286
- # Run the build script 'contrib/guix/libexec/build.sh' in the build
287
- # container specified by 'contrib/guix/manifest.scm'.
288
- #
289
- # Explanation of `guix shell` flags:
290
- #
291
- # --container run command within an isolated container
292
- #
293
- # Running in an isolated container minimizes build-time differences
294
- # between machines and improves reproducibility
295
- #
296
- # --pure unset existing environment variables
297
- #
298
- # Same rationale as --container
299
- #
300
- # --no-cwd do not share current working directory with an
301
- # isolated container
302
- #
303
- # When --container is specified, the default behavior is to share
304
- # the current working directory with the isolated container at the
305
- # same exact path (e.g. mapping '/home/satoshi/bitcoin/' to
306
- # '/home/satoshi/bitcoin/'). This means that the $PWD inside the
307
- # container becomes a source of irreproducibility. --no-cwd disables
308
- # this behaviour.
309
- #
310
- # --share=SPEC for containers, share writable host file system
311
- # according to SPEC
312
- #
313
- # --share="$PWD"=/bitcoin
314
- #
315
- # maps our current working directory to /bitcoin
316
- # inside the isolated container, which we later cd
317
- # into.
318
- #
319
- # While we don't want to map our current working directory to the
320
- # same exact path (as this introduces irreproducibility), we do want
321
- # it to be at a _fixed_ path _somewhere_ inside the isolated
322
- # container so that we have something to build. '/bitcoin' was
323
- # chosen arbitrarily.
324
- #
325
- # ${SOURCES_PATH:+--share="$SOURCES_PATH"}
326
- #
327
- # make the downloaded depends sources path available
328
- # inside the isolated container
329
- #
330
- # The isolated container has no network access as it's in a
331
- # different network namespace from the main machine, so we have to
332
- # make the downloaded depends sources available to it. The sources
333
- # should have been downloaded prior to this invocation.
334
- #
335
- # ${SUBSTITUTE_URLS:+--substitute-urls="$SUBSTITUTE_URLS"}
336
- #
337
- # fetch substitute from SUBSTITUTE_URLS if they are
338
- # authorized
339
- #
340
- # Depending on the user's security model, it may be desirable to use
341
- # substitutes (pre-built packages) from servers that the user trusts.
342
- # Please read the README.md in the same directory as this file for
343
- # more information.
344
- #
345
284
# shellcheck disable=SC2086,SC2031
346
285
time-machine shell --manifest=" ${PWD} /contrib/guix/manifest.scm" \
347
286
--container \
@@ -358,11 +297,13 @@ EOF
358
297
--keep-failed \
359
298
--fallback \
360
299
--link-profile \
300
+ --user=" user" \
361
301
--root=" $( profiledir_for_host " ${HOST} " codesigned) " \
362
302
${SUBSTITUTE_URLS: +--substitute-urls=" $SUBSTITUTE_URLS " } \
363
303
${ADDITIONAL_GUIX_COMMON_FLAGS} ${ADDITIONAL_GUIX_ENVIRONMENT_FLAGS} \
364
304
-- env HOST=" $host " \
365
305
DISTNAME=" $DISTNAME " \
306
+ VERSION=" $VERSION " \
366
307
JOBS=" $JOBS " \
367
308
SOURCE_DATE_EPOCH=" ${SOURCE_DATE_EPOCH:? unable to determine value} " \
368
309
${V: +V=1} \
371
312
OUTDIR=" $( OUTDIR_BASE=/outdir-base && outdir_for_host " $HOST " codesigned) " \
372
313
DIST_ARCHIVE_BASE=/outdir-base/dist-archive \
373
314
GUIX_SIGS_REPO=/detached-sigs \
374
- UNSIGNED_TARBALL=" $( OUTDIR_BASE=/outdir-base && unsigned_tarball_for_host " $HOST " ) " \
315
+ UNSIGNED_TARBALL=" $( OUTDIR_BASE=/outdir-base && unsigned_file_for_host " $HOST " ) " \
375
316
bash -c " cd /bitcoin && bash contrib/guix/libexec/codesign.sh"
376
317
)
377
318
0 commit comments