Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pants-backend-platforms

A Pants backend for building targets for more than one platform. It has no build rules of its own: language backends (such as pants-backend-cmake) use it to know which platforms to build and how to ask another backend for a dependency built for the same platform. The C and C++ toolchain for each platform is in pants-backend-cc.

This release targets Pants 2.32.x. Install it with pants-backend-platforms==0.1.0rc0 in [GLOBAL].plugins in pants.toml, and enable pants_backend_platforms in [GLOBAL].backend_packages.

Status: alpha.

Targets

platform(name="linux-x86_64", os="linux", arch="x86_64")
platform(name="windows-x86_64", os="windows", arch="x86_64")
  • platform: os (linux, windows, macos) and arch (x86_64, aarch64). Everything refers to a platform by its target name, so names are unique.
  • The host is the platform matching the machine Pants runs on. When several match, choose with [platforms].host; when none does, there is an implicit <os>-<arch> platform.

Choosing what to build

A target of a backend that supports platforms has a platforms field: the platforms it can be built for, the host alone when unset.

cmake_target(name="app", project=":project", platforms=["linux-x86_64", "windows-x86_64"])

pants package builds the platforms in that list that are the host or in [platforms].enabled. The host's output keeps its usual path in dist/, and every other platform's goes under dist/<platform>/:

pants --platforms-enabled="['windows-x86_64']" package ::

A target built for a platform has its dependencies built for the same platform, enabled or not. A dependency whose platforms does not list it is an error naming both targets.

Enable extra platforms where the packages are published rather than in pants.toml: whatever packages a target, such as a test's runtime_package_dependencies or an archive, gets every enabled platform too.

For backend authors

  • Make the field set a PlatformBuildFieldSet member, which brings the platforms field, and register UnionRule(PlatformBuildFieldSet, MyFieldSet). Its rule takes the field set and a TargetPlatform and returns a PlatformBuild: the files at the paths pants package writes them to for the host.
  • build_platform_dependencies(PlatformDependenciesRequest(address, targets, platform)) builds the members among targets for the platform and checks their platforms. A tool that runs during the build is built with build_for_platform for KnownPlatforms.host.
  • The package rule returns package_for_platforms(PackageForPlatformsRequest(field_set)). Goals that run what they build, such as run and test, build for the host.

Metadata

Release files for pants-backend-platforms 0.1.0rc0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pants-backend-platforms 0.1.0rc0
File Size Uploaded Provenance Actions
pants_backend_platforms-0.1.0rc0.tar.gz 8.7 kB Without provenance Details for pants_backend_platforms-0.1.0rc0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pants-backend-platforms 0.1.0rc0
File Interpreter ABI Platform Actions
pants_backend_platforms-0.1.0rc0-py3-none-any.whl Python 3 none any Details for pants_backend_platforms-0.1.0rc0-py3-none-any.whl

Total release size: 19.6 kB

Release files / pants_backend_platforms-0.1.0rc0.tar.gz

Download URL pants_backend_platforms-0.1.0rc0.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9f3a0103c52bfef0dc1a6f697518c61e143b499b3fdde6477aaf91340b58f287
BLAKE2b-256 checksum
How to use checksums
ee90fd2ed447e45bb891c70ac9bc4dc7ef75a96f1da0d9ed9fd052bb2eaff92a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Release files / pants_backend_platforms-0.1.0rc0-py3-none-any.whl

Download URL pants_backend_platforms-0.1.0rc0-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ec19ef9207f00ba489780f255add93d6db770b6df4b87f1ee3f487dbaa9b478
BLAKE2b-256 checksum
How to use checksums
4c751075aee62b44779c5b29a90ea26f7bf3c748789b611c501038e1badd245c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Security for pants-backend-platforms 0.1.0rc0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page