chore: disable read only compile cache on posix (#338140)

This commit is contained in:
Robo
2026-09-26 20:31:35 +00:00
committed by GitHub
parent f20d8d9f7a
commit 157fc59ed6
2 changed files with 17 additions and 4 deletions
+2 -1
View File
@@ -29,7 +29,8 @@ export function shouldGenerateNodeCompileCache(platform: string, arch: string, p
return false;
}
return platform === 'darwin' ? arch === 'arm64' : (platform === 'linux' || platform === 'win32') && arch === 'x64';
// TODO: Re-enable POSIX caches once the runtime fixes portable caching with eager/read-only options.
return platform === 'win32' && arch === 'x64';
}
export function getNodeCompileCachePaths(platform: string, outputDirectory: string, versionedResourcesFolder: string, product: INodeCompileCacheProduct): INodeCompileCachePaths {
+15 -3
View File
@@ -50,9 +50,6 @@ export function enableNodeCompileCache(kind: NodeCompileCacheKind): boolean {
enabledKind = kind;
process.env['VSCODE_NODE_COMPILE_CACHE_ROOT'] = getNodeCompileCacheRoot();
const cacheDirectory = getNodeCompileCacheDirectory(kind);
const isGeneratingCache = process.env['VSCODE_GENERATE_NODE_COMPILE_CACHE'] === '1';
const runtimeCachePrefix = `${process.version}-${process.arch}-`;
const hasRuntimeCache = fs.existsSync(cacheDirectory) && fs.readdirSync(cacheDirectory).some(entry => entry.startsWith(runtimeCachePrefix));
if (process.env['VSCODE_DEV']) {
setNodeCompileCacheStatus({
@@ -64,6 +61,21 @@ export function enableNodeCompileCache(kind: NodeCompileCacheKind): boolean {
return false;
}
// TODO: Re-enable POSIX caches once the runtime fixes portable caching with eager/read-only options.
if (process.platform !== 'win32') {
setNodeCompileCacheStatus({
kind,
status: 'disabled',
configuredDirectory: cacheDirectory,
isPackagedCacheEnabled: false
});
return false;
}
const isGeneratingCache = process.env['VSCODE_GENERATE_NODE_COMPILE_CACHE'] === '1';
const runtimeCachePrefix = `${process.version}-${process.arch}-`;
const hasRuntimeCache = fs.existsSync(cacheDirectory) && fs.readdirSync(cacheDirectory).some(entry => entry.startsWith(runtimeCachePrefix));
if (!isGeneratingCache && !hasRuntimeCache) {
setNodeCompileCacheStatus({
kind,