From 7835f995b0fe53d3893f543172d7b1bb0a76bb65 Mon Sep 17 00:00:00 2001 From: Sergey Dolin Date: Fri, 6 May 2022 09:26:48 +0500 Subject: [PATCH] Exclude windows from the fix --- dist/setup/index.js | 6 ++++-- src/setup-python.ts | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index e978190c5..aeb09ef34 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -6085,14 +6085,16 @@ function cacheDependencies(cache, pythonVersion) { function run() { var _a; return __awaiter(this, void 0, void 0, function* () { + // According to the README windows binaries do not require to be installed + // in the specific location, but Mac and Linux do if (!utils_1.IS_WINDOWS && !((_a = process.env.AGENT_TOOLSDIRECTORY) === null || _a === void 0 ? void 0 : _a.trim())) { if (utils_1.IS_LINUX) process.env['AGENT_TOOLSDIRECTORY'] = '/opt/hostedtoolcache'; else process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache'; + process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY']; } - core.debug(`Python is expected to be installed into AGENT_TOOLSDIRECTORY=${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']}`); try { const version = core.getInput('python-version'); if (version) { diff --git a/src/setup-python.ts b/src/setup-python.ts index 5636a95f3..81e6911d2 100644 --- a/src/setup-python.ts +++ b/src/setup-python.ts @@ -22,14 +22,16 @@ async function cacheDependencies(cache: string, pythonVersion: string) { } async function run() { + // According to the README windows binaries do not require to be installed + // in the specific location, but Mac and Linux do if (!IS_WINDOWS && !process.env.AGENT_TOOLSDIRECTORY?.trim()) { if (IS_LINUX) process.env['AGENT_TOOLSDIRECTORY'] = '/opt/hostedtoolcache'; else process.env['AGENT_TOOLSDIRECTORY'] = '/Users/runner/hostedtoolcache'; + process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY']; } core.debug( - `Python is expected to be installed into AGENT_TOOLSDIRECTORY=${process.env['AGENT_TOOLSDIRECTORY']}` + `Python is expected to be installed into RUNNER_TOOL_CACHE=${process.env['RUNNER_TOOL_CACHE']}` ); - process.env['RUNNER_TOOL_CACHE'] = process.env['AGENT_TOOLSDIRECTORY']; try { const version = core.getInput('python-version'); if (version) {