mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-09-10 16:57:56 -04:00
A CMake build runs cmake and then the build tool, but nothing in the UI
said what those steps actually were: the compiler pane's "All compilation
options" popover reports the per-file compile line, and the build system's
own invocations were invisible. When a project build fails in the configure
step, there was no way to see what was run.
Each build step already carried its arguments and exit code, so this adds
what was missing and puts it behind a button:
- `BuildStep.command`: the binary. `doBuildstepAndAddToResult` received
it but only ever stored the arguments, so `--build .` could not be
shown as a cmake invocation.
- `BuildStep.env`: what the step actually ran with. LD_LIBRARY_PATH is
taken from `ldPath` rather than `env`, because exec() overwrites the
inherited value with it before spawning -- reading `env` reports the
server's own, which is empty. PATH and HOME are left out as host state
rather than anything about the build, and empty values are dropped.
Both go through masking, which needed a new entry point. Env values hold
several paths in one string, and `-L/tmp/<prefix>X -Wl,-rpath,...` puts a
temp dir at the end of a token; maskRootdirKeepingAppPrefix() is built for
argv, where neither happens, so it masked one path in LDFLAGS and left
three. maskRootdirsInText() is global and treats a bare temp dir as a path.
The argv entry point is untouched.
The steps are shown in a modal rather than a popover: a command line plus
its environment is more than a popover holds, and a popover that dismisses
on outside mouseup is awkward to copy from. Step status comes from the exit
code alone -- calculateStatusIcon() reads any output as a warning, which
fits a compiler but would paint every successful cmake step orange.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0168db5wLwZMU9TtcbN9ZD6v