mirror of
https://github.com/microsoft/vscode.git
synced 2026-10-01 11:32:08 +01:00
chore: disable read only compile cache on posix (#338140)
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user