Compare commits

...

3 Commits

Author SHA1 Message Date
Fabio Niephaus
eec48106e0 Bump version to 1.4.2. 2025-10-24 18:24:19 +02:00
Fabio Niephaus
0f48fc0abd Extend musl test matrix. 2025-10-24 18:24:19 +02:00
Fabio Niephaus
3716035e2a Upgrade musl-toolchain to 1.2.5-oracle-00001. 2025-10-24 18:24:19 +02:00
7 changed files with 21 additions and 48 deletions

View File

@@ -372,18 +372,22 @@ jobs:
./helloworld
test-action-native-image-musl:
name: native-image-musl on ubuntu-latest
runs-on: ubuntu-latest
name: native-image-musl + JDK${{ matrix.java-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
permissions:
contents: read
pull-requests: write # for `native-image-pr-reports` option
strategy:
matrix:
java-version: ['21', '25']
os: [ubuntu-latest]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Run setup-graalvm action
uses: ./
with:
java-version: 'dev'
distribution: 'graalvm-community'
java-version: ${{ matrix.java-version }}
distribution: 'graalvm'
native-image-musl: 'true'
native-image-job-reports: 'true'
native-image-pr-reports: 'true'
@@ -392,7 +396,7 @@ jobs:
run: |
echo 'public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }' > HelloWorld.java
javac HelloWorld.java
native-image --static --libc=musl HelloWorld
native-image --static --libc=musl --gc=G1 HelloWorld
./helloworld
test-action-extensive:

2
dist/cleanup.js generated vendored
View File

@@ -27288,7 +27288,7 @@ function requireCore () {
var coreExports = requireCore();
const ACTION_VERSION = '1.4.1';
const ACTION_VERSION = '1.4.2';
const INPUT_GITHUB_TOKEN = 'github-token';
const INPUT_CACHE = 'cache';
process.platform === 'linux';

22
dist/main.js generated vendored
View File

@@ -39,7 +39,7 @@ import * as https from 'node:https';
import * as zlib from 'node:zlib';
import require$$1$5 from 'tty';
const ACTION_VERSION = '1.4.1';
const ACTION_VERSION = '1.4.2';
const INPUT_VERSION = 'version';
const INPUT_GDS_TOKEN = 'gds-token';
const INPUT_JAVA_VERSION = 'java-version';
@@ -88852,8 +88852,8 @@ function checkForUpdates(graalVMVersion, javaVersion) {
// TODO: add support for JDK-specific update checks (e.g., 17.0.X)
}
const MUSL_NAME = 'x86_64-linux-musl-native';
const MUSL_VERSION = '10.2.1';
const MUSL_NAME = 'musl-toolchain';
const MUSL_VERSION = '1.2.5-oracle-00001';
async function setUpNativeImageMusl() {
if (!IS_LINUX) {
coreExports.warning('musl is only supported on Linux');
@@ -88865,23 +88865,9 @@ async function setUpNativeImageMusl() {
}
else {
coreExports.startGroup(`Setting up musl for GraalVM Native Image...`);
const muslDownloadPath = await toolCacheExports.downloadTool(`https://github.com/graalvm/setup-graalvm/releases/download/x86_64-linux-musl-${MUSL_VERSION}/${MUSL_NAME}.tgz`);
const muslDownloadPath = await toolCacheExports.downloadTool(`https://gds.oracle.com/download/bfs/archive/musl-toolchain-${MUSL_VERSION}-linux-amd64.tar.gz`);
const muslExtractPath = await toolCacheExports.extractTar(muslDownloadPath);
const muslPath = join(muslExtractPath, MUSL_NAME);
const zlibCommit = 'ec3df00224d4b396e2ac6586ab5d25f673caa4c2';
const zlibDownloadPath = await toolCacheExports.downloadTool(`https://github.com/madler/zlib/archive/${zlibCommit}.tar.gz`);
const zlibExtractPath = await toolCacheExports.extractTar(zlibDownloadPath);
const zlibPath = join(zlibExtractPath, `zlib-${zlibCommit}`);
const zlibBuildOptions = {
cwd: zlibPath,
env: {
...process.env,
CC: join(muslPath, 'bin', 'gcc')
}
};
await exec('./configure', [`--prefix=${muslPath}`, '--static'], zlibBuildOptions);
await exec('make', [], zlibBuildOptions);
await exec('make', ['install'], { cwd: zlibPath });
coreExports.info(`Adding ${MUSL_NAME} ${MUSL_VERSION} to tool-cache ...`);
toolPath = await toolCacheExports.cacheDir(muslPath, MUSL_NAME, MUSL_VERSION);
coreExports.endGroup();

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "setup-graalvm",
"version": "1.4.1",
"version": "1.4.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "setup-graalvm",
"version": "1.4.1",
"version": "1.4.2",
"license": "UPL",
"dependencies": {
"@actions/cache": "^4.1.0",

View File

@@ -2,7 +2,7 @@
"name": "setup-graalvm",
"author": "GraalVM Community",
"description": "GitHub Action for GraalVM",
"version": "1.4.1",
"version": "1.4.2",
"type": "module",
"private": true,
"repository": {

View File

@@ -1,6 +1,6 @@
import * as otypes from '@octokit/types'
export const ACTION_VERSION = '1.4.1'
export const ACTION_VERSION = '1.4.2'
export const INPUT_VERSION = 'version'
export const INPUT_GDS_TOKEN = 'gds-token'

View File

@@ -1,11 +1,10 @@
import * as c from '../constants.js'
import * as core from '@actions/core'
import * as tc from '@actions/tool-cache'
import { exec } from '../utils.js'
import { join } from 'path'
const MUSL_NAME = 'x86_64-linux-musl-native'
const MUSL_VERSION = '10.2.1'
const MUSL_NAME = 'musl-toolchain'
const MUSL_VERSION = '1.2.5-oracle-00001'
export async function setUpNativeImageMusl(): Promise<void> {
if (!c.IS_LINUX) {
@@ -18,26 +17,10 @@ export async function setUpNativeImageMusl(): Promise<void> {
} else {
core.startGroup(`Setting up musl for GraalVM Native Image...`)
const muslDownloadPath = await tc.downloadTool(
`https://github.com/graalvm/setup-graalvm/releases/download/x86_64-linux-musl-${MUSL_VERSION}/${MUSL_NAME}.tgz`
`https://gds.oracle.com/download/bfs/archive/musl-toolchain-${MUSL_VERSION}-linux-amd64.tar.gz`
)
const muslExtractPath = await tc.extractTar(muslDownloadPath)
const muslPath = join(muslExtractPath, MUSL_NAME)
const zlibCommit = 'ec3df00224d4b396e2ac6586ab5d25f673caa4c2'
const zlibDownloadPath = await tc.downloadTool(`https://github.com/madler/zlib/archive/${zlibCommit}.tar.gz`)
const zlibExtractPath = await tc.extractTar(zlibDownloadPath)
const zlibPath = join(zlibExtractPath, `zlib-${zlibCommit}`)
const zlibBuildOptions = {
cwd: zlibPath,
env: {
...process.env,
CC: join(muslPath, 'bin', 'gcc')
}
}
await exec('./configure', [`--prefix=${muslPath}`, '--static'], zlibBuildOptions)
await exec('make', [], zlibBuildOptions)
await exec('make', ['install'], { cwd: zlibPath })
core.info(`Adding ${MUSL_NAME} ${MUSL_VERSION} to tool-cache ...`)
toolPath = await tc.cacheDir(muslPath, MUSL_NAME, MUSL_VERSION)
core.endGroup()