Skip to content

Commit

Permalink
Update platforms.md documentation
Browse files Browse the repository at this point in the history
Closes #8513.

PiperOrigin-RevId: 255944103
  • Loading branch information
hlopko authored and copybara-github committed Jul 1, 2019
1 parent bb96af5 commit b4f3d83
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions site/docs/platforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,28 +99,17 @@ Note that it is an error for a platform to specify more than one value of the
same constraint setting, such as `@platforms//cpu:x86_64` and
`@platforms//cpu:arm` for `@platforms//cpu:cpu`.

## Built-in constraints and platforms

Bazel ships with constraint definitions for the most popular CPU architectures
and operating systems. These are all located in the repository
`@platforms`. This repository is developed at
[github.com/bazelbuild/platforms](https://github.com/bazelbuild/platforms):
## Generally useful constraints and platforms

* `//cpu:cpu` for the CPU architecture, with values `//cpu:x86_32`,
`//cpu:x86_64`, `//cpu:ppc`, `//cpu:arm`, `//cpu:s390x`
* `//os:os` for the operating system, with values `//os:android`,
`//os:freebsd`, `//os:ios`, `//os:linux`, `//os:osx`, `//os:windows`
To keep the ecosystem consistent, Bazel team maintains a repository with
constraint definitions for the most popular CPU architectures and operating
systems. These are all located in
[https://github.com/bazelbuild/platforms](https://github.com/bazelbuild/platforms).

There are also the following special platform definitions:

* `@bazel_tools//platforms:host_platform` - represents the CPU and operating
system for the host environment

* `@bazel_tools//platforms:target_platform` - represents the CPU and operating
system for the target environment

The CPU values used by these two platforms can be specified with the
`--host_cpu` and `--cpu` flags.
Bazel ships with the following special platform definition:
`@local_config_platform//:host`. This is the autodetected host platform value -
represents autodetected platform for the system Bazel is running on.

## Specifying a platform for a build

Expand Down

0 comments on commit b4f3d83

Please sign in to comment.