python3Packages.ruff: reuse already built ruff binary#412112
Merged
GaetanLepage merged 1 commit intoNixOS:masterfrom May 30, 2025
Merged
python3Packages.ruff: reuse already built ruff binary#412112GaetanLepage merged 1 commit intoNixOS:masterfrom
GaetanLepage merged 1 commit intoNixOS:masterfrom
Conversation
df221ed to
e6ddb98
Compare
Contributor
GaetanLepage
left a comment
There was a problem hiding this comment.
This is a great idea! It could be done for uv too.
Is the PR ready?
Contributor
Author
|
@GaetanLepage I haven't been home since I filed the PR, give me a few more hours. It's missing a symlink in the correct location. |
The maturin build system cannot see that we already build the ruff binary in nixpkgs. This leads to the ruff binary being rebuilt and placed inside of the resulting Python package. Every nixpkgs-review that passes through the `pkgs.ruff` package therefore builds `ruff` 3 times per architecture. Said binary was never even used due to the patching that already occurs in `find_ruff_bin`. Especially with how time-consuming release builds can be in Rust, there is no reason to keep this package in this state. master: `nix-build -A python3Packages.ruff` - `0.44s user 0.28s system 0% cpu 5:09.64 total` branch: `nix-build -A python3Packages.ruff` - `0.36s user 0.12s system 9% cpu 4.856 total`
e6ddb98 to
cf311ad
Compare
Contributor
Author
|
13 tasks
Prince213
approved these changes
May 30, 2025
Member
Prince213
left a comment
There was a problem hiding this comment.
Built on x86_64-linux and build logs LGTM
kirillrdy
approved these changes
May 30, 2025
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The maturin build system cannot see that we already build the ruff binary in nixpkgs. This leads to the ruff binary being rebuilt and placed inside of the resulting Python package. Every nixpkgs-review that passes through the
pkgs.ruffpackage therefore buildsruff3 times per architecture. Said binary was never even used due to the patching that already occurs infind_ruff_bin.Especially with how time-consuming release builds can be in Rust, there is no reason to keep this package in this state.
master:
nix-build -A python3Packages.ruff-0.44s user 0.28s system 0% cpu 5:09.64 totalbranch:
nix-build -A python3Packages.ruff-0.36s user 0.12s system 9% cpu 4.856 totalStill requires a symlink at the appropriate place that points at the ruff binary; I'll get to it later today.Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.