Skip to content

Commit

Permalink
Changes to build GraalVM 24-ea (#19)
Browse files Browse the repository at this point in the history
* Make ro data section writable

* add debug

* add actions

* undo change

* undo change

* undo change
  • Loading branch information
jperedadnr authored Sep 4, 2024
1 parent f4e313f commit 333e4f7
Show file tree
Hide file tree
Showing 4 changed files with 389 additions and 1 deletion.
162 changes: 162 additions & 0 deletions .github/workflows/gluon-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Builds GraalVM 24-ea for Linux (x86_64), Windows (x86_64) and macOS (amd64/aarch64), with JDK 21

name: Gluon Build

on:
push:
branches:
- 'master'
pull_request:
branches:
- 'master'
workflow_dispatch:

env:
LANG: en_US.UTF-8

jobs:
build-graalvm-gluon:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-latest, ubuntu-latest]
include:
- os: ubuntu-latest
ARCH: "amd64"
HOME: ""
NAME: "linux"
- os: macos-13
ARCH: "amd64"
HOME: "/Contents/Home"
NAME: "darwin"
- os: macos-latest
ARCH: "aarch64"
HOME: "/Contents/Home"
NAME: "darwin"
env:
LABS_LINK: https://github.com/graalvm/labs-openjdk/releases/download/23%2B25-jvmci-b01/
LABS_TAG: 23+25-jvmci-b01
LABS_HOME: ${{ github.workspace }}/jdk
MX_PYTHON: python3.9
MX_PATH: ${{ github.workspace }}/mx
GRAALVM_SVM: graalvm-java23-${{ matrix.NAME }}-24.1
DYNAMIC_IMPORTS: "/substratevm"
DISABLE_POLYGLOT: true
DISABLE_LIBPOLYGLOT: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/checkout@v4
with:
repository: graalvm/mx
fetch-depth: 1
ref: master
path: ${{ env.MX_PATH }}
- uses: actions/cache@v4
with:
path: ~/.mx
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
restore-keys: ${{ runner.os }}-mx-
- name: Set up Python
if: matrix.os == 'macos-13' || matrix.os == 'ubuntu-latest'
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Get LabsJDK
run: |
wget ${{ env.LABS_LINK }}labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz -O labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz
tar -xf labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz
echo "JAVA_HOME=${{ github.workspace }}/labsjdk-ce-23-jvmci-b01${{ matrix.HOME }}" >> ${GITHUB_ENV}
- name: Build GraalVM
id: build-graalvm
run: |
cd substratevm
${MX_PATH}/mx --dy /substratevm build
GRAALVM_HOME=`${MX_PATH}/mx --dy /substratevm graalvm-home`
echo "::set-output name=graalvm-home-dir::$GRAALVM_HOME"
cd ..
- name: Create distribution
working-directory: ./vm
run: |
cd ${{ steps.build-graalvm.outputs.graalvm-home-dir }}/..
if [[ ${{ matrix.os }} != 'ubuntu-latest' ]]
then
cd ../..
fi
mv `ls -1 | head -n1` ${{ env.GRAALVM_SVM }}
echo >> ${{ env.GRAALVM_SVM }}/release && echo "VENDOR=Gluon" >> ${{ env.GRAALVM_SVM }}/release
tar -czvf ${{ github.workspace }}/vm/${{ env.GRAALVM_SVM }}.tar.gz ${{ env.GRAALVM_SVM }}
- name: Archive distribution
uses: actions/upload-artifact@v2
with:
name: graalvm-zip-${{ matrix.NAME }}-${{ matrix.ARCH }}
path: |
vm/${{ env.GRAALVM_SVM }}.tar.gz
build-graalvm-gluon-windows:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
include:
- os: windows-latest
ARCH: "amd64"
HOME: ""
NAME: "windows"
env:
LABS_LINK: https://github.com/graalvm/labs-openjdk/releases/download/23%2B25-jvmci-b01/
LABS_TAG: 23+25-jvmci-b01
LABS_HOME: ${{ github.workspace }}/jdk
MX_PYTHON: 'python'
MX_PATH: ${{ github.workspace }}/mx
GRAALVM_SVM: graalvm-java23-${{ matrix.NAME }}-24.1
DYNAMIC_IMPORTS: "/substratevm"
DISABLE_POLYGLOT: true
DISABLE_LIBPOLYGLOT: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/checkout@v4
with:
repository: graalvm/mx
fetch-depth: 1
ref: master
path: ${{ env.MX_PATH }}
- uses: actions/cache@v4
with:
path: ~/.mx
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
restore-keys: ${{ runner.os }}-mx-
- name: Get LabsJDK (windows)
run: |
Invoke-WebRequest ${{ env.LABS_LINK }}labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz -OutFile labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz
tar -xf .\labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz
- name: Build GraalVM (windows)
env:
JAVA_HOME: ${{ github.workspace }}/labsjdk-ce-23-jvmci-b01${{ matrix.HOME }}
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
call ${{ env.MX_PATH }}\mx.cmd -p substratevm build
call ${{ env.MX_PATH }}\mx.cmd -p substratevm graalvm-home > graalvm-home-with-forward-slashes.txt
set /p GRAALVM_HOME=<graalvm-home-with-forward-slashes.txt
setlocal enabledelayedexpansion
set "GRAALVM_HOME=%GRAALVM_HOME:/=\%"
echo "::set-output name=graalvm-home-dir::%GRAALVM_HOME%"
echo GRAALVM_HOME=%GRAALVM_HOME% >> %GITHUB_ENV%
- name: Create distribution
working-directory: ./vm
run: |
move ${{ env.GRAALVM_HOME}} ${{ env.GRAALVM_SVM }}
echo '' >> ${{ env.GRAALVM_SVM }}/release && echo VENDOR=Gluon >> ${{ env.GRAALVM_SVM }}/release
Compress-Archive -Path ${{ env.GRAALVM_SVM }} -DestinationPath ${{ env.GRAALVM_SVM }}.zip
- name: Archive distribution
uses: actions/upload-artifact@v2
with:
name: graalvm-zip-${{ matrix.NAME }}-${{ matrix.ARCH }}
path: |
vm/${{ env.GRAALVM_SVM }}.zip
216 changes: 216 additions & 0 deletions .github/workflows/gluon-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
# Builds GraalVM 24-ea for Linux (x86_64), Windows (x86_64) and macOS (amd64/aarch64), with JDK 21

name: Gluon Release

on:
push:
tags:
- '*'

env:
LANG: en_US.UTF-8

jobs:
determine-version:
runs-on: ubuntu-latest
outputs:
simpleTag: ${{ steps.fetchSimpleTag.outputs.tag }}
version: ${{ steps.fetchVersion.outputs.version }}
steps:
- id: fetchSimpleTag
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- id: fetchVersion
run: echo ::set-output name=version::$(echo $GITHUB_REF | sed -E "s/.*(gluon-.*-(dev|Final)).*/\1/g")

build-graalvm-gluon:
needs:
- determine-version
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-13, macos-latest, ubuntu-latest]
include:
- os: ubuntu-latest
ARCH: "amd64"
HOME: ""
NAME: "linux"
- os: macos-13
ARCH: "amd64"
HOME: "/Contents/Home"
NAME: "darwin"
- os: macos-latest
ARCH: "aarch64"
HOME: "/Contents/Home"
NAME: "darwin"
env:
LABS_LINK: https://github.com/graalvm/labs-openjdk/releases/download/23%2B25-jvmci-b01/
LABS_TAG: 23+25-jvmci-b01
LABS_HOME: ${{ github.workspace }}/jdk
MX_PYTHON: python3.9
MX_PATH: ${{ github.workspace }}/mx
GRAALVM_SVM: graalvm-java23-${{ matrix.NAME }}-${{ matrix.ARCH }}-${{ needs.determine-version.outputs.version }}
DYNAMIC_IMPORTS: "/substratevm"
DISABLE_POLYGLOT: true
DISABLE_LIBPOLYGLOT: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/checkout@v4
with:
repository: graalvm/mx
fetch-depth: 1
ref: master
path: ${{ env.MX_PATH }}
- uses: actions/cache@v4
with:
path: ~/.mx
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
restore-keys: ${{ runner.os }}-mx-
- name: Set up Python
if: matrix.os == 'macos-13' || matrix.os == 'ubuntu-latest'
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Get LabsJDK
run: |
wget ${{ env.LABS_LINK }}labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz -O labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz
tar -xf labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz
echo "JAVA_HOME=${{ github.workspace }}/labsjdk-ce-23-jvmci-b01${{ matrix.HOME }}" >> ${GITHUB_ENV}
- name: Build GraalVM
id: build-graalvm
run: |
cd substratevm
${MX_PATH}/mx --dy /substratevm build
GRAALVM_HOME=`${MX_PATH}/mx --dy /substratevm graalvm-home`
echo "::set-output name=graalvm-home-dir::$GRAALVM_HOME"
cd ..
- name: Create distribution
working-directory: ./vm
run: |
cd ${{ steps.build-graalvm.outputs.graalvm-home-dir }}/..
if [[ ${{ matrix.os }} != 'ubuntu-latest' ]]
then
cd ../..
fi
mv `ls -1 | head -n1` ${{ env.GRAALVM_SVM }}
echo >> ${{ env.GRAALVM_SVM }}/release && echo "VENDOR=Gluon" >> ${{ env.GRAALVM_SVM }}/release
tar -czvf ${{ github.workspace }}/vm/${{ env.GRAALVM_SVM }}.tar.gz ${{ env.GRAALVM_SVM }}
- name: Archive distribution
uses: actions/upload-artifact@v4
with:
name: graalvm-zip-${{ matrix.NAME }}-${{ matrix.ARCH }}
path: |
vm/${{ env.GRAALVM_SVM }}.tar.gz
build-graalvm-gluon-windows:
needs:
- determine-version
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
include:
- os: windows-latest
ARCH: "amd64"
HOME: ""
NAME: "windows"
env:
LABS_LINK: https://github.com/graalvm/labs-openjdk/releases/download/23%2B25-jvmci-b01/
LABS_TAG: 23+25-jvmci-b01
LABS_HOME: ${{ github.workspace }}/jdk
MX_PYTHON: 'python'
MX_PATH: ${{ github.workspace }}/mx
GRAALVM_SVM: graalvm-java23-${{ matrix.NAME }}-${{ matrix.ARCH }}-${{ needs.determine-version.outputs.version }}
DYNAMIC_IMPORTS: "/substratevm"
DISABLE_POLYGLOT: true
DISABLE_LIBPOLYGLOT: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/checkout@v4
with:
repository: graalvm/mx
fetch-depth: 1
ref: master
path: ${{ env.MX_PATH }}
- uses: actions/cache@v4
with:
path: ~/.mx
key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }}
restore-keys: ${{ runner.os }}-mx-
- name: Get LabsJDK (windows)
run: |
Invoke-WebRequest ${{ env.LABS_LINK }}labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz -OutFile labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz
tar -xf .\labsjdk-ce-${{ env.LABS_TAG }}-${{ matrix.NAME }}-${{ matrix.ARCH }}.tar.gz
- name: Build GraalVM (windows)
env:
JAVA_HOME: ${{ github.workspace }}/labsjdk-ce-23-jvmci-b01${{ matrix.HOME }}
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
call ${{ env.MX_PATH }}\mx.cmd -p substratevm build
call ${{ env.MX_PATH }}\mx.cmd -p substratevm graalvm-home > graalvm-home-with-forward-slashes.txt
set /p GRAALVM_HOME=<graalvm-home-with-forward-slashes.txt
setlocal enabledelayedexpansion
set "GRAALVM_HOME=%GRAALVM_HOME:/=\%"
echo "::set-output name=graalvm-home-dir::%GRAALVM_HOME%"
echo GRAALVM_HOME=%GRAALVM_HOME% >> %GITHUB_ENV%
- name: Create distribution
working-directory: ./vm
run: |
move ${{ env.GRAALVM_HOME}} ${{ env.GRAALVM_SVM }}
echo '' >> ${{ env.GRAALVM_SVM }}/release && echo VENDOR=Gluon >> ${{ env.GRAALVM_SVM }}/release
Compress-Archive -Path ${{ env.GRAALVM_SVM }} -DestinationPath ${{ env.GRAALVM_SVM }}.zip
- name: Archive distribution
uses: actions/upload-artifact@v4
with:
name: graalvm-zip-${{ matrix.NAME }}-${{ matrix.ARCH }}
path: |
vm/${{ env.GRAALVM_SVM }}.zip
create-release:
runs-on: ubuntu-latest
needs:
- determine-version
- build-graalvm-gluon
- build-graalvm-gluon-windows
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/download-artifact@v4
with:
name: graalvm-zip-linux-amd64
path: ./dist/vm
- uses: actions/download-artifact@v4
with:
name: graalvm-zip-darwin-amd64
path: ./dist/vm
- uses: actions/download-artifact@v4
with:
name: graalvm-zip-darwin-aarch64
path: ./dist/vm
- uses: actions/download-artifact@v4
with:
name: graalvm-zip-windows-amd64
path: ./dist/vm
- name: Check files
run: |
ls -R ./dist/vm
- name: Create release name
id: create-release-name
run: echo ::set-output name=releaseName::$(echo ${{ needs.determine-version.outputs.simpleTag }} | sed "s/gluon-/Gluon /g")
- name: Release
uses: softprops/action-gh-release@v2
with:
name: GraalVM CE ${{ steps.create-release-name.outputs.releaseName }}
body: |
This is a Gluon build of GraalVM.
Based on Gluon Graal commit: ${{ github.sha }}
files: |
./dist/vm/*.zip
./dist/vm/*.tar.gz
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ public static class NoTransitions {
@CFunction(transition = Transition.NO_TRANSITION)
public static native Pointer mmap(PointerBase addr, UnsignedWord len, int prot, int flags, int fd, long offset);

@CFunction(transition = Transition.NO_TRANSITION)
public static native Pointer mymmap(PointerBase addr, UnsignedWord len, int prot, int flags, int fd, long offset);

@CFunction(transition = Transition.NO_TRANSITION)
public static native Pointer myprint(PointerBase addr);

@CFunction(transition = Transition.NO_TRANSITION)
public static native Pointer myprinti(int val);

@CFunction(transition = Transition.NO_TRANSITION)
public static native int munmap(PointerBase addr, UnsignedWord len);

Expand Down
Loading

0 comments on commit 333e4f7

Please sign in to comment.