Skip to content

Build wheels from Bazel toolchains rather than system installed dependencies #3006

Closed as duplicate

Description

@samkellett

🚀 feature request

Relevant Rules

The pip repository and pip_compile.

Description

We have a few wheels that need to be compiled (eg. cocotb and apytypes). These require certain tools to be available on the PATH. For example cocotb requires clang to be available and apytypes requires cmake. Both of these are available hermetically via Bazel but I don't see how I can expose those toolchains to rules_python and pip to use when building these packages.

Describe the solution you'd like

Some way of passing in toolchains like how genrule does and then a mapping of make variable to tool that can be made available on $PATH when building the wheels.

Describe alternatives you've considered

So far we just end up having to have a full C++ toolchain installed on every dev machine which defeats the purpose of trying to have everything to be self contained, reproducible and hermetic inside of our monorepo.

Activity

  1. aignas commented on Jun 19, 2025

    @aignas
    Collaborator

    Thanks, the pip repository rule work is tracked in #2410 and the pip_compile or lock rules may be able to partially use build actions, but it is a much harder problem and it is currently out of scope. The best way for now is to build the wheels for those tools separately and upload it to your private wheel index.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions