Files
Luan Taraschi 99513c8778 Keep the /app/ prefix in the compilation options shown to the user (#9033)
Fixes #8648.

`maskRootdir` strips a leading `/app/`, so the "All compilation options"
popup shows the source as `example.cpp` while the compiler is handed
`/app/example.cpp`. The same line already shows `-I/app/include` and
`-o/app/output.s`, because those keep the prefix, so today it is
inconsistent with itself.

Checked against production before touching anything, compiling `const
char* f = __FILE__;`:

```
compilationOptions: ['-g', '-o', 'output.s', '-masm=intel', '-fno-verbose-asm', '-S', '-fdiagnostics-color=always', '-O0', 'example.cpp']
asm:                .string "/app/example.cpp"
```

That is what makes it worth fixing rather than cosmetic: `__FILE__` in
C, `file!()` in Rust and anything else that echoes the input path give
the user a value the popup contradicts.

The change adds `maskRootdirKeepingAppPrefix` and uses it in
`maskPathsInArgumentsForUser`, which is the only caller feeding that
popup. Output lines keep going through `maskRootdir`, so diagnostics are
untouched.

`npm run check` passes here except for the Maven Kotlin test, which
fails the same way on a clean checkout on this machine (symlink realpath
on Windows).

One part of the issue I did not fix: the
`/nosym/tmp/compiler-explorer-.../example.rs` path reported on the first
compilation. `maskRootdir` handles that shape correctly when I feed it
directly, so it looks like a result that never reaches the masking, and
I could not reproduce it.
2026-08-24 20:02:42 -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