Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log build output #2156

Closed
wants to merge 1 commit into from
Closed

Log build output #2156

wants to merge 1 commit into from

Conversation

konstin
Copy link
Member

@konstin konstin commented Mar 4, 2024

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.

@konstin konstin force-pushed the konsti/log-build-output branch from ec88848 to c0eb764 Compare March 7, 2024 10:28
@charliermarsh
Copy link
Member

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.

@alex
Copy link
Contributor

alex commented Mar 8, 2024

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.

@konstin konstin added the tracing Verbose output and debugging label Mar 10, 2024
@konstin konstin force-pushed the konsti/log-build-output branch 3 times, most recently from b6a0c27 to 84780b1 Compare March 22, 2024 11:50
@konstin konstin force-pushed the konsti/log-build-output branch from 84780b1 to 0098da7 Compare March 22, 2024 15:20
@henryiii
Copy link
Contributor

henryiii commented Apr 2, 2024

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.

@konstin
Copy link
Member Author

konstin commented Apr 2, 2024

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.

@henryiii
Copy link
Contributor

henryiii commented Apr 2, 2024

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).

@pradyunsg
Copy link

FWIW, pip's model for local package builds is that it doesn't cache anything about them -- they get rebuilt + reinstalled on every run.

@charliermarsh
Copy link
Member

Should be handled by #6903.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tracing Verbose output and debugging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Verbosity level to see output from build backend
5 participants