Skip to content

Commit bc8ee42

Browse files
committed
fix: Mac Toolpath
Shared libraries for the Mac python builds are not configured with the relocatable flag, thus must always be configured with the hosted path. Relates #459
1 parent 467a981 commit bc8ee42

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

dist/setup/index.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -65338,14 +65338,17 @@ function resolveVersionInput() {
6533865338
return version;
6533965339
}
6534065340
function run() {
65341-
var _a;
65341+
var _a, _b;
6534265342
return __awaiter(this, void 0, void 0, function* () {
65343-
// When setting AGENT_TOOLSDIRECTORY, the actions/tool-cache function find
65344-
// is not able to find the files cached by actions/python-version.
65343+
if (utils_1.IS_MAC) {
65344+
process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache';
65345+
}
6534565346
if ((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim()) {
6534665347
process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY'];
6534765348
}
65348-
core.debug(`Python is expected to be installed into RUNNER_TOOL_CACHE=${process.env['RUNNER_TOOL_CACHE']}`);
65349+
core.debug(`Python is expected to be installed into ${((_b = process.env.AGENT_TOOLSDIRECTORY) === null || _b === void 0 ? void 0 : _b.trim())
65350+
? process.env['AGENT_TOOLSDIRECTORY']
65351+
: process.env['RUNNER_TOOL_CACHE']}`);
6534965352
try {
6535065353
const version = resolveVersionInput();
6535165354
const checkLatest = core.getBooleanInput('check-latest');
@@ -65421,7 +65424,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
6542165424
return (mod && mod.__esModule) ? mod : { "default": mod };
6542265425
};
6542365426
Object.defineProperty(exports, "__esModule", ({ value: true }));
65424-
exports.logWarning = exports.getLinuxOSReleaseInfo = exports.isCacheFeatureAvailable = exports.isGhes = exports.validatePythonVersionFormatForPyPy = exports.writeExactPyPyVersionFile = exports.readExactPyPyVersionFile = exports.getPyPyVersionFromPath = exports.isNightlyKeyword = exports.validateVersion = exports.createSymlinkInFolder = exports.WINDOWS_PLATFORMS = exports.WINDOWS_ARCHS = exports.IS_LINUX = exports.IS_WINDOWS = void 0;
65427+
exports.logWarning = exports.getLinuxOSReleaseInfo = exports.isCacheFeatureAvailable = exports.isGhes = exports.validatePythonVersionFormatForPyPy = exports.writeExactPyPyVersionFile = exports.readExactPyPyVersionFile = exports.getPyPyVersionFromPath = exports.isNightlyKeyword = exports.validateVersion = exports.createSymlinkInFolder = exports.WINDOWS_PLATFORMS = exports.WINDOWS_ARCHS = exports.IS_MAC = exports.IS_LINUX = exports.IS_WINDOWS = void 0;
6542565428
const cache = __importStar(__nccwpck_require__(7799));
6542665429
const core = __importStar(__nccwpck_require__(2186));
6542765430
const fs_1 = __importDefault(__nccwpck_require__(7147));
@@ -65762,4 +65765,4 @@ module.exports = JSON.parse('["ac","com.ac","edu.ac","gov.ac","net.ac","mil.ac",
6576265765
/******/ module.exports = __webpack_exports__;
6576365766
/******/
6576465767
/******/ })()
65765-
;
65768+
;

src/setup-python.ts

+11-8
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ import * as path from 'path';
55
import * as os from 'os';
66
import fs from 'fs';
77
import {getCacheDistributor} from './cache-distributions/cache-factory';
8-
import {
9-
isCacheFeatureAvailable,
10-
logWarning,
11-
IS_MAC
12-
} from './utils';
8+
import {isCacheFeatureAvailable, logWarning, IS_MAC} from './utils';
139

1410
function isPyPyVersion(versionSpec: string) {
1511
return versionSpec.startsWith('pypy');
@@ -67,13 +63,20 @@ function resolveVersionInput(): string {
6763
}
6864

6965
async function run() {
70-
// When setting AGENT_TOOLSDIRECTORY, the actions/tool-cache function find
71-
// is not able to find the files cached by actions/python-version.
66+
if (IS_MAC) {
67+
process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache';
68+
}
69+
7270
if (process.env.AGENT_TOOLSDIRECTORY?.trim()) {
7371
process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY'];
7472
}
73+
7574
core.debug(
76-
`Python is expected to be installed into RUNNER_TOOL_CACHE=${process.env['RUNNER_TOOL_CACHE']}`
75+
`Python is expected to be installed into ${
76+
process.env.AGENT_TOOLSDIRECTORY?.trim()
77+
? process.env['AGENT_TOOLSDIRECTORY']
78+
: process.env['RUNNER_TOOL_CACHE']
79+
}`
7780
);
7881
try {
7982
const version = resolveVersionInput();

0 commit comments

Comments
 (0)