Log build output
Show source distribution build output in debug (-v) logging.
Example output for uv pip install --no-cache-dir --no-binary :all: -v tqdm 2> stderr.txt: gist.
I'd suggest taking hierarchical layer out of the default -v, i find the indentation makes it hard to read and the spans are generally not that informative compare to the actual log messages.
I've also added anstream filtering to the log output after seeing ansi codes in my log files.
Fixes #2146 Partially addresses #1567 - It doesn't show output while compiling but only after. We can consider i meanwhile but this is a much larger project due to complexity around pipes.
My gut is that this needs to be streamed in order to be useful, even though it makes it much more complex. Otherwise, it still feels like uv is hanging and you don't have clarity into what's going on or why.
For the interactive use case, yes, 99% of the value is in streaming it. I do think there are some benefits to having it available for later review in contexts like CI logs, even if it's printed in batch.
Can't this forward the TTY info? At least when streaming is supported, but it seems like it might make sense to do it correctly now? Scikit-build-core is careful to produce nicely colored output if printing to a console, and it works with build. If you direct to file, then it doesn't produce the ansi codes. pip processes the output and messes with it (not a fan), so it doesn't work there, it can't detect that it's a terminal or get the width. Also GHA supports ANSI codes.
The main challenge is that we build in parallel. We can't plain forward the output as a single tenant builder like scikit-build-core can, we need to somehow wrap them with context. I'd love to have something like docker buildx which gives tmux-like windows into the build process, but that seems out of scope. I agree that i would be nice to preserve colours, especially for stderr.
IMO, uv pip install . and uv pip install -e . could be treated specially - you usually want the output for those. Not sure if that would help, and it wouldn't solve the general case, but just a thought. (You also don't want to cache them, which I've run into uv pip install . doing).
FWIW, pip's model for local package builds is that it doesn't cache anything about them -- they get rebuilt + reinstalled on every run.