Skip to content

Commit 304463d

Browse files
committed
fix: preserve PCM when LLVM setup is unchanged
1 parent fcd8296 commit 304463d

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎src/moduleSetup.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ export function mcppModuleSetupCommands(plan: ModuleSetupPlan): ModuleSetupComma
7575
args: ["toolchain", "default", "llvm"],
7676
});
7777
}
78-
commands.push({ stage: "build", mode: "task", args: ["build", "--no-cache"] });
78+
const buildArgs = plan.installLlvm || plan.switchDefault
79+
? ["build", "--no-cache"]
80+
: ["build"];
81+
commands.push({ stage: "build", mode: "task", args: buildArgs });
7982
return commands;
8083
}
8184

‎test/moduleSetup.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ test("阻止原因按未信任、未知清单、忙碌、项目覆盖的顺序
210210
);
211211
});
212212

213-
test("模块设置命令使用固定 argv 数组且始终构建", () => {
213+
test("模块设置命令仅在工具链变化时清缓存", () => {
214214
assert.deepEqual(
215215
mcppModuleSetupCommands({ kind: "ready", installLlvm: true, switchDefault: true }),
216216
[
@@ -221,7 +221,7 @@ test("模块设置命令使用固定 argv 数组且始终构建", () => {
221221
);
222222
assert.deepEqual(
223223
mcppModuleSetupCommands({ kind: "ready", installLlvm: false, switchDefault: false }),
224-
[{ stage: "build", mode: "task", args: ["build", "--no-cache"] }],
224+
[{ stage: "build", mode: "task", args: ["build"] }],
225225
);
226226
});
227227

0 commit comments

Comments
 (0)