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-02 18:26:35 +01:00
2025-07-28 10:34:46 -05:00
2026-05-23 14:47:16 +03:00