Skip to content

fix: pip_compile: Forward target compatibility to *.update#3787

Open
castler wants to merge 1 commit into
bazel-contrib:mainfrom
castler:target_compatible_with_for_pip_compile_update
Open

fix: pip_compile: Forward target compatibility to *.update#3787
castler wants to merge 1 commit into
bazel-contrib:mainfrom
castler:target_compatible_with_for_pip_compile_update

Conversation

@castler
Copy link
Copy Markdown
Contributor

@castler castler commented May 18, 2026

With this changset we enable users to build and test //... in their repositories also with platforms that do not support Python.

For example, a user might use Python for tooling and automation, where he develops only on Linux. Then he could set target_compatible_with to @platforms//os:linux, but he uses C++ for his production code. Where he crosscompiles to other operating systems (e.g. QNX, TriCore).

In order to enable this, we need to forward target_compatible_with also to the also to the also to the*.update` target.

@castler castler requested review from aignas and rickeylev as code owners May 18, 2026 06:41
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request modifies pip_compile.bzl to pass the target_compatible_with attribute to the .update target. Feedback indicates that using None as a default value for this attribute will trigger a Bazel type error, as a list is expected. Additionally, the reviewer suggested forwarding the testonly attribute to ensure the target remains compatible with its dependencies.

Comment thread python/private/pypi/pip_compile.bzl Outdated
@castler castler force-pushed the target_compatible_with_for_pip_compile_update branch from 9b046e8 to 3620848 Compare May 18, 2026 06:45
With this changset we enable users to build and test `//...` in their
repositories also with platforms that do not support Python.

For example, a user might use Python for tooling and automation, where
he develops only on Linux. Then he could set `target_compatible_with` to
`@platforms//os:linux`, but he uses C++ for his production code. Where
he crosscompiles to other operating systems (e.g. QNX, TriCore).

In order to enable this, we need to forward `target_compatible_with`
also to the ` also to the  also to the `*.update` target.
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