Repository navigation
fix(pace-cc): apply -fmacro-prefix-map on clang workers compiling preprocessed input - #1726
Merged
christianparpart merged 2 commits intoOct 22, 2026
Conversation
…ang=
pace-cc dispatches a compile as preprocessed text and forwarded the
client's -fmacro-prefix-map verbatim. clang's driver discards that flag
on preprocessed input ("argument unused during compilation") and never
hands it to -cc1, so __builtin_FILE() and std::source_location in a
clang worker's object named the client's absolute path, stored under the
key a mapped compile uses. gcc applies the plain spelling there.
The spelling a driver needs is now a DriverSpec column,
preprocessedSourceMapCarrier ("-Xclang=" for clang, fused so the worker
still judges one argument at a time). CarriedSourcePrefixMap is the one
exact carve-out from the -Xclang denial, asked inside FindDeniedArgument
so client and worker agree; the worker admits it only for the clang
driver. Bare -Xclang and -Xclang=<anything else> stay denied by row.
Covered by CmdLine, CompileJob and Dispatch cases and by
dist-compile-e2e case 7c, which compares a dispatched object with a
local one (a gcc leg is its control).
Signed-off-by: Christian Parpart <christian@parpart.family>
Retires every object a clang worker compiled under a -fmacro-prefix-map before the previous commit: those embed the client's absolute path under the mapped key, and nothing in a stored value says which entries are affected. The key construction is unchanged; the golden vectors move for the tag alone and objkey-v8 / manifest-v9 join the retired rows. Costs every user one cold rebuild. Signed-off-by: Christian Parpart <christian@parpart.family>
christianparpart
enabled auto-merge
October 22, 2026 21:03
christianparpart
deleted the
fix/clang-macro-prefix-map-on-preprocessed-input
branch
October 22, 2026 22:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Building contour through
pace-ccwith distributed compilation on, every dispatched clang compile printedThat warning is not noise.
pace-ccsends a worker preprocessed text and forwarded the client's-fmacro-prefix-mapverbatim. clang's driver drops that flag on preprocessed input and never hands it to-cc1, so__builtin_FILE()and everystd::source_locationin an object a clang worker compiled named the client's absolute path — and that object was stored under the key a mapped compile uses. A later hit on another machine (or another checkout) reproduces the wrong path. It is a wrong-object bug. gcc applies the plain spelling on preprocessed input, so gcc workers were unaffected.Fix
DriverSpec::preprocessedSourceMapCarrier(CmdLine.hpp) names the spelling each driver needs:-Xclang=for clang, none for gcc.RemoteCompileArgsemits-Xclang=-fmacro-prefix-map=<rule>for clang and the plain spelling for gcc. The fused-Xclang=form keeps the worker judging one argument at a time.CarriedSourcePrefixMapis the ONE exact carve-out from the-Xclangdenial. It is asked insideFindDeniedArgument(ArgumentDenials.hpp), so client and worker agree. The worker (JudgeBuiltIn,CompileJob.cpp) admits it only for the clang driver. Bare-Xclangand-Xclang=<anything else>stay denied by row..agent/rules/compile-cache.md.Cache generations bumped:
objkey-v9,manifest-v10(second commit). This retires the wrong objects already in caches, because nothing in a stored value says which entries are affected. The key construction is unchanged: the golden vectors move for the tag alone, andobjkey-v8/manifest-v9join the retired rows. Cost: every user does one cold rebuild after upgrading.A clang too old for
-Xclang=: the remote compile fails and is retried locally, so the cost is a lost dispatch rather than a wrong object.Verification
Measured on Linux:
pace-cc-tests: 1038 pass / 4 skip / 0 fail.pace-node-tests: 1541 pass / 2 skip / 0 fail.CmdLine_test,CompileJob_testandDispatch_test. New e2e case 7c inscripts/dist-compile-e2e.shchecks that a dispatched__builtin_FILE()matches a local compile's under the same map. It passes with clang++, where it is the regression test, and a g++ leg is its control.bash scripts/local-gate.shon the committed tree (second run, about 4.5 minutes incremental):LOCAL GATE PASSED. gate-clang-debug: 6929 of 6929. gate-gcc-release: 6928 of 6928, includingdist-compile-e2ewith g++. The first run failed. See the next section.Observed during the local gate
The first local gate run (about 17 minutes) failed on one test:
dist-compile-e2eon the gcc-release leg. The clang-debug leg passed, 6929 of 6929.Measured:
dist-compile-e2e FAILED: worker and launcher disagree on the toolchain fingerprint: '89774c206d5cea5704051af91f89689d' vs 'a069fc8108e5fb3adf1fd3be2f672f0c'.pace-ccon this machine (both gate trees, a dev tree,/usr/bin) givesa069…for/usr/bin/g++, and so does a hand-started gatepace-node. No compiler here (g++,c++,gcc,cc,clang++,clang,x86_64-redhat-linux-g++) produces89774c….DriverGrammarNameor schema change.Inferred, not shown: the worker derived a different fingerprint from its environment or toolchain survey at that moment, not because of this change. The passing re-runs do not explain the failure.
Tracked in #1727.