Skip to content

Commit eebbe3f

Browse files
committed
skip toolchain cache on windows
1 parent 54ae0a2 commit eebbe3f

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

dist/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45100,6 +45100,7 @@ const child_process_1 = __nccwpck_require__(35317);
4510045100
const fs_1 = __nccwpck_require__(79896);
4510145101
const promises_1 = __nccwpck_require__(91943);
4510245102
const path = tslib_1.__importStar(__nccwpck_require__(16928));
45103+
const process_1 = __nccwpck_require__(932);
4510345104
const cache_1 = __nccwpck_require__(26619);
4510445105
const cargo_1 = __nccwpck_require__(21253);
4510545106
const lib_1 = __nccwpck_require__(71374);
@@ -45194,7 +45195,11 @@ async function prepareToolchain(startTime, toolchain, additionalComponents = [],
4519445195
return hadToInstall;
4519545196
};
4519645197
await core.group(`Preparing toolchain ${toolchain}: ${(0, lib_1.timeSinceStart)(startTime)}`, async () => {
45197-
const cachePrefixFinal = cachePrefix == 'no-cache' ? undefined : cachePrefix;
45198+
let cachePrefixFinal = cachePrefix == 'no-cache' ? undefined : cachePrefix;
45199+
if (process_1.platform === 'win32') {
45200+
// It's faster to install without caching on Windows
45201+
cachePrefixFinal = undefined;
45202+
}
4519845203
const hostTriple = await getHostTriple();
4519945204
const toolchains = await listToolchains();
4520045205
const toolchainPath = path.join(cargo_1.Cargo.rustupHome(), 'toolchains', `${toolchain}-${hostTriple}`);

src/rustup.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { execSync } from 'child_process';
55
import { existsSync } from 'fs';
66
import { readdir } from 'fs/promises';
77
import * as path from 'path';
8+
import { platform } from 'process';
89
import { generateCacheKey, restoreFromCache } from './cache';
910
import { Cargo } from './cargo';
1011
import { timeSinceStart } from './lib';
@@ -130,9 +131,14 @@ export async function prepareToolchain(
130131
await core.group(
131132
`Preparing toolchain ${toolchain}: ${timeSinceStart(startTime)}`,
132133
async () => {
133-
const cachePrefixFinal =
134+
let cachePrefixFinal =
134135
cachePrefix == 'no-cache' ? undefined : cachePrefix;
135136

137+
if (platform === 'win32') {
138+
// It's faster to install without caching on Windows
139+
cachePrefixFinal = undefined;
140+
}
141+
136142
const hostTriple = await getHostTriple();
137143
const toolchains = await listToolchains();
138144
const toolchainPath = path.join(

0 commit comments

Comments
 (0)