| # Platforms that rules_python's release artifacts are built for, named after | |
| # their Rust target triples; see dev/release_artifacts/build.sh. They cover the | |
| # platforms that python-build-standalone supports: the Linux files are static, | |
| # so they also run on Linux platforms with other libcs, and arm64e Macs run the | |
| # aarch64 macOS file. s390x isn't covered yet: Rust ships no musl std for it, | |
| # and a static glibc build needs a C cross toolchain. | |
| # | |
| # Linux x86_64 hosts cross-compile for the musl ones, and Windows x86_64 hosts | |
| # for i686-pc-windows-msvc, with the Rust toolchains in MODULE.bazel. The | |
| # others are built on hosts that match them. | |
| package(default_visibility = ["//:__subpackages__"]) | |
| # For the test that the release workflow's matrix matches these platforms. | |
| exports_files( | |
| ["BUILD.bazel"], | |
| visibility = ["//tests/workflows:__pkg__"], | |
| ) | |
| platform( | |
| name = "aarch64-apple-darwin", | |
| constraint_values = [ | |
| "@platforms//cpu:aarch64", | |
| "@platforms//os:macos", | |
| ], | |
| ) | |
| platform( | |
| name = "aarch64-pc-windows-msvc", | |
| constraint_values = [ | |
| "@platforms//cpu:aarch64", | |
| "@platforms//os:windows", | |
| ], | |
| ) | |
| platform( | |
| name = "aarch64-unknown-linux-musl", | |
| constraint_values = [ | |
| "@platforms//cpu:aarch64", | |
| "@platforms//os:linux", | |
| ":musl", | |
| ], | |
| ) | |
| # "musleabihf" is musl with ARM's EABI, hard-float variant: floats are passed in | |
| # FPU registers, as in python-build-standalone's gnueabihf armv7 builds. Being | |
| # static, it also runs on gnueabi (soft-float) systems, but not on CPUs without | |
| # an FPU, which python-build-standalone's gnueabi builds also support. | |
| platform( | |
| name = "armv7-unknown-linux-musleabihf", | |
| constraint_values = [ | |
| "@platforms//cpu:armv7", | |
| "@platforms//os:linux", | |
| ":musl", | |
| ], | |
| ) | |
| platform( | |
| name = "i686-pc-windows-msvc", | |
| constraint_values = [ | |
| "@platforms//cpu:x86_32", | |
| "@platforms//os:windows", | |
| ], | |
| ) | |
| platform( | |
| name = "i686-unknown-linux-musl", | |
| constraint_values = [ | |
| "@platforms//cpu:x86_32", | |
| "@platforms//os:linux", | |
| ":musl", | |
| ], | |
| ) | |
| platform( | |
| name = "powerpc64le-unknown-linux-musl", | |
| constraint_values = [ | |
| "@platforms//cpu:ppc64le", | |
| "@platforms//os:linux", | |
| ":musl", | |
| ], | |
| ) | |
| platform( | |
| name = "riscv64gc-unknown-linux-musl", | |
| constraint_values = [ | |
| "@platforms//cpu:riscv64", | |
| "@platforms//os:linux", | |
| ":musl", | |
| ], | |
| ) | |
| platform( | |
| name = "x86_64-apple-darwin", | |
| constraint_values = [ | |
| "@platforms//cpu:x86_64", | |
| "@platforms//os:macos", | |
| ], | |
| ) | |
| platform( | |
| name = "x86_64-pc-windows-msvc", | |
| constraint_values = [ | |
| "@platforms//cpu:x86_64", | |
| "@platforms//os:windows", | |
| ], | |
| ) | |
| platform( | |
| name = "x86_64-unknown-linux-gnu", | |
| constraint_values = [ | |
| "@platforms//cpu:x86_64", | |
| "@platforms//os:linux", | |
| ], | |
| ) | |
| # The libc of Linux platforms. Only musl is a constraint value: platforms | |
| # without it, like the host, use glibc. It also keeps the musl Rust toolchains | |
| # in MODULE.bazel from being used for glibc platforms. | |
| constraint_setting(name = "libc") | |
| constraint_value( | |
| name = "musl", | |
| constraint_setting = ":libc", | |
| # The musl Rust toolchains' repos, generated by rules_rust, refer to it. | |
| visibility = ["//visibility:public"], | |
| ) |