Skip to content

Commit f58e4a6

Browse files
guix: support PLATFORM_GUI=1 release builds
Guix builds accept a PLATFORM_GUI knob: guix-build prefetches the Rust standard libraries and the platform_cxx vendored-crates archive outside the offline container (they are host-independent and need network and git access), and passes the knob through to the containerized depends build. The manifest gains patchelf and zlib for the prebuilt Rust toolchain and lbzip2 for bzip2 depends archives. The Guix workflow gains workflow_dispatch with host and platform_gui inputs so a single-host Platform build can be exercised on demand; scheduled and tag builds are unchanged and never set the knob.
1 parent d2c5ead commit f58e4a6

5 files changed

Lines changed: 31 additions & 5 deletions

File tree

‎.github/workflows/guix-build.yml‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,26 @@ on:
1212
schedule:
1313
# Run weekly at 3 AM UTC on Sunday on the default branch
1414
- cron: '0 3 * * 0'
15+
workflow_dispatch:
16+
inputs:
17+
hosts:
18+
description: 'Host triplet to build (single host)'
19+
required: false
20+
default: 'x86_64-linux-gnu'
21+
platform_gui:
22+
description: 'Build with PLATFORM_GUI=1 (Platform GUI + vendored Rust crates)'
23+
type: boolean
24+
required: false
25+
default: false
1526

1627
jobs:
1728
build-image:
1829
runs-on: ubuntu-24.04-arm
1930
if: |
2031
(github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || vars.RUN_GUIX_ON_ALL_PUSH == 'true')) ||
2132
contains(github.event.pull_request.labels.*.name, 'guix-build') ||
22-
github.event_name == 'schedule'
33+
github.event_name == 'schedule' ||
34+
github.event_name == 'workflow_dispatch'
2335
outputs:
2436
image-tag: ${{ steps.prepare.outputs.image-tag }}
2537
repo-name: ${{ steps.prepare.outputs.repo-name }}
@@ -77,7 +89,7 @@ jobs:
7789
runs-on: ubuntu-24.04-arm
7890
strategy:
7991
matrix:
80-
build_target: [x86_64-linux-gnu, aarch64-linux-gnu, riscv64-linux-gnu, powerpc64-linux-gnu, x86_64-w64-mingw32, x86_64-apple-darwin, arm64-apple-darwin]
92+
build_target: ${{ github.event_name == 'workflow_dispatch' && fromJSON(format('["{0}"]', inputs.hosts)) || fromJSON('["x86_64-linux-gnu", "aarch64-linux-gnu", "riscv64-linux-gnu", "powerpc64-linux-gnu", "x86_64-w64-mingw32", "x86_64-apple-darwin", "arm64-apple-darwin"]') }}
8193

8294
timeout-minutes: 480
8395
steps:
@@ -98,7 +110,7 @@ jobs:
98110
uses: actions/cache@v5
99111
with:
100112
path: dash/depends/sources
101-
key: depends-sources-${{ hashFiles('dash/depends/packages/*') }}
113+
key: depends-sources-${{ hashFiles('dash/depends/packages/*', 'dash/depends/patches/platform_cxx/cargo-config.toml') }}
102114
restore-keys: |
103115
depends-sources-
104116
@@ -129,7 +141,7 @@ jobs:
129141
-v ${{ github.workspace }}/.cache:/home/ubuntu/.cache \
130142
-w /src/dash \
131143
ghcr.io/${{ needs.build-image.outputs.repo-name }}/dashcore-guix-builder:${{ needs.build-image.outputs.image-tag }} && \
132-
docker exec guix-daemon bash -c 'HOSTS=${{ matrix.build_target }} /usr/local/bin/guix-start /src/dash'
144+
docker exec guix-daemon bash -c 'HOSTS=${{ matrix.build_target }} PLATFORM_GUI=${{ inputs.platform_gui && '1' || '' }} /usr/local/bin/guix-start /src/dash'
133145
134146
- name: Ensure build passes
135147
run: |

‎contrib/containers/guix/scripts/guix-start‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ fi
2626
cd "${WORKSPACE_PATH}"
2727
git status >> /dev/null
2828

29+
export PLATFORM_GUI="${PLATFORM_GUI:-}"
30+
2931
export HOSTS="${HOSTS:-x86_64-linux-gnu aarch64-linux-gnu riscv64-linux-gnu
3032
x86_64-w64-mingw32
3133
x86_64-apple-darwin arm64-apple-darwin}"

‎contrib/guix/guix-build‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,16 @@ mkdir -p "$OUTDIR_BASE"
302302
# Download the depends sources now as we won't have internet access in the build
303303
# container
304304
for host in $HOSTS; do
305-
make -C "${PWD}/depends" -j"$JOBS" download-"$(host_to_commonname "$host")" ${V:+V=1} ${SOURCES_PATH:+SOURCES_PATH="$SOURCES_PATH"}
305+
make -C "${PWD}/depends" -j"$JOBS" download-"$(host_to_commonname "$host")" ${V:+V=1} ${PLATFORM_GUI:+PLATFORM_GUI=1} ${SOURCES_PATH:+SOURCES_PATH="$SOURCES_PATH"}
306306
done
307307

308+
# Rust standard libraries and vendored crates are host-independent and need
309+
# network (and git) access, so they must be fetched once out here as well —
310+
# the build container is offline.
311+
if [ -n "${PLATFORM_GUI}" ]; then
312+
make -C "${PWD}/depends" -j"$JOBS" PLATFORM_GUI=1 download-rust-std vendor-dep-crates ${V:+V=1} ${SOURCES_PATH:+SOURCES_PATH="$SOURCES_PATH"}
313+
fi
314+
308315
# Usage: outdir_for_host HOST SUFFIX
309316
#
310317
# HOST: The current platform triple we're building for
@@ -466,6 +473,7 @@ EOF
466473
${SOURCES_PATH:+SOURCES_PATH="$SOURCES_PATH"} \
467474
${BASE_CACHE:+BASE_CACHE="$BASE_CACHE"} \
468475
${SDK_PATH:+SDK_PATH="$SDK_PATH"} \
476+
${PLATFORM_GUI:+PLATFORM_GUI=1} \
469477
DISTSRC="$(DISTSRC_BASE=/distsrc-base && distsrc_for_host "$HOST")" \
470478
OUTDIR="$(OUTDIR_BASE=/outdir-base && outdir_for_host "$HOST")" \
471479
DIST_ARCHIVE_BASE=/outdir-base/dist-archive \

‎contrib/guix/libexec/build.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ export TZ="UTC"
173173
# Build the depends tree, overriding variables that assume multilib gcc
174174
make -C depends --jobs="$JOBS" HOST="$HOST" \
175175
${V:+V=1} \
176+
${PLATFORM_GUI:+PLATFORM_GUI=1} \
176177
${SOURCES_PATH+SOURCES_PATH="$SOURCES_PATH"} \
177178
${BASE_CACHE+BASE_CACHE="$BASE_CACHE"} \
178179
${SDK_PATH+SDK_PATH="$SDK_PATH"} \

‎contrib/guix/manifest.scm‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
((gnu packages certs) #:select (nss-certs))
66
((gnu packages check) #:select (libfaketime))
77
((gnu packages cmake) #:select (cmake-minimal))
8+
((gnu packages elf) #:select (patchelf))
89
(gnu packages commencement)
910
(gnu packages compression)
1011
(gnu packages cross-base)
@@ -534,6 +535,8 @@ inspecting signatures in Mach-O binaries.")
534535
autoconf-2.71
535536
automake
536537
pkg-config
538+
patchelf
539+
zlib
537540
;; Scripting
538541
python-minimal ;; (3.10)
539542
;; Git

0 commit comments

Comments
 (0)