Files
cb1d043257 Mask temp paths on the compilation cache-hit path (#9057)
### The bug

`cachePut()` stores the compilation result **before** `cleanupResult()`
masks it, and the cache-hit path returns the stored value directly. So
we cache an unmasked result, and every subsequent hit serves it
verbatim.

### What you see

The compilation-options popover shows a different command line for a
warm compile than for a cold one of the same input, naming a temp dir
that belonged to an unrelated earlier request:

```
cold:  -o output.s ... example.cpp
warm:  -o /tmp/compiler-explorer-compilerAbC123/output.s ... /tmp/compiler-explorer-compilerAbC123/example.cpp
```

`inputFilename` gets the same treatment, since `cleanupResult()` masks
both.

Cosmetic rather than a disclosure problem: the temp dir name isn't
sensitive. The reason it's worth fixing is that it means the masking
added in #9033 only ever takes effect on cold compiles, so on a warm
instance most users see the unmasked form.

### The fix

Move `cleanupResult()` above `cachePut()`, so what we store is what we'd
have shown. One statement, no new call site.

Nothing between the two positions reads the fields being masked: the
intervening block only touches `result.execResult` and its
`buildResult`.

### Scope

This covers the main compilation cache path. Two other `cachePut()` call
sites exist, and I have **not** verified them here: the execution cache,
and the cmake `fullResult` path (which caches with `delayCaching` and
whose inner `fullResult.result.compilationOptions` isn't reached by
`cleanupResult()` anyway, since that only masks top level). Worth a look
separately.

Also still unmasked on every path: `irOutput.compilationOptions` and
`optPipelineOutput.compilationOptions`. Being handled as part of the
review of #8960, which adds the panes that surface them.

### On existing cache entries

No migration concern. Cache entries live under `cache/` in
`storage.godbolt.org`, which has a lifecycle rule expiring them after 1
day (`terraform/s3.tf`, "Remove cached items"), so anything cached
unmasked before this ships ages out by itself.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: mattgodbolt-molty <mattgodbolt-molty@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 19:41:35 -05:00
..
2026-07-14 08:46:10 +01:00
2021-10-05 01:45:05 +02:00
2019-08-21 01:26:16 +02:00
2025-01-29 10:41:03 -06:00
2021-09-13 20:22:27 +02:00
2024-10-26 17:42:22 +02:00
2024-03-08 22:25:09 -06:00
2024-03-08 22:25:09 -06:00
2024-03-08 22:25:09 -06:00
2026-02-08 12:50:20 +01:00
2024-03-08 22:25:09 -06:00