Skip to content

Commit

Permalink
Allow a custom visibility so long as at least one version is public
Browse files Browse the repository at this point in the history
Summary:
The `visibility` config is limited to public packages because that's the
only place it makes sense. But it's possible for a package to have one
version public and other versions private (by virtue of being transitive
deps) - like in [this post][1].

[1]: https://fb.workplace.com/groups/rust.language/posts/27084881544467104

Reviewed By: diliop

Differential Revision: D63963530

fbshipit-source-id: 4a04ebbb355fa8e8f44ea6d041bba48dc5cfa62d
  • Loading branch information
zertosh authored and facebook-github-bot committed Oct 7, 2024
1 parent 601f551 commit 4e86f7b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/fixups.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ impl<'meta> Fixups<'meta> {
fixup
};

if fixup_config.custom_visibility.is_some() && !index.is_public_package(package) {
if fixup_config.custom_visibility.is_some() && !index.is_public_package_name(&package.name)
{
return Err(anyhow!(
"only public packages can have a fixup `visibility`."
))
Expand Down

0 comments on commit 4e86f7b

Please sign in to comment.