From b7100c718804358cd17f4ec5131378a014037ea6 Mon Sep 17 00:00:00 2001 From: Linghong Date: Mon, 14 Sep 2026 08:58:31 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=94=A8=E6=88=B7=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E8=B7=AF=E5=BE=84=E6=8E=A2=E6=B5=8B=20sccache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Windows wrapper 探测改用显式配置的可执行路径 将 wrapper 路径纳入探测缓存键 --- scripts/dev.mjs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/dev.mjs b/scripts/dev.mjs index ebedfea92..bca97def5 100644 --- a/scripts/dev.mjs +++ b/scripts/dev.mjs @@ -148,7 +148,7 @@ function applyLocalFfmpegEnv(env, platform = process.platform) { const localSccacheProbeCache = new Map(); -function resolveLocalDevRustcWrapperBypass(options = {}) { +function resolveLocalDevRustcWrapperBypass(configuredWrapper, options = {}) { if (process.platform !== 'win32') { return '/usr/bin/env'; } @@ -156,13 +156,13 @@ function resolveLocalDevRustcWrapperBypass(options = {}) { const sccacheAvailable = options.sccacheAvailable ?? (() => { - const cacheKey = `${process.platform}:sccache`; + const cacheKey = `${process.platform}:${configuredWrapper}`; const cached = localSccacheProbeCache.get(cacheKey); if (cached !== undefined) { return cached; } - const result = spawnSync('sccache', ['rustc', '-vV'], { + const result = spawnSync(configuredWrapper, ['rustc', '-vV'], { cwd: repoRoot, encoding: 'utf8', shell: true, @@ -628,7 +628,7 @@ function buildLocalRustProcessEnv(env, options = {}) { } const rustcWrapper = configuredWrapper - ? resolveLocalDevRustcWrapperBypass(options) + ? resolveLocalDevRustcWrapperBypass(configuredWrapper, options) : ''; mergedEnv.RUSTC_WRAPPER = rustcWrapper; mergedEnv.CARGO_BUILD_RUSTC_WRAPPER = rustcWrapper;