Skip to content

Commit 7151290

Browse files
kinkedlang-bot
authored andcommitted
Don't rebuild build.d for PGO builds
And don't assume the current working dir is the DMD repo.
1 parent 2d6b526 commit 7151290

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: src/build.d

+4-4
Original file line numberDiff line numberDiff line change
@@ -601,10 +601,10 @@ alias dmdPGO = makeRule!((builder, rule) {
601601
.condition(() => PGOState.checkPGO(dmdKind))
602602
.deps([finalDataMerge])
603603
.commandFunction({
604-
auto addArgs = pgoState.pgoUseFlags ~ "-wi";
605-
auto cmd = [env["HOST_DMD_RUN"], "-run", "src/build.d", "ENABLE_RELEASE=1",
606-
"ENABLE_LTO=1",
607-
"DFLAGS="~joiner(addArgs, " ").to!string, "--force", "-j"~jobs.to!string];
604+
const extraFlags = pgoState.pgoUseFlags ~ "-wi";
605+
const scope cmd = [thisExePath, "HOST_DMD="~env["HOST_DMD_RUN"],
606+
"ENABLE_RELEASE=1", "ENABLE_LTO=1", "DFLAGS="~extraFlags.join(" "),
607+
"--force", "-j"~jobs.to!string];
608608
log("%-(%s %)", cmd);
609609
if (spawnProcess(cmd, null, Config.init).wait())
610610
abortBuild("PGO Compilation failed");

0 commit comments

Comments
 (0)