Skip to content

Commit af8b00e

Browse files
committed
symlink graalpy binaries names
1 parent 7f6a25b commit af8b00e

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

dist/setup/index.js

+14
Original file line numberDiff line numberDiff line change
@@ -67369,6 +67369,7 @@ function installGraalPy(graalpyVersion, architecture, allowPreReleases, releases
6736967369
installDir = yield tc.cacheDir(toolDir, 'GraalPy', resolvedGraalPyVersion, architecture);
6737067370
}
6737167371
const binaryPath = getGraalPyBinaryPath(installDir);
67372+
yield createGraalPySymlink(binaryPath, resolvedGraalPyVersion);
6737267373
yield installPip(binaryPath);
6737367374
return { installDir, resolvedGraalPyVersion };
6737467375
}
@@ -67403,6 +67404,19 @@ function getAvailableGraalPyVersions() {
6740367404
});
6740467405
}
6740567406
exports.getAvailableGraalPyVersions = getAvailableGraalPyVersions;
67407+
function createGraalPySymlink(graalpyBinaryPath, graalpyVersion) {
67408+
return __awaiter(this, void 0, void 0, function* () {
67409+
const version = semver.coerce(graalpyVersion);
67410+
const pythonBinaryPostfix = semver.major(version);
67411+
const pythonMinor = semver.minor(version);
67412+
const graalpyMajorMinorBinaryPostfix = `${pythonBinaryPostfix}.${pythonMinor}`;
67413+
const binaryExtension = utils_1.IS_WINDOWS ? '.exe' : '';
67414+
core.info('Creating symlinks...');
67415+
utils_1.createSymlinkInFolder(graalpyBinaryPath, `graalpy${binaryExtension}`, `python${pythonBinaryPostfix}${binaryExtension}`, true);
67416+
utils_1.createSymlinkInFolder(graalpyBinaryPath, `graalpy${binaryExtension}`, `python${binaryExtension}`, true);
67417+
utils_1.createSymlinkInFolder(graalpyBinaryPath, `graalpy${binaryExtension}`, `graalpy${graalpyMajorMinorBinaryPostfix}${binaryExtension}`, true);
67418+
});
67419+
}
6740667420
function installPip(pythonLocation) {
6740767421
return __awaiter(this, void 0, void 0, function* () {
6740867422
core.info('Installing and updating pip');

src/install-graalpy.ts

+35
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
IS_WINDOWS,
1212
IGraalPyManifestAsset,
1313
IGraalPyManifestRelease,
14+
createSymlinkInFolder,
1415
isNightlyKeyword
1516
} from './utils';
1617

@@ -74,6 +75,7 @@ export async function installGraalPy(
7475
}
7576

7677
const binaryPath = getGraalPyBinaryPath(installDir);
78+
await createGraalPySymlink(binaryPath, resolvedGraalPyVersion);
7779
await installPip(binaryPath);
7880

7981
return {installDir, resolvedGraalPyVersion};
@@ -112,6 +114,39 @@ export async function getAvailableGraalPyVersions() {
112114
return response.result;
113115
}
114116

117+
async function createGraalPySymlink(
118+
graalpyBinaryPath: string,
119+
graalpyVersion: string
120+
) {
121+
const version = semver.coerce(graalpyVersion)!;
122+
const pythonBinaryPostfix = semver.major(version);
123+
const pythonMinor = semver.minor(version);
124+
const graalpyMajorMinorBinaryPostfix = `${pythonBinaryPostfix}.${pythonMinor}`;
125+
const binaryExtension = IS_WINDOWS ? '.exe' : '';
126+
127+
core.info('Creating symlinks...');
128+
createSymlinkInFolder(
129+
graalpyBinaryPath,
130+
`graalpy${binaryExtension}`,
131+
`python${pythonBinaryPostfix}${binaryExtension}`,
132+
true
133+
);
134+
135+
createSymlinkInFolder(
136+
graalpyBinaryPath,
137+
`graalpy${binaryExtension}`,
138+
`python${binaryExtension}`,
139+
true
140+
);
141+
142+
createSymlinkInFolder(
143+
graalpyBinaryPath,
144+
`graalpy${binaryExtension}`,
145+
`graalpy${graalpyMajorMinorBinaryPostfix}${binaryExtension}`,
146+
true
147+
);
148+
}
149+
115150
async function installPip(pythonLocation: string) {
116151
core.info('Installing and updating pip');
117152
const pythonBinary = path.join(pythonLocation, 'python');

0 commit comments

Comments
 (0)