Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RISC-V build and fix error in actions #1400

Merged
merged 2 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions .github/workflows/android-release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Android-Release

on:
schedule:
# scheduled to run UTC 22:00 (07:00 in South Korea), Every 1st of the month
- cron: '0 22 1 * *'
workflow_dispatch:
push:
tags:
- "v*.*.*"

jobs:
build-android-on-ubuntu:
Expand Down Expand Up @@ -37,14 +36,17 @@ jobs:
./build/android/escargot/build/**/escargot-*.jar
!./build/android/escargot/build/**/escargot-*Shell.aar
if-no-files-found: error
overwrite: true

build-android-on-macos:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Packages
run: |
brew update
brew install ninja pkg-config icu4c
- name: Set up JDK
uses: actions/[email protected]
with:
Expand All @@ -65,9 +67,8 @@ jobs:
path: |
./build/android/escargot/build/libs/escargot-mac.jar
if-no-files-found: error
overwrite: true

merge-upload-release:
merge-update-release:
needs: [build-android-on-ubuntu, build-android-on-macos]
runs-on: ubuntu-latest
steps:
Expand All @@ -88,12 +89,9 @@ jobs:
find . -type f -name "escargot-*.aar" -exec mv {} . \;
find . -type f -name "escargot-*.jar" -exec mv {} . \;
ls -R ./
- name: Upload final artifacts
uses: actions/upload-artifact@v4
find ./ -type f -name "escargot-*.aar" -o -name "escargot-*.jar" | zip Android-Release-${{ env.RELEASE_DATE }}.zip -@
- name: Upload to release
uses: softprops/action-gh-release@v2
with:
name: Android-Release-${{ env.RELEASE_DATE }}
path: |
./artifacts/escargot-*.aar
./artifacts/escargot-*.jar
if-no-files-found: error
overwrite: true
files: |
artifacts/Android-Release-${{ env.RELEASE_DATE }}.zip
36 changes: 30 additions & 6 deletions .github/workflows/es-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ jobs:
- name: Install Packages
run: |
brew update
brew install ninja pkg-config icu4c@75
brew install ninja pkg-config icu4c
- name: Build x64
env:
BUILD_OPTIONS: -DESCARGOT_WASM=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
run: |
# check cpu
sysctl -a | grep machdep.cpu
# add icu path to pkg_config_path
brew --prefix icu4c@75
export PKG_CONFIG_PATH="/usr/local/opt/icu4c@75/lib/pkgconfig:$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH="$(brew --prefix icu4c)/lib/pkgconfig"
echo $PKG_CONFIG_PATH
cmake -H. -Bout/debug/ -DESCARGOT_MODE=debug $BUILD_OPTIONS
ninja -Cout/debug/
$RUNNER --engine="./out/debug/escargot" new-es
Expand All @@ -61,16 +61,16 @@ jobs:
- name: Install Packages
run: |
brew update
brew install ninja pkg-config icu4c@75
brew install ninja pkg-config icu4c
- name: Build arm64
env:
BUILD_OPTIONS: -DESCARGOT_WASM=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
run: |
# check cpu
sysctl -a | grep machdep.cpu
# add icu path to pkg_config_path
brew --prefix icu4c@75
export PKG_CONFIG_PATH="/opt/homebrew/opt/icu4c@75/lib/pkgconfig:$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH="$(brew --prefix icu4c)/lib/pkgconfig"
echo $PKG_CONFIG_PATH
cmake -H. -Bout/debug/ -DESCARGOT_MODE=debug $BUILD_OPTIONS
ninja -Cout/debug/
$RUNNER --engine="./out/debug/escargot" new-es
Expand Down Expand Up @@ -437,6 +437,30 @@ jobs:
run: |
GC_FREE_SPACE_DIVISOR=1 $RUNNER --engine="${{ github.workspace }}/out/escargot" --test262-extra-arg="--skip intl402" test262 chakracore spidermonkey v8 new-es

build-test-on-riscv64-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build in riscv64 container
uses: uraimo/[email protected]
with:
arch: riscv64
distro: ubuntu22.04

# Install deps into the container. With the token, the container will be cached
# The image is cached publically like a package
githubToken: ${{ github.token }}

install: |
apt-get update
apt-get install -y cmake build-essential ninja-build pkg-config python3 git libicu-dev
run: |
cmake -H. -Bout/riscv64 -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
ninja -Cout/riscv64
python3 ./tools/run-tests.py --engine="./out/riscv64/escargot" regression-tests new-es intl sunspider-js

build-test-debugger:
runs-on: ubuntu-latest
steps:
Expand Down
45 changes: 13 additions & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:
- name: Install Packages
run: |
brew update
brew install ninja icu4c@75
brew install ninja icu4c
- name: Build x64
run: |
# check cpu
sysctl -a | grep machdep.cpu
# add icu path to pkg_config_path
brew --prefix icu4c@75
export PKG_CONFIG_PATH="/usr/local/opt/icu4c@75/lib/pkgconfig:$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH="$(brew --prefix icu4c)/lib/pkgconfig"
echo $PKG_CONFIG_PATH
cmake -H. -Bout/ $BUILD_OPTIONS
ninja -Cout/
- name: Check
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Upload
uses: actions/upload-artifact@v4
with:
name: mac64-result
name: build-artifact-mac64
path: out/escargot-mac64

build-mac64arm:
Expand All @@ -50,14 +50,14 @@ jobs:
- name: Install Packages
run: |
brew update
brew install ninja icu4c@75
brew install ninja icu4c
- name: Build arm64
run: |
# check cpu
sysctl -a | grep machdep.cpu
# add icu path to pkg_config_path
brew --prefix icu4c@75
export PKG_CONFIG_PATH="/opt/homebrew/opt/icu4c@75/lib/pkgconfig:$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH="$(brew --prefix icu4c)/lib/pkgconfig"
echo $PKG_CONFIG_PATH
cmake -H. -Bout/ $BUILD_OPTIONS
ninja -Cout/
- name: Check
Expand All @@ -69,7 +69,7 @@ jobs:
- name: Upload
uses: actions/upload-artifact@v4
with:
name: mac64arm-result
name: build-artifact-mac64arm
path: out/escargot-mac64arm

build-windows:
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
- name: Upload
uses: actions/upload-artifact@v4
with:
name: win-${{ matrix.arch }}-result
name: build-artifact-win-${{ matrix.arch }}
path: out\escargot-win-${{ matrix.arch }}.exe

build-linux:
Expand Down Expand Up @@ -155,38 +155,19 @@ jobs:
- name: Upload
uses: actions/upload-artifact@v4
with:
name: linux-result
name: build-artifact-linux
path: out/escargot-linux-*

update-release:
needs: [build-mac64, build-mac64arm, build-windows, build-linux]
runs-on: ubuntu-latest
steps:
- name: Download mac64 result
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: mac64-result
path: artifacts
- name: Download mac64arm result
uses: actions/download-artifact@v4
with:
name: mac64arm-result
path: artifacts
- name: Download win32 result
uses: actions/download-artifact@v4
with:
name: win-x86-result
path: artifacts
- name: Download win64 result
uses: actions/download-artifact@v4
with:
name: win-x64-result
path: artifacts
- name: Download linux result
uses: actions/download-artifact@v4
with:
name: linux-result
path: artifacts
pattern: build-artifact-*
merge-multiple: true
- name: Upload to release
uses: softprops/action-gh-release@v2
with:
Expand Down
13 changes: 11 additions & 2 deletions build/android/escargot/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,17 @@ task buildCMakeNativeNoNDK(type: Exec) {
}
os.toString().trim()
}
environment("PKG_CONFIG_PATH", "/usr/local/opt/icu4c/lib/pkgconfig")
commandLine "/usr/bin/env", "cmake", "-DESCARGOT_HOST=darwin", "-DESCARGOT_ARCH=x64", "-DESCARGOT_OUTPUT=static_lib", "-DUNDER_NDK=OFF", "-DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF",
var icu4cPath = new ByteArrayOutputStream().withStream { os ->
exec {
commandLine "sh", "-c", "brew --prefix icu4c"
standardOutput = os
}
os.toString().trim()
}
var pkgConfigPath = icu4cPath + "/lib/pkgconfig"
environment("PKG_CONFIG_PATH", pkgConfigPath)
commandLine "/usr/bin/env", "cmake", "-DESCARGOT_HOST=darwin", "-DESCARGOT_ARCH=x64", "-DESCARGOT_OUTPUT=static_lib", "-DUNDER_NDK=OFF",
"-DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF",
"-DJAVA_HOME=" + javaHome, "-DJAVA_INCLUDE_PATH=" + javaHome + "/include",
"-DJAVA_INCLUDE_PATH2=" + javaHome + "/include/darwin", "-DJAVA_AWT_INCLUDE_PATH=" + javaHome + "/include",
srcForNativeNoNDK.absolutePath
Expand Down
Loading