Skip to content

Commit

Permalink
[GR-18163] Fix jt install jvmci before cloning graal
Browse files Browse the repository at this point in the history
PullRequest: truffleruby/4058
  • Loading branch information
eregon committed Nov 16, 2023
2 parents a9afcef + 605004c commit 3470023
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 21 deletions.
10 changes: 5 additions & 5 deletions .github/actions/setup-jvmci-graal/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: 'Install JVMCI, set JAVA_HOME and clone Graal'
runs:
using: "composite"
steps:
- name: Clone Graal
run: jt sforceimports
shell: bash
working-directory: ${{ github.action_path }}

- name: Install JVMCI
run: jt install jvmci
shell: bash
Expand All @@ -11,8 +16,3 @@ runs:
run: echo "JAVA_HOME=$(jt install jvmci)" >> $GITHUB_ENV
shell: bash
working-directory: ${{ github.action_path }}

- name: Clone Graal
run: jt mx sforceimports
shell: bash
working-directory: ${{ github.action_path }}
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Clone TruffleRuby
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0 # Necessary for jt check_abi
- name: Setup system Ruby
Expand All @@ -23,7 +23,7 @@ jobs:
run: echo "$PWD/bin" >> $GITHUB_PATH

- name: Restore ~/.mx/cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.mx/cache
key: mx-cache-lint-${{ runner.os }}-${{ hashFiles('common.json') }}
Expand All @@ -48,7 +48,7 @@ jobs:
working-directory: build
steps:
- name: Clone TruffleRuby
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: build
- name: Setup system Ruby
Expand All @@ -59,7 +59,7 @@ jobs:
run: echo "$PWD/bin" >> $GITHUB_PATH

- name: Restore ~/.mx/cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.mx/cache
key: mx-cache-build-${{ runner.os }}-${{ hashFiles('build/common.json') }}
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
working-directory: build
steps:
- name: Clone TruffleRuby
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: build
- name: Setup system Ruby
Expand All @@ -100,7 +100,7 @@ jobs:
run: echo "$PWD/bin" >> $GITHUB_PATH

- name: Restore ~/.mx/cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.mx/cache
key: mx-cache-build-native-${{ runner.os }}-${{ hashFiles('build/common.json') }}
Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Clone TruffleRuby
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup system Ruby
uses: ruby/setup-ruby@v1
- name: Setup jt
Expand All @@ -158,7 +158,7 @@ jobs:
- :library :cext :security :command_line :tracepoint # command_line ~5min, others < 2min
steps:
- name: Clone TruffleRuby
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup system Ruby
uses: ruby/setup-ruby@v1
- name: Setup jt
Expand All @@ -177,7 +177,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Clone TruffleRuby
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup system Ruby
uses: ruby/setup-ruby@v1
- name: Setup jt
Expand All @@ -196,7 +196,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Clone TruffleRuby
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup system Ruby
uses: ruby/setup-ruby@v1
- name: Setup jt
Expand All @@ -222,7 +222,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Clone TruffleRuby
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup system Ruby
uses: ruby/setup-ruby@v1
- name: Setup jt
Expand All @@ -245,7 +245,7 @@ jobs:
ruby: ['3.0', '3.1', '3.2']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
Expand Down
4 changes: 2 additions & 2 deletions doc/user/testing-truffleruby-in-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [ 2.6, truffleruby, truffleruby-head ]
ruby: [ '3.2', truffleruby, truffleruby-head ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
Expand Down
9 changes: 7 additions & 2 deletions tool/jt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def graal_common_json

def jvmci_version
@jvmci_version ||= begin
sforceimports unless File.directory?(GRAAL_DIR)
common_json = File.read(graal_common_json)
edition = ee_jdk? ? 'ee' : 'ce'
regex = /"labsjdk-#{edition}-#{@jdk_version}":\s*\{\s*"name":\s*"labsjdk"\s*,\s*"version":\s*"[^"]+-(jvmci-[^"]+)"\s*,/
Expand Down Expand Up @@ -2512,6 +2513,10 @@ def bootstrap_toolchain
end
end

def sforceimports
mx('sforceimports', java_home: :none, primary_suite: TRUFFLERUBY_DIR)
end

private def build_graalvm(*options)
raise 'use --env jvm-ce instead' if options.delete('--graal')
raise 'use --env native instead' if options.delete('--native')
Expand Down Expand Up @@ -2547,14 +2552,14 @@ def bootstrap_toolchain
checkout_enterprise_revision(env) if cloned

if options.delete('--sforceimports') || sforceimports?(mx_base_args)
mx('sforceimports', java_home: :none, primary_suite: TRUFFLERUBY_DIR)
sforceimports
if ee
checkout_enterprise_revision(env) if !cloned
# sforceimports for optional suites imported in vm-enterprise like substratevm-enterprise-gcs
vm_enterprise = File.expand_path '../graal-enterprise/vm-enterprise', TRUFFLERUBY_DIR
mx('--env', env_path(env), 'sforceimports', java_home: :none, primary_suite: vm_enterprise)
# And still make sure we import the graal revision as in mx.truffleruby/suite.py
mx('sforceimports', java_home: :none, primary_suite: TRUFFLERUBY_DIR)
sforceimports
end
end

Expand Down

0 comments on commit 3470023

Please sign in to comment.