12

When I run bazel info --local_cpu_resources HOST_CPUS on macos and ubuntu

In Macos

`bazel-bin: .../9dcdc19e81f948a3daf2cc314e0d4bf1/execroot/demo/bazel-out/darwin-fastbuild/bin`

`bazel-genfiles: .../9dcdc19e81f948a3daf2cc314e0d4bf1/execroot/demo/bazel-out/darwin-fastbuild/bin`

`bazel-testlogs: .../9dcdc19e81f948a3daf2cc314e0d4bf1/execroot/demo/bazel-out/darwin-fastbuild/testlogs`

In Ubuntu

`bazel-bin: /root/.cache/bazel/_bazel_root/d89113122c03ccb06b1d63e7c96f20e4/execroot/demo/bazel-out/k8-fastbuild/bin`

`bazel-genfiles: /root/.cache/bazel/_bazel_root/d89113122c03ccb06b1d63e7c96f20e4/execroot/demo/bazel-out/k8-fastbuild/bin`

`bazel-testlogs: /root/.cache/bazel/_bazel_root/d89113122c03ccb06b1d63e7c96f20e4/execroot/demo/bazel-out/k8-fastbuild/testlogs`

Question

  • Darwin may mean OS in macos.
  • What does k8 mean in ubuntu?
  • On other platforms, like windows, what will be output? why?

Reference information

https://docs.bazel.build/versions/master/be/make-variables.html#predefined_variables

https://docs.bazel.build/versions/master/guide.html#distinct_host_configuration-true-default

Full output on Ubuntu

root@608a654a26de:/home/servlet/demo# bazel info --local_cpu_resources HOST_CPUS
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
bazel-bin: /root/.cache/bazel/_bazel_root/d89113122c03ccb06b1d63e7c96f20e4/execroot/demo/bazel-out/k8-fastbuild/bin
bazel-genfiles: /root/.cache/bazel/_bazel_root/d89113122c03ccb06b1d63e7c96f20e4/execroot/demo/bazel-out/k8-fastbuild/bin
bazel-testlogs: /root/.cache/bazel/_bazel_root/d89113122c03ccb06b1d63e7c96f20e4/execroot/demo/bazel-out/k8-fastbuild/testlogs
character-encoding: file.encoding = ISO-8859-1, defaultCharset = ISO-8859-1
command_log: /root/.cache/bazel/_bazel_root/d89113122c03ccb06b1d63e7c96f20e4/command.log
committed-heap-size: 40MB
execution_root: /root/.cache/bazel/_bazel_root/d89113122c03ccb06b1d63e7c96f20e4/execroot/demo
gc-count: 8
gc-time: 55ms
install_base: /root/.cache/bazel/_bazel_root/install/8eab0b6f2b5ac882f3a1a7c2494aade6
java-home: /root/.cache/bazel/_bazel_root/install/8eab0b6f2b5ac882f3a1a7c2494aade6/embedded_tools/jdk
java-runtime: OpenJDK Runtime Environment (build 11.0.2+7-LTS) by Azul Systems, Inc.
java-vm: OpenJDK 64-Bit Server VM (build 11.0.2+7-LTS, mixed mode) by Azul Systems, Inc.
max-heap-size: 524MB
output_base: /root/.cache/bazel/_bazel_root/d89113122c03ccb06b1d63e7c96f20e4
output_path: /root/.cache/bazel/_bazel_root/d89113122c03ccb06b1d63e7c96f20e4/execroot/demo/bazel-out
package_path: %workspace%
release: release 1.2.0
repository_cache: /root/.cache/bazel/_bazel_root/cache/repos/v1
server_log: /root/.cache/bazel/_bazel_root/d89113122c03ccb06b1d63e7c96f20e4/java.log.608a654a26de.root.log.java.20191128-034422.19
server_pid: 19
used-heap-size: 22MB
workspace: /home/servlet/demo
Mike Frysinger
  • 2,827
  • 1
  • 21
  • 26
mo6114
  • 123
  • 1
  • 7
  • [Darwin](https://en.wikipedia.org/wiki/Darwin_(operating_system)) is OS (essentially BSD based) atop of which MacOS is built. I'd assume K8 refers to [AMD first gen](https://en.wikipedia.org/wiki/AMD_K8) of x86_64 processors. – Ondrej K. Nov 29 '19 at 12:26

1 Answers1

15

The K8 was the first implementation of the AMD64 64-bit extension to the x86 instruction set architecture

See Wikipedia for more details.

Toolchains in Bazel support different CPUs. Valid CPUs seem to be:

[
 k8, 
 piii,
 arm,
 darwin,
 ppc,
 x64_windows,
]

Personally I would call it x64. K8 is also a valid name for it. k8, darwin, and x64_windows refer to the x64 on Ubuntu/Linux, macOS, and Windows correspondingly.

BTW: Do not confuse K8 with the abbreviation K8s. K8s stands for Kubernetes.

Vertexwahn
  • 7,709
  • 6
  • 64
  • 90