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

Launcher Native Image Build #970

Merged
merged 25 commits into from
Jul 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a5352fd
Add a simple native image build
radeusgd Jul 6, 2020
8c05625
Try setting up native image on CI
radeusgd Jul 6, 2020
08cafc7
Update CI
radeusgd Jul 6, 2020
0c75c0b
Fix platform dependent issues in CI
radeusgd Jul 6, 2020
2ab0756
Change params, add error on failure
radeusgd Jul 6, 2020
db17011
Add copyright notices and try using decline
radeusgd Jul 6, 2020
888824b
Actually use the pkg dependency
radeusgd Jul 6, 2020
947b4bf
Add version handling and manifest
radeusgd Jul 7, 2020
0d045af
Add a simple test
radeusgd Jul 7, 2020
0f2bf52
Update artifact names
radeusgd Jul 8, 2020
0359a24
Update docs and fix artifact name
radeusgd Jul 8, 2020
3a82ca9
Fix manifest name and mark a test as flaky
radeusgd Jul 8, 2020
ca11951
Clean CI code and add a doc
radeusgd Jul 8, 2020
a4b34cb
Fix paths and artifact names
radeusgd Jul 8, 2020
86b0eb9
Extract native image build task
radeusgd Jul 9, 2020
b8f1534
Improve git ref name inference
radeusgd Jul 9, 2020
3ac1b16
Extract version display to a common library
radeusgd Jul 9, 2020
7f90831
Make version also work as a flag
radeusgd Jul 9, 2020
ca02dea
Make buildinfo generator more stable
radeusgd Jul 9, 2020
b81d1b8
Describe the notice creation process
radeusgd Jul 9, 2020
be336f3
Move launcher
radeusgd Jul 9, 2020
29da101
Add missing licences to launcher distribution
radeusgd Jul 9, 2020
5caffbe
Fix a typo
radeusgd Jul 9, 2020
a7a2df5
Remove spurious flatc check
radeusgd Jul 9, 2020
91b7c0b
Remove flatc installation from launcher build
radeusgd Jul 9, 2020
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
133 changes: 126 additions & 7 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ on:
branches: [ "*" ]

env:
# Please ensure that this is in sync with graalAPIVersion in build.sbt
# Please ensure that this is in sync with graalVersion in build.sbt
graalVersion: 20.1.0
# Please ensure that this is in sync with javaVersion in build.sbt
javaVersion: java11
# Please ensure that this is in sync with project/build.properties
sbtVersion: 1.3.13
Expand Down Expand Up @@ -81,8 +82,6 @@ jobs:
# Tests
- name: Test Enso
run: sbt --no-colors test
- name: Benchmark the Parser
run: sbt -no-colors syntax/bench
- name: Check Runtime Benchmark Compilation
run: sbt -no-colors runtime/Benchmark/compile
- name: Check Language Server Benchmark Compilation
Expand Down Expand Up @@ -150,8 +149,10 @@ jobs:
run: sbt --no-colors project-manager/assembly
- name: Prepare Distribution
run: |
DIST_DIR=enso-$(./enso.jar --version --json | jq -r '.version')
mkdir $DIST_DIR
DIST_VERSION=$(./enso.jar --version --json | jq -r '.version')
DIST_ROOT=enso-engine-$DIST_VERSION
DIST_DIR=$DIST_ROOT/enso-$DIST_VERSION
mkdir -p $DIST_DIR
mkdir $DIST_DIR/component
cp runtime.jar $DIST_DIR/component
mv enso.jar $DIST_DIR/component
Expand All @@ -160,16 +161,22 @@ jobs:
cp -r distribution/bin $DIST_DIR/bin
chmod +x $DIST_DIR/bin/enso
chmod +x $DIST_DIR/bin/project-manager
echo ::set-env name=DIST_ROOT::$DIST_ROOT
echo ::set-env name=DIST_DIR::$DIST_DIR
- name: Build the Parser JS Bundle
run: sbt -no-colors syntaxJS/fullOptJS
- name: Build the Manifest
run: |
cp distribution/manifest.template.yml manifest.yml
echo "graal-vm-version: $graalVersion" >> manifest.yml
echo "graal-java-version: $javaVersion" >> manifest.yml

# Publish
- name: Publish the Distribution Artifact
uses: actions/[email protected]
with:
name: ${{ env.DIST_DIR }}
path: ${{ env.DIST_DIR }}
name: ${{ env.DIST_ROOT }}
path: ${{ env.DIST_ROOT }}
- name: Prepare the FlatBuffers Schemas for Upload
run: |
mkdir fbs-upload
Expand All @@ -189,6 +196,11 @@ jobs:
with:
name: Parser JS Bundle
path: ./target/scala-parser.js
- name: Publish the Manifest
uses: actions/upload-artifact@v2
with:
name: manifest
path: manifest.yml
- name: Prepare AWS Session
run: |
aws configure --profile s3-upload <<-EOF > /dev/null 2>&1
Expand All @@ -215,3 +227,110 @@ jobs:
text
EOF

build-launcher:
name: Build Launcher
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
fail-fast: false
steps:
- name: Checkout (PR)
uses: actions/checkout@v2
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Checkout (Branch)
uses: actions/checkout@v2
if: github.event_name != 'pull_request'
- name: Enable Developer Command Prompt (Windows)
uses: ilammy/[email protected]
- name: Setup GraalVM Environment
uses: DeLaGuardo/[email protected]
with:
graalvm-version: ${{ env.graalVersion }}.${{ env.javaVersion }}
- name: Set Up Native Image (Windows)
if: runner.os == 'Windows'
run: gu.cmd -N install -n native-image
- name: Set Up Native Image (non-Windows)
if: runner.os != 'Windows'
run: gu -N install -n native-image
- name: Set Up SBT
run: |
curl -fSL -o sbt.tgz https://piccolo.link/sbt-${{env.sbtVersion}}.tgz
tar -xzf sbt.tgz
echo ::add-path::$GITHUB_WORKSPACE/sbt/bin/

# Caches
- name: Cache SBT
uses: actions/cache@v2
with:
path: |
~/.sbt
~/.ivy2/cache
~/.cache
key: ${{ runner.os }}-sbt-${{ hashFiles('**build.sbt') }}
restore-keys: ${{ runner.os }}-sbt-

# Build Artifacts
#- name: Bootstrap the project # As long as launcher doesn't depend on
# # runtime, bootstrap is not mandatory.
# run: sbt --no-colors bootstrap
- name: Build Launcher Native Image
run: sbt --no-colors launcher/buildNativeImage

# Publish
- name: Prepare distribution directory name (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
chmod +x enso
DIST_VERSION=$(./enso version --json | jq -r '.version')
DIST_ROOT=enso-launcher-$DIST_VERSION-$(echo ${{ runner.os }} | awk '{print tolower($0)}')-amd64
DIST_DIR=$DIST_ROOT/enso
echo ::set-env name=DIST_VERSION::$DIST_VERSION
echo ::set-env name=DIST_DIR::$DIST_DIR
echo ::set-env name=DIST_ROOT::$DIST_ROOT
- name: Prepare distribution directory name (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
DIST_VERSION=$(./enso.exe version --json | jq -r '.version')
DIST_ROOT=enso-launcher-$DIST_VERSION-$(echo ${{ runner.os }} | awk '{print tolower($0)}')-amd64
DIST_DIR=$DIST_ROOT/enso
echo ::set-env name=DIST_VERSION::$DIST_VERSION
echo ::set-env name=DIST_DIR::$DIST_DIR
echo ::set-env name=DIST_ROOT::$DIST_ROOT

- name: Prepare Launcher distribution (common)
shell: bash
run: |
mkdir -p ${{ env.DIST_DIR }}
mkdir ${{ env.DIST_DIR }}/bin
mkdir ${{ env.DIST_DIR }}/dist
mkdir ${{ env.DIST_DIR }}/jvm
cp distribution/launcher/README.md ${{ env.DIST_DIR }}
cp distribution/launcher/NOTICE ${{ env.DIST_DIR }}
cp -r distribution/launcher/components-licences ${{ env.DIST_DIR }}

- name: Prepare Launcher distribution (Unix)
if: runner.os != 'Windows'
run: |
cp enso ${{ env.DIST_DIR }}/bin/

- name: Prepare Launcher distribution (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
cp enso.exe ${{ env.DIST_DIR }}/bin/

# The way artifacts are uploaded currently does not preserve the
# executable bits for Unix. However putting artifacts into a ZIP would
# create a twice nested ZIP file. For now, users downloading artifacts
# from the CI builds have to set the bit themselves.
- name: Publish the Launcher Binary
uses: actions/upload-artifact@v2
with:
name: ${{ env.DIST_ROOT }}
path: ${{ env.DIST_ROOT }}
Loading