Skip to content

Commit d41a1c4

Browse files
selfisekaintkme
authored andcommitted
Add riscv64 builds
Closes #4
1 parent d360c32 commit d41a1c4

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

.github/workflows/build.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,33 @@ jobs:
4646
python3 sdk/tools/generate_package_config.py
4747
python3 sdk/tools/generate_sdk_version_file.py
4848
49+
- name: Patch Dart SDK 3.1.0-189.0.dev
50+
if: inputs.ref == '3.1.0-189.0.dev'
51+
run: |
52+
cd dart-sdk/sdk
53+
xargs -n 1 -- sh -xc 'curl -fsSL "https://github.com/dart-lang/sdk/commit/$1.diff" | git apply -' -- <<'EOF'
54+
99c68b013bab3c574abe300d710d5bdf8f111c10
55+
EOF
56+
57+
- name: Patch Dart SDK 3.0
58+
run: |
59+
cd dart-sdk/sdk
60+
if ! grep -q alpine-linux-riscv64-sysroot build/config/sysroot.gni; then
61+
xargs -n 1 -- sh -xc 'curl -fsSLo "$1" "https://github.com/dart-lang/sdk/raw/3.1.0-205.0.dev/$1"' -- <<'EOF'
62+
build/config/sysroot.gni
63+
build/linux/alpine_sysroot_scripts/install-sysroot.sh
64+
EOF
65+
chmod a+x build/linux/alpine_sysroot_scripts/install-sysroot.sh
66+
fi
67+
68+
- name: Patch perfetto
69+
run: |
70+
cd dart-sdk/sdk
71+
sed -i -e '/#define INCLUDE_PERFETTO_EXT_BASE_UUID_H_/a\
72+
\
73+
#include <stdint.h>' -- third_party/perfetto/include/perfetto/ext/base/uuid.h
74+
cat third_party/perfetto/include/perfetto/ext/base/uuid.h
75+
4976
- name: Get Checked-in Dart SDK Version
5077
id: version
5178
run: |
@@ -104,6 +131,8 @@ jobs:
104131
target-arch: arm64
105132
- host-arch: x64
106133
target-arch: arm
134+
- host-arch: x64
135+
target-arch: riscv64
107136

108137
steps:
109138
- name: Download Artifact
@@ -130,11 +159,17 @@ jobs:
130159
run: |
131160
apk add --no-cache alpine-sdk bash clang curl gn lld llvm python3
132161
133-
- name: Install sysroot
162+
- name: Install default sysroots
134163
run: |
135164
cd dart-sdk/sdk
136165
./build/linux/alpine_sysroot_scripts/install-sysroot.sh
137166
167+
- name: Install riscv64 sysroot
168+
if: matrix.target-arch == 'riscv64'
169+
run: |
170+
cd dart-sdk/sdk
171+
./build/linux/alpine_sysroot_scripts/install-sysroot.sh riscv64
172+
138173
- name: Setup multiarch musl
139174
run: |
140175
cd dart-sdk/sdk

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ jobs:
4040
with:
4141
name: dartsdk-linux-arm-${{ github.ref_name }}
4242

43+
- name: Download Artifact
44+
uses: actions/download-artifact@v3
45+
with:
46+
name: dartsdk-linux-riscv64-${{ github.ref_name }}
47+
4348
- name: Release
4449
uses: softprops/action-gh-release@v1
4550
with:
@@ -49,6 +54,7 @@ jobs:
4954
dartsdk-linux-ia32-release.tar.gz
5055
dartsdk-linux-arm64-release.tar.gz
5156
dartsdk-linux-arm-release.tar.gz
57+
dartsdk-linux-riscv64-release.tar.gz
5258
5359
container:
5460
needs: [release]

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ RUN apk add --no-cache \
1919
SDK_ARCH=arm64;; \
2020
armv7) \
2121
SDK_ARCH=arm;; \
22+
riscv64) \
23+
SDK_ARCH=riscv64;; \
2224
esac \
2325
&& wget -O- "$BASEURL/dartsdk-linux-$SDK_ARCH-release.tar.gz" \
2426
| tar -xz \

0 commit comments

Comments
 (0)