Compare commits

...

2 Commits

Author SHA1 Message Date
Fabio Niephaus
4a200f28cd Bump version to 1.2.6. 2024-11-13 21:01:33 +01:00
Fabio Niephaus
a8c0509ec2 Revert "Upgrade musl and follow recommendation."
This reverts commit 9dd2b41757.
2024-11-13 21:01:33 +01:00
6 changed files with 34 additions and 69 deletions

2
dist/cleanup/index.js generated vendored
View File

@@ -90415,7 +90415,7 @@ else {
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ERROR_HINT = exports.ERROR_REQUEST = exports.EVENT_NAME_PULL_REQUEST = exports.ENV_GITHUB_EVENT_NAME = exports.GDS_GRAALVM_PRODUCT_ID = exports.GDS_BASE = exports.MANDREL_NAMESPACE = exports.GRAALVM_RELEASES_REPO = exports.GRAALVM_PLATFORM = exports.GRAALVM_GH_USER = exports.GRAALVM_FILE_EXTENSION = exports.GRAALVM_ARCH = exports.JDK_HOME_SUFFIX = exports.JDK_PLATFORM = exports.JDK_ARCH = exports.VERSION_LATEST = exports.VERSION_DEV = exports.DISTRIBUTION_LIBERICA = exports.DISTRIBUTION_MANDREL = exports.DISTRIBUTION_GRAALVM_COMMUNITY = exports.DISTRIBUTION_GRAALVM = exports.EXECUTABLE_SUFFIX = exports.IS_WINDOWS = exports.IS_MACOS = exports.IS_LINUX = exports.INPUT_NI_MUSL = exports.INPUT_CHECK_FOR_UPDATES = exports.INPUT_CACHE = exports.INPUT_SET_JAVA_HOME = exports.INPUT_GITHUB_TOKEN = exports.INPUT_COMPONENTS = exports.INPUT_DISTRIBUTION = exports.INPUT_JAVA_PACKAGE = exports.INPUT_JAVA_VERSION = exports.INPUT_GDS_TOKEN = exports.INPUT_VERSION = exports.ACTION_VERSION = void 0; exports.ERROR_HINT = exports.ERROR_REQUEST = exports.EVENT_NAME_PULL_REQUEST = exports.ENV_GITHUB_EVENT_NAME = exports.GDS_GRAALVM_PRODUCT_ID = exports.GDS_BASE = exports.MANDREL_NAMESPACE = exports.GRAALVM_RELEASES_REPO = exports.GRAALVM_PLATFORM = exports.GRAALVM_GH_USER = exports.GRAALVM_FILE_EXTENSION = exports.GRAALVM_ARCH = exports.JDK_HOME_SUFFIX = exports.JDK_PLATFORM = exports.JDK_ARCH = exports.VERSION_LATEST = exports.VERSION_DEV = exports.DISTRIBUTION_LIBERICA = exports.DISTRIBUTION_MANDREL = exports.DISTRIBUTION_GRAALVM_COMMUNITY = exports.DISTRIBUTION_GRAALVM = exports.EXECUTABLE_SUFFIX = exports.IS_WINDOWS = exports.IS_MACOS = exports.IS_LINUX = exports.INPUT_NI_MUSL = exports.INPUT_CHECK_FOR_UPDATES = exports.INPUT_CACHE = exports.INPUT_SET_JAVA_HOME = exports.INPUT_GITHUB_TOKEN = exports.INPUT_COMPONENTS = exports.INPUT_DISTRIBUTION = exports.INPUT_JAVA_PACKAGE = exports.INPUT_JAVA_VERSION = exports.INPUT_GDS_TOKEN = exports.INPUT_VERSION = exports.ACTION_VERSION = void 0;
exports.ACTION_VERSION = '1.2.5'; exports.ACTION_VERSION = '1.2.6';
exports.INPUT_VERSION = 'version'; exports.INPUT_VERSION = 'version';
exports.INPUT_GDS_TOKEN = 'gds-token'; exports.INPUT_GDS_TOKEN = 'gds-token';
exports.INPUT_JAVA_VERSION = 'java-version'; exports.INPUT_JAVA_VERSION = 'java-version';

41
dist/main/index.js generated vendored
View File

@@ -90981,7 +90981,7 @@ function wrappy (fn, cb) {
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ERROR_HINT = exports.ERROR_REQUEST = exports.EVENT_NAME_PULL_REQUEST = exports.ENV_GITHUB_EVENT_NAME = exports.GDS_GRAALVM_PRODUCT_ID = exports.GDS_BASE = exports.MANDREL_NAMESPACE = exports.GRAALVM_RELEASES_REPO = exports.GRAALVM_PLATFORM = exports.GRAALVM_GH_USER = exports.GRAALVM_FILE_EXTENSION = exports.GRAALVM_ARCH = exports.JDK_HOME_SUFFIX = exports.JDK_PLATFORM = exports.JDK_ARCH = exports.VERSION_LATEST = exports.VERSION_DEV = exports.DISTRIBUTION_LIBERICA = exports.DISTRIBUTION_MANDREL = exports.DISTRIBUTION_GRAALVM_COMMUNITY = exports.DISTRIBUTION_GRAALVM = exports.EXECUTABLE_SUFFIX = exports.IS_WINDOWS = exports.IS_MACOS = exports.IS_LINUX = exports.INPUT_NI_MUSL = exports.INPUT_CHECK_FOR_UPDATES = exports.INPUT_CACHE = exports.INPUT_SET_JAVA_HOME = exports.INPUT_GITHUB_TOKEN = exports.INPUT_COMPONENTS = exports.INPUT_DISTRIBUTION = exports.INPUT_JAVA_PACKAGE = exports.INPUT_JAVA_VERSION = exports.INPUT_GDS_TOKEN = exports.INPUT_VERSION = exports.ACTION_VERSION = void 0; exports.ERROR_HINT = exports.ERROR_REQUEST = exports.EVENT_NAME_PULL_REQUEST = exports.ENV_GITHUB_EVENT_NAME = exports.GDS_GRAALVM_PRODUCT_ID = exports.GDS_BASE = exports.MANDREL_NAMESPACE = exports.GRAALVM_RELEASES_REPO = exports.GRAALVM_PLATFORM = exports.GRAALVM_GH_USER = exports.GRAALVM_FILE_EXTENSION = exports.GRAALVM_ARCH = exports.JDK_HOME_SUFFIX = exports.JDK_PLATFORM = exports.JDK_ARCH = exports.VERSION_LATEST = exports.VERSION_DEV = exports.DISTRIBUTION_LIBERICA = exports.DISTRIBUTION_MANDREL = exports.DISTRIBUTION_GRAALVM_COMMUNITY = exports.DISTRIBUTION_GRAALVM = exports.EXECUTABLE_SUFFIX = exports.IS_WINDOWS = exports.IS_MACOS = exports.IS_LINUX = exports.INPUT_NI_MUSL = exports.INPUT_CHECK_FOR_UPDATES = exports.INPUT_CACHE = exports.INPUT_SET_JAVA_HOME = exports.INPUT_GITHUB_TOKEN = exports.INPUT_COMPONENTS = exports.INPUT_DISTRIBUTION = exports.INPUT_JAVA_PACKAGE = exports.INPUT_JAVA_VERSION = exports.INPUT_GDS_TOKEN = exports.INPUT_VERSION = exports.ACTION_VERSION = void 0;
exports.ACTION_VERSION = '1.2.5'; exports.ACTION_VERSION = '1.2.6';
exports.INPUT_VERSION = 'version'; exports.INPUT_VERSION = 'version';
exports.INPUT_GDS_TOKEN = 'gds-token'; exports.INPUT_GDS_TOKEN = 'gds-token';
exports.INPUT_JAVA_VERSION = 'java-version'; exports.INPUT_JAVA_VERSION = 'java-version';
@@ -91466,12 +91466,8 @@ const core = __importStar(__nccwpck_require__(2186));
const tc = __importStar(__nccwpck_require__(7784)); const tc = __importStar(__nccwpck_require__(7784));
const utils_1 = __nccwpck_require__(1314); const utils_1 = __nccwpck_require__(1314);
const path_1 = __nccwpck_require__(1017); const path_1 = __nccwpck_require__(1017);
const os_1 = __nccwpck_require__(2037); const MUSL_NAME = 'x86_64-linux-musl-native';
const fs_1 = __nccwpck_require__(7147); const MUSL_VERSION = '10.2.1';
const MUSL_NAME = 'musl-gcc';
const MUSL_VERSION = '1.2.4';
const ZLIB_VERSION = '1.2.13';
// Build instructions: https://github.com/oracle/graal/blob/6dab549194b85252f88bda4ee825762d8b02c687/docs/reference-manual/native-image/guides/build-static-and-mostly-static-executable.md?plain=1#L38-L67
function setUpNativeImageMusl() { function setUpNativeImageMusl() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
if (!c.IS_LINUX) { if (!c.IS_LINUX) {
@@ -91480,35 +91476,26 @@ function setUpNativeImageMusl() {
} }
let toolPath = tc.find(MUSL_NAME, MUSL_VERSION); let toolPath = tc.find(MUSL_NAME, MUSL_VERSION);
if (toolPath) { if (toolPath) {
core.info(`Found musl ${MUSL_VERSION} in tool-cache @ ${toolPath}`); core.info(`Found ${MUSL_NAME} ${MUSL_VERSION} in tool-cache @ ${toolPath}`);
} }
else { else {
core.startGroup(`Building musl with zlib for GraalVM Native Image...`); core.startGroup(`Setting up musl for GraalVM Native Image...`);
// Build musl const muslDownloadPath = yield tc.downloadTool(`https://github.com/graalvm/setup-graalvm/releases/download/x86_64-linux-musl-${MUSL_VERSION}/${MUSL_NAME}.tgz`);
const muslHome = (0, path_1.join)((0, os_1.homedir)(), 'musl-toolchain');
const muslDownloadPath = yield tc.downloadTool(`https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz`);
const muslExtractPath = yield tc.extractTar(muslDownloadPath); const muslExtractPath = yield tc.extractTar(muslDownloadPath);
const muslPath = (0, path_1.join)(muslExtractPath, `musl-${MUSL_VERSION}`); const muslPath = (0, path_1.join)(muslExtractPath, MUSL_NAME);
const muslBuildOptions = { cwd: muslPath }; const zlibCommit = 'ec3df00224d4b396e2ac6586ab5d25f673caa4c2';
yield (0, utils_1.exec)('./configure', [`--prefix=${muslHome}`, '--static'], muslBuildOptions); const zlibDownloadPath = yield tc.downloadTool(`https://github.com/madler/zlib/archive/${zlibCommit}.tar.gz`);
yield (0, utils_1.exec)('make', [], muslBuildOptions);
yield (0, utils_1.exec)('make', ['install'], muslBuildOptions);
const muslGCC = (0, path_1.join)(muslHome, 'bin', MUSL_NAME);
yield fs_1.promises.symlink(muslGCC, (0, path_1.join)(muslHome, 'bin', 'x86_64-linux-musl-gcc'), 'file');
// Build zlib
const zlibDownloadPath = yield tc.downloadTool(`https://zlib.net/fossils/zlib-${ZLIB_VERSION}.tar.gz`);
const zlibExtractPath = yield tc.extractTar(zlibDownloadPath); const zlibExtractPath = yield tc.extractTar(zlibDownloadPath);
const zlibPath = (0, path_1.join)(zlibExtractPath, `zlib-${ZLIB_VERSION}`); const zlibPath = (0, path_1.join)(zlibExtractPath, `zlib-${zlibCommit}`);
const zlibBuildOptions = { const zlibBuildOptions = {
cwd: zlibPath, cwd: zlibPath,
env: Object.assign(Object.assign({}, process.env), { CC: muslGCC }) env: Object.assign(Object.assign({}, process.env), { CC: (0, path_1.join)(muslPath, 'bin', 'gcc') })
}; };
yield (0, utils_1.exec)('./configure', [`--prefix=${muslHome}`, '--static'], zlibBuildOptions); yield (0, utils_1.exec)('./configure', [`--prefix=${muslPath}`, '--static'], zlibBuildOptions);
yield (0, utils_1.exec)('make', [], zlibBuildOptions); yield (0, utils_1.exec)('make', [], zlibBuildOptions);
yield (0, utils_1.exec)('make', ['install'], { cwd: zlibPath }); yield (0, utils_1.exec)('make', ['install'], { cwd: zlibPath });
// Store in cache core.info(`Adding ${MUSL_NAME} ${MUSL_VERSION} to tool-cache ...`);
core.info(`Adding musl ${MUSL_VERSION} with zlib ${ZLIB_VERSION} to tool-cache ...`); toolPath = yield tc.cacheDir(muslPath, MUSL_NAME, MUSL_VERSION);
toolPath = yield tc.cacheDir(muslHome, MUSL_NAME, MUSL_VERSION);
core.endGroup(); core.endGroup();
} }
core.addPath((0, path_1.join)(toolPath, 'bin')); core.addPath((0, path_1.join)(toolPath, 'bin'));

4
package-lock.json generated
View File

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

View File

@@ -1,6 +1,6 @@
{ {
"name": "setup-graalvm", "name": "setup-graalvm",
"version": "1.2.5", "version": "1.2.6",
"private": true, "private": true,
"description": "GitHub Action for GraalVM", "description": "GitHub Action for GraalVM",
"main": "lib/main.js", "main": "lib/main.js",

View File

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

View File

@@ -3,14 +3,9 @@ import * as core from '@actions/core'
import * as tc from '@actions/tool-cache' import * as tc from '@actions/tool-cache'
import {exec} from '../utils' import {exec} from '../utils'
import {join} from 'path' import {join} from 'path'
import {homedir} from 'os'
import {promises as fs} from 'fs'
const MUSL_NAME = 'musl-gcc' const MUSL_NAME = 'x86_64-linux-musl-native'
const MUSL_VERSION = '1.2.4' const MUSL_VERSION = '10.2.1'
const ZLIB_VERSION = '1.2.13'
// Build instructions: https://github.com/oracle/graal/blob/6dab549194b85252f88bda4ee825762d8b02c687/docs/reference-manual/native-image/guides/build-static-and-mostly-static-executable.md?plain=1#L38-L67
export async function setUpNativeImageMusl(): Promise<void> { export async function setUpNativeImageMusl(): Promise<void> {
if (!c.IS_LINUX) { if (!c.IS_LINUX) {
@@ -19,55 +14,38 @@ export async function setUpNativeImageMusl(): Promise<void> {
} }
let toolPath = tc.find(MUSL_NAME, MUSL_VERSION) let toolPath = tc.find(MUSL_NAME, MUSL_VERSION)
if (toolPath) { if (toolPath) {
core.info(`Found musl ${MUSL_VERSION} in tool-cache @ ${toolPath}`) core.info(`Found ${MUSL_NAME} ${MUSL_VERSION} in tool-cache @ ${toolPath}`)
} else { } else {
core.startGroup(`Building musl with zlib for GraalVM Native Image...`) core.startGroup(`Setting up musl for GraalVM Native Image...`)
// Build musl
const muslHome = join(homedir(), 'musl-toolchain')
const muslDownloadPath = await tc.downloadTool( const muslDownloadPath = await tc.downloadTool(
`https://musl.libc.org/releases/musl-${MUSL_VERSION}.tar.gz` `https://github.com/graalvm/setup-graalvm/releases/download/x86_64-linux-musl-${MUSL_VERSION}/${MUSL_NAME}.tgz`
) )
const muslExtractPath = await tc.extractTar(muslDownloadPath) const muslExtractPath = await tc.extractTar(muslDownloadPath)
const muslPath = join(muslExtractPath, `musl-${MUSL_VERSION}`) const muslPath = join(muslExtractPath, MUSL_NAME)
const muslBuildOptions = {cwd: muslPath}
await exec( const zlibCommit = 'ec3df00224d4b396e2ac6586ab5d25f673caa4c2'
'./configure',
[`--prefix=${muslHome}`, '--static'],
muslBuildOptions
)
await exec('make', [], muslBuildOptions)
await exec('make', ['install'], muslBuildOptions)
const muslGCC = join(muslHome, 'bin', MUSL_NAME)
await fs.symlink(
muslGCC,
join(muslHome, 'bin', 'x86_64-linux-musl-gcc'),
'file'
)
// Build zlib
const zlibDownloadPath = await tc.downloadTool( const zlibDownloadPath = await tc.downloadTool(
`https://zlib.net/fossils/zlib-${ZLIB_VERSION}.tar.gz` `https://github.com/madler/zlib/archive/${zlibCommit}.tar.gz`
) )
const zlibExtractPath = await tc.extractTar(zlibDownloadPath) const zlibExtractPath = await tc.extractTar(zlibDownloadPath)
const zlibPath = join(zlibExtractPath, `zlib-${ZLIB_VERSION}`) const zlibPath = join(zlibExtractPath, `zlib-${zlibCommit}`)
const zlibBuildOptions = { const zlibBuildOptions = {
cwd: zlibPath, cwd: zlibPath,
env: { env: {
...process.env, ...process.env,
CC: muslGCC CC: join(muslPath, 'bin', 'gcc')
} }
} }
await exec( await exec(
'./configure', './configure',
[`--prefix=${muslHome}`, '--static'], [`--prefix=${muslPath}`, '--static'],
zlibBuildOptions zlibBuildOptions
) )
await exec('make', [], zlibBuildOptions) await exec('make', [], zlibBuildOptions)
await exec('make', ['install'], {cwd: zlibPath}) await exec('make', ['install'], {cwd: zlibPath})
// Store in cache
core.info( core.info(`Adding ${MUSL_NAME} ${MUSL_VERSION} to tool-cache ...`)
`Adding musl ${MUSL_VERSION} with zlib ${ZLIB_VERSION} to tool-cache ...` toolPath = await tc.cacheDir(muslPath, MUSL_NAME, MUSL_VERSION)
)
toolPath = await tc.cacheDir(muslHome, MUSL_NAME, MUSL_VERSION)
core.endGroup() core.endGroup()
} }
core.addPath(join(toolPath, 'bin')) core.addPath(join(toolPath, 'bin'))