From 95fcfbbe195c4f8044cc17e197d9bfd248f53dab Mon Sep 17 00:00:00 2001 From: Jan Schlosser Date: Mon, 18 May 2026 09:30:22 +0200 Subject: [PATCH 1/2] pip_compile: Forward target compatibility to *.update 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. --- CHANGELOG.md | 2 ++ python/private/pypi/pip_compile.bzl | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db173447ae..38fca38591 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -84,6 +84,8 @@ END_UNRELEASED_TEMPLATE path separators; the bootstrap stub is now declared as a sibling of the `.exe` launcher ([#3789](https://github.com/bazel-contrib/rules_python/issues/3789)). +* Fix the forwarding of `target_compatible_with` from `compile_pip_requirements` + towards the underlying `*.update` target {#v0-0-0-added} diff --git a/python/private/pypi/pip_compile.bzl b/python/private/pypi/pip_compile.bzl index 28923005df..3ef2cdb39c 100644 --- a/python/private/pypi/pip_compile.bzl +++ b/python/private/pypi/pip_compile.bzl @@ -173,6 +173,7 @@ def pip_compile( name = name + ".update", env = env, python_version = kwargs.get("python_version", None), + target_compatible_with = kwargs.get("target_compatible_with", []), **attrs ) From bb55b0575b77481c7bb2149d17027eea14fa34b4 Mon Sep 17 00:00:00 2001 From: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Date: Wed, 20 May 2026 15:15:56 +0900 Subject: [PATCH 2/2] Apply suggestion from @aignas --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38fca38591..0615801885 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -85,7 +85,8 @@ END_UNRELEASED_TEMPLATE `.exe` launcher ([#3789](https://github.com/bazel-contrib/rules_python/issues/3789)). * Fix the forwarding of `target_compatible_with` from `compile_pip_requirements` - towards the underlying `*.update` target + towards the underlying `*.update` target. + ([#3787](https://github.com/bazel-contrib/rules_python/pull/3787)) {#v0-0-0-added}