Skip to content

Commit e7b57f6

Browse files
authored
i#7284: Bootstrap Alpine build environment from minirootfs in workflow (#7289)
Previously, the build environment is bootstrapped with a static version of apk downloaded from Alpine mirror, whose URL isn't stable since the package is upgraded irregularly. This commit switches to prebuilt minirootfs tarball, which is considered as release artifacts and has a stable URL, saving the burden of frequently synchronizing with Alpine upstream. Fixes: #7284
1 parent f7d1766 commit e7b57f6

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

.github/workflows/ci-x86.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -264,30 +264,30 @@ jobs:
264264
# Create an Alpine Linux 3.21.2 chroot environment for building
265265
- name: Create Build Environment
266266
run: |
267-
curl -L https://dl-cdn.alpinelinux.org/v3.21/main/x86_64/apk-tools-static-2.14.6-r2.apk | \
268-
tar xzv sbin/apk.static
267+
sudo mkdir alpine-root
268+
curl -L https://dl-cdn.alpinelinux.org/v3.21/releases/x86_64/alpine-minirootfs-3.21.3-x86_64.tar.gz | \
269+
sudo tar xzv -C alpine-root
270+
271+
cd alpine-root
272+
sudo mount -o bind /dev/ dev
273+
sudo mount -t proc proc proc
274+
sudo mount -t sysfs sys sys
275+
sudo mount -o bind ${{ github.workspace }}/DynamoRIO root
276+
# Use host DNS configuration in the chroot environment
277+
sudo cp /etc/resolv.conf etc/
278+
279+
sudo chroot . sbin/apk upgrade
269280
270-
sudo mkdir -p alpine-root/etc/apk
271-
echo "https://dl-cdn.alpinelinux.org/v3.21/main/" | \
272-
sudo tee alpine-root/etc/apk/repositories
273281
# Meta-package build-base simplifies dependencies, but it pulls in
274282
# fortify-headers. Alpine ships an out-of-date version whose headers
275283
# contain unnecessary includes, causing naming conflicts.
276284
# TODO i#1973: simplify dependency with build-base after fixing
277285
# the compatibility problem.
278-
# Supply --allow-untrusted since we're creating a rootfs from scratch
279-
# thus don't have any public key available.
280-
sudo sbin/apk.static -p alpine-root -U --initdb --allow-untrusted add \
286+
sudo chroot . sbin/apk add \
281287
alpine-base binutils bash cmake doxygen file g++ git libunwind-dev \
282288
lz4-dev lz4-static linux-headers make musl-dev musl-libintl perl \
283289
patch xz-dev zlib-dev zlib-static
284290
285-
cd alpine-root
286-
sudo mount -o bind /dev/ dev
287-
sudo mount -t proc proc proc
288-
sudo mount -t sysfs sys sys
289-
sudo mount -o bind ${{ github.workspace }}/DynamoRIO root
290-
291291
- name: Run Suite
292292
working-directory: ${{ github.workspace }}
293293
run: |

0 commit comments

Comments
 (0)