Skip to content

pyo3: make //toolchains:pyo3 publicly visible - #4217

Closed
georgew-arta wants to merge 1 commit into
bazelbuild:mainfrom
georgew-arta:pyo3-toolchains-public-visibility
Closed

pyo3: make //toolchains:pyo3 publicly visible#4217
georgew-arta wants to merge 1 commit into
bazelbuild:mainfrom
georgew-arta:pyo3-toolchains-public-visibility

Conversation

@georgew-arta

Copy link
Copy Markdown

//toolchains:pyo3 (the rust_library_group wrapping @rpyo3c//:pyo3) is the natural dependency for plain rust_library crates that link against pyo3 outside of a pyo3_extension — e.g. a shared bridge library consumed by several extensions.

Today the target is package-private, so consumers have to either hard-code the bzlmod canonical repo label (@@rules_rust_pyo3~~rust_ext~rpyo3c//:pyo3) or use_repo the internal rust_ext extension from //private:internal_extensions.bzl — both couple downstream workspaces to implementation details (canonical-name mangling, internal extension paths) that change across Bazel releases.

This makes the existing target publicly visible so it can serve as the supported label, one line:

rust_library_group(
    name = "pyo3",
    visibility = ["//visibility:public"],
    deps = ["@rpyo3c//:pyo3"],
)

🤖 Generated with Claude Code

`//toolchains:pyo3` (the `rust_library_group` wrapping `@rpyo3c//:pyo3`)
is the natural target for `rust_library` crates that need to link
against pyo3 outside of a `pyo3_extension` (e.g. a shared bridge
library used by several extensions). Today it is package-private, so
consumers are forced to hard-code the bzlmod canonical repo label
(`@@rules_rust_pyo3~~rust_ext~rpyo3c//:pyo3`) or `use_repo` the
internal `rust_ext` extension — both couple them to implementation
details that change across Bazel/bzlmod releases.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@google-cla

google-cla Bot commented Aug 10, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@georgew-arta
georgew-arta deleted the pyo3-toolchains-public-visibility branch August 10, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant