Skip to content

compiler: preserve C/C++ source basename in artifact identity - #331

Merged
codeandsolder-git-wrangler[bot] merged 6 commits into
mainfrom
port/upstream-c-filename-20261122
Nov 22, 2026
Merged

codeandsolder-git-wrangler[bot] merged 6 commits into
mainfrom
port/upstream-c-filename-20261122

Conversation

@codeandsolder

Copy link
Copy Markdown
Owner

Cherry-pick 5808192, 8d96278 and f4ba08d. Preserve canonical-native path handling and CUDA device intermediate reuse. Domain-separate affected artifact and direct-mode index keys so old direct entries cannot bypass the fix, with an explicit old-key regression. Validation pending.

saimskywalker and others added 6 commits November 22, 2026 16:53
The compiler records the source file name in the object (an STT_FILE
symbol on ELF), but the preprocessed output it is hashed from has no
line markers, so two sources that preprocess to the same text, such as
files that are entirely #ifdef'd out, ended up sharing one cache entry
and one of them got an object naming the other.

Hash the file name without its directory, so the same file still hits
across checkouts.

Closes mozilla#2959

(cherry picked from commit 5808192)
ptxas reads a .ptx file that nvcc names after the source, so identical
device code from two sources stopped sharing a cubin.

(cherry picked from commit 8d96278)
… file names

Move the choice of which inputs keep their file name in the hash key into
hashed_input_file_name, and check that cudafe++, PTX and cubin inputs with
the same content but different names hash the same, while C and CUDA
sources with different names still differ.

(cherry picked from commit f4ba08d)
@codeandsolder-git-wrangler
codeandsolder-git-wrangler Bot marked this pull request as ready for review November 22, 2026 16:37
@codeandsolder-git-wrangler
codeandsolder-git-wrangler Bot merged commit 468c7a1 into main Nov 22, 2026
13 checks passed
@codeandsolder-git-wrangler
codeandsolder-git-wrangler Bot deleted the port/upstream-c-filename-20261122 branch November 22, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants