From d41a1c413d9d9839e061538f72a43f2c9128f16c Mon Sep 17 00:00:00 2001 From: "Lauren N. Liberda" Date: Mon, 24 Apr 2023 18:57:00 +0200 Subject: [PATCH] Add riscv64 builds Closes https://github.com/dart-musl/dart/pull/4 --- .github/workflows/build.yml | 37 ++++++++++++++++++++++++++++++++++- .github/workflows/release.yml | 6 ++++++ Dockerfile | 2 ++ 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c36183b..23c0fd7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 ' -- 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: | @@ -104,6 +131,8 @@ jobs: target-arch: arm64 - host-arch: x64 target-arch: arm + - host-arch: x64 + target-arch: riscv64 steps: - name: Download Artifact @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95fcb35..877a1b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: @@ -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] diff --git a/Dockerfile b/Dockerfile index 4267fb9..b357c24 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \