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
This commit is contained in:
Leon Wright 2022-07-22 16:03:42 +08:00
parent 467a981225
commit bc8ee42330
No known key found for this signature in database
GPG key ID: 95F5A1DE99BFCA3D
2 changed files with 20 additions and 14 deletions

15
dist/setup/index.js vendored
View file

@ -65338,14 +65338,17 @@ function resolveVersionInput() {
return version; return version;
} }
function run() { function run() {
var _a; var _a, _b;
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
// When setting AGENT_TOOLSDIRECTORY, the actions/tool-cache function find if (utils_1.IS_MAC) {
// is not able to find the files cached by actions/python-version. process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache';
}
if ((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim()) { if ((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim()) {
process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY']; process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY'];
} }
core.debug(`Python is expected to be installed into RUNNER_TOOL_CACHE=${process.env['RUNNER_TOOL_CACHE']}`); core.debug(`Python is expected to be installed into ${((_b = process.env.AGENT_TOOLSDIRECTORY) === null || _b === void 0 ? void 0 : _b.trim())
? process.env['AGENT_TOOLSDIRECTORY']
: process.env['RUNNER_TOOL_CACHE']}`);
try { try {
const version = resolveVersionInput(); const version = resolveVersionInput();
const checkLatest = core.getBooleanInput('check-latest'); const checkLatest = core.getBooleanInput('check-latest');
@ -65421,7 +65424,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
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; 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;
const cache = __importStar(__nccwpck_require__(7799)); const cache = __importStar(__nccwpck_require__(7799));
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
const fs_1 = __importDefault(__nccwpck_require__(7147)); 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",
/******/ module.exports = __webpack_exports__; /******/ module.exports = __webpack_exports__;
/******/ /******/
/******/ })() /******/ })()
; ;

View file

@ -5,11 +5,7 @@ import * as path from 'path';
import * as os from 'os'; import * as os from 'os';
import fs from 'fs'; import fs from 'fs';
import {getCacheDistributor} from './cache-distributions/cache-factory'; import {getCacheDistributor} from './cache-distributions/cache-factory';
import { import {isCacheFeatureAvailable, logWarning, IS_MAC} from './utils';
isCacheFeatureAvailable,
logWarning,
IS_MAC
} from './utils';
function isPyPyVersion(versionSpec: string) { function isPyPyVersion(versionSpec: string) {
return versionSpec.startsWith('pypy'); return versionSpec.startsWith('pypy');
@ -67,13 +63,20 @@ function resolveVersionInput(): string {
} }
async function run() { async function run() {
// When setting AGENT_TOOLSDIRECTORY, the actions/tool-cache function find if (IS_MAC) {
// is not able to find the files cached by actions/python-version. process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache';
}
if (process.env.AGENT_TOOLSDIRECTORY?.trim()) { if (process.env.AGENT_TOOLSDIRECTORY?.trim()) {
process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY']; process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY'];
} }
core.debug( core.debug(
`Python is expected to be installed into RUNNER_TOOL_CACHE=${process.env['RUNNER_TOOL_CACHE']}` `Python is expected to be installed into ${
process.env.AGENT_TOOLSDIRECTORY?.trim()
? process.env['AGENT_TOOLSDIRECTORY']
: process.env['RUNNER_TOOL_CACHE']
}`
); );
try { try {
const version = resolveVersionInput(); const version = resolveVersionInput();