Skip to content

Commit

Permalink
Attempt to fix standalones.
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Sep 21, 2023
1 parent 2430b49 commit dcbc8ee
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 21 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ env:

jobs:
style_and_build_config:
name: Code Style + Build Config
name: style and fullbuild
timeout-minutes: 15
runs-on: ubuntu-20.04
steps:
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
RUN_WITH_COVERAGE: "${{ matrix.os == 'ubuntu-20.04' }}"
MX_ENV: "trufflesqueak-jar"

name: JAR ${{ matrix.os }} + JDK${{ matrix.java }}
name: jar ${{ matrix.os }} + JDK${{ matrix.java }}
timeout-minutes: 60
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -137,12 +137,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-20.04-aarch64, windows-2022] # temporarily disabled: macos-11
kind: [Native, JVM]
type: [native, jvm]
env:
JAVA_VERSION: "21"
MX_ENV: "trufflesqueak-standalone"
MX_ENV: "trufflesqueak-${{ matrix.type }}"
VERBOSE_GRAALVM_LAUNCHERS: true
name: ${{ matrix.kind }} Standalone ${{ matrix.os }}
name: ${{ matrix.type }} ${{ matrix.os }}
timeout-minutes: 60
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -154,11 +154,13 @@ jobs:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ matrix.type == 'native' }}
- name: Enable Oracle GraalVM
shell: bash
run: |
echo "EXTRA_GRAALVM_HOME=$JAVA_HOME" >> $GITHUB_ENV
cat "${JAVA_HOME}/LICENSE.txt" > "${GITHUB_WORKSPACE}/LICENSE"
if: ${{ matrix.type == 'native' }}
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand All @@ -167,15 +169,15 @@ jobs:
shell: bash
run: mx.trufflesqueak/utils.sh set-up-dependencies java${{ env.JAVA_VERSION }} true
- name: Build TruffleSqueak standalone
run: mx.trufflesqueak/utils.sh build-standalone ${{ matrix.kind }} ${{ env.JAVA_VERSION }}
run: mx.trufflesqueak/utils.sh build-standalone ${{ matrix.type }} ${{ env.JAVA_VERSION }}
if: ${{ runner.os != 'Windows' }}
- name: Build TruffleSqueak standalone via cmd.exe
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
if ${{ matrix.kind }}==Native (set "DEPENDENCY_NAME=SMALLTALK_NATIVE_STANDALONE_SVM_JAVA${{ env.JAVA_VERSION }}") else (set "DEPENDENCY_NAME=SMALLTALK_JAVA_STANDALONE_SVM_JAVA${{ env.JAVA_VERSION }}")
call mx --env ${{ env.MX_ENV }} --no-download-progress build --dependencies %DEPENDENCY_NAME%,GRAALVM_TRUFFLESQUEAK_STANDALONE_JAVA${{ env.JAVA_VERSION }}
call mx --env ${{ env.MX_ENV }} standalone-home smalltalk > standalone-home-with-forward-slashes.txt
if ${{ matrix.type }}==native (set "DEPENDENCY_NAME=SMALLTALK_NATIVE_STANDALONE_SVM_JAVA${{ env.JAVA_VERSION }}") else (set "DEPENDENCY_NAME=SMALLTALK_JAVA_STANDALONE_SVM_JAVA${{ env.JAVA_VERSION }}")
call mx --env ${{ env.MX_ENV }} --no-download-progress build --dependencies %DEPENDENCY_NAME%
call mx --env ${{ env.MX_ENV }} standalone-home --type ${{ matrix.type }} smalltalk > standalone-home-with-forward-slashes.txt
set /p STANDALONE_HOME=<standalone-home-with-forward-slashes.txt
setlocal enabledelayedexpansion
set "STANDALONE_HOME=%STANDALONE_HOME:/=\%"
Expand Down
8 changes: 5 additions & 3 deletions mx.trufflesqueak/mx_trufflesqueak.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,12 @@ def patched_native_image(self, build_args, output_file, allow_server=False, nonZ
_use_different_graalvm_home_for_native_image(extra_graalvm_home)


mx_sdk_vm.register_vm_config('trufflesqueak-jar', ['cov', 'dap', 'ins', 'insight', 'insightheap', 'lsp', 'nfi', 'nfi-libffi', 'pro', 'sdk', 'sdkc', 'sdkni', 'sdkl', 'st', 'tfl', 'tfla', 'tflc', 'truffle-json'],
mx_sdk_vm.register_vm_config('trufflesqueak-jar', ['sdk', 'sdkc', 'sdkni', 'ins', 'cov', 'dap', 'lsp', 'sdkl', 'pro', 'insight', 'insightheap', 'tfl', 'tfla', 'tflc', 'truffle-json', 'nfi', 'nfi-libffi', 'st'],
_SUITE, env_file='trufflesqueak-jar')
mx_sdk_vm.register_vm_config('trufflesqueak-standalone', ['cmp', 'cov', 'dap', 'ins', 'insight', 'insightheap', 'lsp', 'nfi', 'nfi-libffi', 'pro', 'sdk', 'sdkc', 'sdkl', 'sdkni', 'st', 'svm', 'svmsl', 'svmt', 'tfl', 'tfla', 'tflc', 'tflm', 'truffle-json'],
_SUITE, env_file='trufflesqueak-standalone')
mx_sdk_vm.register_vm_config('trufflesqueak-jvm', ['ssmalltalkvm', 'sdk', 'sdkc', 'sdkni', 'ins', 'cov', 'dap', 'lsp', 'sdkl', 'pro', 'cmp', 'insight', 'insightheap', 'lg', 'svm', 'svmsl', 'tfl', 'tfla', 'tflc', 'truffle-json', 'nfi', 'nfi-libffi', 'svmt', 'st'],
_SUITE, env_file='trufflesqueak-jvm')
mx_sdk_vm.register_vm_config('trufflesqueak-native', ['sdk', 'sdkc', 'sdkni', 'ins', 'cov', 'dap', 'lsp', 'sdkl', 'pro', 'cmp', 'insight', 'insightheap', 'svm', 'svmsl', 'tfl', 'tfla', 'tflc', 'truffle-json', 'tflm', 'nfi', 'nfi-libffi', 'svmt', 'st'],
_SUITE, env_file='trufflesqueak-native')


LAUNCHER_DESTINATION = 'bin/<exe:trufflesqueak>' if _SVM else 'bin/<exe:trufflesqueak-launcher>'
Expand Down
6 changes: 6 additions & 0 deletions mx.trufflesqueak/trufflesqueak-jvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
COMPONENTS=TruffleSqueak,suite:tools,GraalVM compiler,SubstrateVM,LibGraal
DEFAULT_DYNAMIC_IMPORTS=/compiler,/substratevm,/tools,/vm
INSTALLABLES=TruffleSqueak
NATIVE_IMAGES=lib:jvmcicompiler
BUILD_TARGETS=GRAALVM,GRAALVM_STANDALONES
GRAALVM_SKIP_ARCHIVE=true
File renamed without changes.
18 changes: 9 additions & 9 deletions mx.trufflesqueak/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,27 @@ build-installable() {
}

build-standalone() {
local kind=$1
local type=$1
local java_version=$2
local distro_name="GRAALVM_TRUFFLESQUEAK_STANDALONE_JAVA${java_version}"
local component_name=""
case "${kind}" in
"Native")
case "${type}" in
"native")
component_name="SMALLTALK_NATIVE_STANDALONE_SVM_JAVA${java_version}"
;;
"JVM")
"jvm")
component_name="SMALLTALK_JAVA_STANDALONE_SVM_JAVA${java_version}"
;;
*)
echo "Unexpected standalone kind: ${kind}"
echo "Unexpected standalone type: ${type}"
exit 1
;;
esac
local env_name="trufflesqueak-${type}"

mx --env trufflesqueak-standalone --no-download-progress build --dependencies "${component_name},${distro_name}"
cp "$(mx --env trufflesqueak-standalone paths "${component_name}")" "${STANDALONE_TARGET}"
mx --env "${env_name}" --no-download-progress build --dependencies "${component_name}"
cp "$(mx --env "${env_name}" paths "${component_name}")" "${STANDALONE_TARGET}"

local standalone_home="$(mx --env trufflesqueak-standalone standalone-home smalltalk)"
local standalone_home="$(mx --env "${env_name}" standalone-home --type "${type}" smalltalk)"
add-path "${standalone_home}/bin"
echo "[${standalone_home}/bin added to \$PATH]"
}
Expand Down

0 comments on commit dcbc8ee

Please sign in to comment.