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

Allow specific --only-binary and --no-binary packages to override :all: #4067

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Jun 5, 2024

Updates --no-binary <package> to take precedence over --only-binary :all: and --only-binary <package> to take precedence over --no-binary :all:.

I'm not entirely sure about this behavior, e.g. maybe I provided --only-binary :all: later on the command line and really want it to override those earlier arguments of --no-binary <package> for safety. Right now we just fail to solve though since we can't satisfy the overlapping requests.

Closes #4063

@zanieb
Copy link
Member Author

zanieb commented Jun 5, 2024

In the future, we may want to combine NoBuild and NoBinary into a single type to consolidate this logic.

edit: See #4284

}

/// Overlapping usage of `--no-binary` and `--only-binary`
// TODO(zanieb): We should have a better error message here
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to open an issue for this one

@zanieb zanieb requested a review from charliermarsh June 5, 2024 20:31
@zanieb zanieb marked this pull request as ready for review June 6, 2024 12:42
@zanieb zanieb requested a review from konstin June 10, 2024 14:30
// Allow `all` to be overridden by specific build exclusions
NoBuild::Packages(packages) => !packages.contains(&filename.name),
_ => true,
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we instead create a struct that couples NoBinary and NoBuild, and lets us query for the no_binary or no_build status, abstracting away this repeated logic? It seems really easy to miss a site as-is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we should totally do that as noted at #4067 (comment) but I'd rather do it in a follow-up.

I didn't want to invest in a refactor until we were on the same page about the behavior. I could do it here too if you think this makes sense.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the behavior seems ok. Do you want to do it in this PR or na?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really mind doing it here or at least writing the follow-up before merge.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #4284 — opted for a separate pull request for review purposes.

Copy link
Member

@konstin konstin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that merging the no binary and no build types would be a good idea

crates/uv-dispatch/src/lib.rs Show resolved Hide resolved
@zanieb zanieb merged commit 1ab4041 into main Jun 12, 2024
47 checks passed
@zanieb zanieb deleted the zb/only-no-binary branch June 12, 2024 20:47
zanieb added a commit that referenced this pull request Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Allow --no-binary <package> to override --only-binary :all:
3 participants