@@ -65943,9 +65943,9 @@ class PipCache extends cache_distributor_1.default {
65943
65943
let primaryKey = '';
65944
65944
let restoreKey = '';
65945
65945
if (utils_1.IS_LINUX) {
65946
- const osRelease = yield utils_1.getLinuxOSReleaseInfo ();
65947
- primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${osRelease }-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
65948
- restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${osRelease }-python-${this.pythonVersion}-${this.packageManager}`;
65946
+ const osInfo = yield utils_1.getLinuxInfo ();
65947
+ primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${osInfo.osVersion}-${osInfo.osName }-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
65948
+ restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${osInfo.osVersion}-${osInfo.osName }-python-${this.pythonVersion}-${this.packageManager}`;
65949
65949
}
65950
65950
else {
65951
65951
primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
@@ -66401,8 +66401,11 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest
66401
66401
}
66402
66402
}
66403
66403
if (!installDir) {
66404
+ const osInfo = yield utils_1.getOSInfo();
66404
66405
throw new Error([
66405
- `Version ${version} with arch ${architecture} not found`,
66406
+ `The version '${version}' with architecture '${architecture}' was not found for ${osInfo
66407
+ ? `${osInfo.osName} ${osInfo.osVersion}`
66408
+ : 'this operating system'}.`,
66406
66409
`The list of all available versions can be found here: ${installer.MANIFEST_URL}`
66407
66410
].join(os.EOL));
66408
66411
}
@@ -66975,7 +66978,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
66975
66978
return (mod && mod.__esModule) ? mod : { "default": mod };
66976
66979
};
66977
66980
Object.defineProperty(exports, "__esModule", ({ value: true }));
66978
- 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;
66981
+ exports.getOSInfo = exports.getLinuxInfo = exports.logWarning = 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;
66979
66982
const cache = __importStar(__nccwpck_require__(7799));
66980
66983
const core = __importStar(__nccwpck_require__(2186));
66981
66984
const fs_1 = __importDefault(__nccwpck_require__(7147));
@@ -67066,22 +67069,64 @@ function isCacheFeatureAvailable() {
67066
67069
return true;
67067
67070
}
67068
67071
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
67069
- function getLinuxOSReleaseInfo() {
67072
+ function logWarning(message) {
67073
+ const warningPrefix = '[warning]';
67074
+ core.info(`${warningPrefix}${message}`);
67075
+ }
67076
+ exports.logWarning = logWarning;
67077
+ function getWindowsInfo() {
67070
67078
return __awaiter(this, void 0, void 0, function* () {
67071
- const { stdout, stderr, exitCode } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'] , {
67079
+ const { stdout } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', undefined , {
67072
67080
silent: true
67073
67081
});
67074
- const [osRelease, osVersion] = stdout.trim().split('\n');
67075
- core.debug(`OS Release: ${osRelease}, Version: ${osVersion}`);
67076
- return `${osVersion}-${osRelease}`;
67082
+ const windowsVersion = stdout.trim().split(' ')[3];
67083
+ return { osName: 'Windows', osVersion: windowsVersion };
67077
67084
});
67078
67085
}
67079
- exports.getLinuxOSReleaseInfo = getLinuxOSReleaseInfo;
67080
- function logWarning(message) {
67081
- const warningPrefix = '[warning]';
67082
- core.info(`${warningPrefix}${message}`);
67086
+ function getMacOSInfo() {
67087
+ return __awaiter(this, void 0, void 0, function* () {
67088
+ const { stdout } = yield exec.getExecOutput('sw_vers', ['-productVersion'], {
67089
+ silent: true
67090
+ });
67091
+ const macOSVersion = stdout.trim();
67092
+ return { osName: 'macOS', osVersion: macOSVersion };
67093
+ });
67083
67094
}
67084
- exports.logWarning = logWarning;
67095
+ function getLinuxInfo() {
67096
+ return __awaiter(this, void 0, void 0, function* () {
67097
+ const { stdout } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {
67098
+ silent: true
67099
+ });
67100
+ const [osName, osVersion] = stdout.trim().split('\n');
67101
+ core.debug(`OS Name: ${osName}, Version: ${osVersion}`);
67102
+ return { osName: osName, osVersion: osVersion };
67103
+ });
67104
+ }
67105
+ exports.getLinuxInfo = getLinuxInfo;
67106
+ function getOSInfo() {
67107
+ return __awaiter(this, void 0, void 0, function* () {
67108
+ let osInfo;
67109
+ try {
67110
+ if (exports.IS_WINDOWS) {
67111
+ osInfo = yield getWindowsInfo();
67112
+ }
67113
+ else if (exports.IS_LINUX) {
67114
+ osInfo = yield getLinuxInfo();
67115
+ }
67116
+ else if (exports.IS_MAC) {
67117
+ osInfo = yield getMacOSInfo();
67118
+ }
67119
+ }
67120
+ catch (err) {
67121
+ const error = err;
67122
+ core.debug(error.message);
67123
+ }
67124
+ finally {
67125
+ return osInfo;
67126
+ }
67127
+ });
67128
+ }
67129
+ exports.getOSInfo = getOSInfo;
67085
67130
67086
67131
67087
67132
/***/ }),
0 commit comments