diff --git a/build/lib/nodeCompileCache.ts b/build/lib/nodeCompileCache.ts index 66dfaf4c1b50..988dc11a5e85 100644 --- a/build/lib/nodeCompileCache.ts +++ b/build/lib/nodeCompileCache.ts @@ -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 { diff --git a/src/vs/base/node/nodeCompileCache.ts b/src/vs/base/node/nodeCompileCache.ts index 7360775405bd..094fe385dddc 100644 --- a/src/vs/base/node/nodeCompileCache.ts +++ b/src/vs/base/node/nodeCompileCache.ts @@ -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,