Skip to content

Commit 84ededd

Browse files
authored
Use musl support in cli_pkg (#2172)
1 parent 00571ec commit 84ededd

File tree

2 files changed

+6
-27
lines changed

2 files changed

+6
-27
lines changed

.github/workflows/build-linux-musl.yml

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ jobs:
2020
platform: linux/386
2121
- arch: arm64
2222
platform: linux/arm64
23+
# There is a bug in qemu's mremap causing pthread_getattr_np in musl to stuck in a loop on arm.
24+
# Unless qemu fixes the bug or we get a real linux-arm runner, we cannot build aot-snapshot
25+
# for arm on CI. So, we create a kernel snapshot for arm build in amd64 container instead.
26+
# https://gitlab.com/qemu-project/qemu/-/issues/1729
2327
- arch: arm
24-
platform: linux/arm/v7
28+
platform: linux/amd64 # linux/arm/v7
2529

2630
steps:
2731
- uses: actions/checkout@v4
@@ -41,11 +45,6 @@ jobs:
4145
dart run grinder protobuf
4246
EOF
4347
44-
# https://gitlab.com/qemu-project/qemu/-/issues/1729
45-
#
46-
# There is a bug in qemu's mremap causing pthread_getattr_np in musl to stuck in a loop on arm.
47-
# Unless qemu fixes the bug or we get a real linux-arm runner, we cannot build aot-snapshot
48-
# for arm on CI. So, we create a kernel snapshot for arm build in amd64 container instead.
4948
- name: Build
5049
run: |
5150
docker run --rm -i \
@@ -60,26 +59,6 @@ jobs:
6059
find build -name '*.tar.gz' -print0 | xargs -0 -n 1 -- sh -xc 'mv "$1" "$(echo "$1" | sed -e "s/linux/linux-musl/")"' --
6160
EOF
6261
63-
# The kernel snapshot created for arm in the previous step is bundling a glibc based dart runtime
64-
# due to how cli_pkg downloads the sdk for building non-native platforms. Therefore we need to
65-
# replace it with musl-libc based dart runtime to create a working linux-musl-arm package.
66-
- name: Fix Dart Runtime
67-
if: matrix.arch == 'arm'
68-
run: |
69-
docker run --rm -i \
70-
--platform ${{ matrix.platform }} \
71-
--volume $PWD:$PWD \
72-
--workdir $PWD \
73-
ghcr.io/dart-musl/dart <<'EOF'
74-
set -e
75-
apk add --no-cache tar
76-
cd build
77-
DART_RUNTIME=$(tar -tzf *.tar.gz --wildcards "*/src/dart")
78-
tar -xzf *.tar.gz
79-
cp $DART_SDK/bin/dart $DART_RUNTIME
80-
tar -czf *.tar.gz "$(dirname "$(dirname "$DART_RUNTIME")")"
81-
EOF
82-
8362
- name: Upload Artifact
8463
uses: actions/upload-artifact@v4
8564
with:

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies:
1414
args: ^2.0.0
1515
async: ^2.5.0
1616
charcode: ^1.2.0
17-
cli_pkg: ^2.7.1
17+
cli_pkg: ^2.8.0
1818
cli_repl: ^0.2.1
1919
collection: ^1.16.0
2020
http: "^1.1.0"

0 commit comments

Comments
 (0)