Skip to content

Commit

Permalink
Add riscv64 builds
Browse files Browse the repository at this point in the history
Closes #4
  • Loading branch information
selfisekai authored and ntkme committed Jun 13, 2023
1 parent d360c32 commit d41a1c4
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
37 changes: 36 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,33 @@ jobs:
python3 sdk/tools/generate_package_config.py
python3 sdk/tools/generate_sdk_version_file.py
- name: Patch Dart SDK 3.1.0-189.0.dev
if: inputs.ref == '3.1.0-189.0.dev'
run: |
cd dart-sdk/sdk
xargs -n 1 -- sh -xc 'curl -fsSL "https://github.com/dart-lang/sdk/commit/$1.diff" | git apply -' -- <<'EOF'
99c68b013bab3c574abe300d710d5bdf8f111c10
EOF
- name: Patch Dart SDK 3.0
run: |
cd dart-sdk/sdk
if ! grep -q alpine-linux-riscv64-sysroot build/config/sysroot.gni; then
xargs -n 1 -- sh -xc 'curl -fsSLo "$1" "https://github.com/dart-lang/sdk/raw/3.1.0-205.0.dev/$1"' -- <<'EOF'
build/config/sysroot.gni
build/linux/alpine_sysroot_scripts/install-sysroot.sh
EOF
chmod a+x build/linux/alpine_sysroot_scripts/install-sysroot.sh
fi
- name: Patch perfetto
run: |
cd dart-sdk/sdk
sed -i -e '/#define INCLUDE_PERFETTO_EXT_BASE_UUID_H_/a\
\
#include <stdint.h>' -- third_party/perfetto/include/perfetto/ext/base/uuid.h
cat third_party/perfetto/include/perfetto/ext/base/uuid.h
- name: Get Checked-in Dart SDK Version
id: version
run: |
Expand Down Expand Up @@ -104,6 +131,8 @@ jobs:
target-arch: arm64
- host-arch: x64
target-arch: arm
- host-arch: x64
target-arch: riscv64

steps:
- name: Download Artifact
Expand All @@ -130,11 +159,17 @@ jobs:
run: |
apk add --no-cache alpine-sdk bash clang curl gn lld llvm python3
- name: Install sysroot
- name: Install default sysroots
run: |
cd dart-sdk/sdk
./build/linux/alpine_sysroot_scripts/install-sysroot.sh
- name: Install riscv64 sysroot
if: matrix.target-arch == 'riscv64'
run: |
cd dart-sdk/sdk
./build/linux/alpine_sysroot_scripts/install-sysroot.sh riscv64
- name: Setup multiarch musl
run: |
cd dart-sdk/sdk
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ jobs:
with:
name: dartsdk-linux-arm-${{ github.ref_name }}

- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: dartsdk-linux-riscv64-${{ github.ref_name }}

- name: Release
uses: softprops/action-gh-release@v1
with:
Expand All @@ -49,6 +54,7 @@ jobs:
dartsdk-linux-ia32-release.tar.gz
dartsdk-linux-arm64-release.tar.gz
dartsdk-linux-arm-release.tar.gz
dartsdk-linux-riscv64-release.tar.gz
container:
needs: [release]
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ RUN apk add --no-cache \
SDK_ARCH=arm64;; \
armv7) \
SDK_ARCH=arm;; \
riscv64) \
SDK_ARCH=riscv64;; \
esac \
&& wget -O- "$BASEURL/dartsdk-linux-$SDK_ARCH-release.tar.gz" \
| tar -xz \
Expand Down

0 comments on commit d41a1c4

Please sign in to comment.