nativelink icon indicating copy to clipboard operation
nativelink copied to clipboard

//local-remote-execution/generated/config:platform excludes darwin toolchains for non-remote execution builds

Open adam-singer opened this issue 1 year ago • 3 comments

Description

//local-remote-execution/generated/config:platform seems to pollute or exclude building locally with bazel on MacOS. The defaults provide do not include darwin toolchains. This is problematic for building locally without using remote execution for builds.

bazel query //local-remote-execution/generated/config:platform --output build
# /Users/adam/workspace/native-link/local-remote-execution/generated/config/BUILD:35:9
platform(
  name = "platform",
  exec_properties = {"container-image": "docker://nativelink-toolchain:lslbs7cb2pdf0lgp14vz6kj9r2xbby55", "OSFamily": "Linux"},
  constraint_values = ["@platforms//os:linux", "@platforms//cpu:x86_64", "@bazel_tools//tools/cpp:clang"],
  parents = ["@local_config_platform//:host"],
)
# Rule platform instantiated at (most recent call last):
#   /Users/adam/workspace/native-link/local-remote-execution/generated/config/BUILD:35:9 in <toplevel>

Loading: 0 packages loaded

Reproduce

On MacOS run (https://gist.github.com/adam-singer/46277e3f61aeaf6a6326520f03dfeb5c#file-gistfile0-txt-L247 )

bazel test -s  //nativelink-store/...

cc: @aaronmondal

adam-singer avatar Dec 19 '23 02:12 adam-singer

Same thing is happening on Windows. Working on a fix.

aaronmondal avatar Dec 19 '23 02:12 aaronmondal

Ran into something similar as well

bazel test //... \
  --remote_instance_name=main \
  --remote_cache=grpc://127.0.0.1:50051 \
  --remote_executor=grpc://127.0.0.1:50051 \
  --remote_default_exec_properties=cpu_count=1
INFO: Invocation ID: 9db76f62-f0e4-459f-9f8b-8a79938c9238
ERROR: /Users/brianclark/tracemachina/nativelink/local-remote-execution/generated/cc/BUILD:50:19: 
in cc_toolchain_suite rule //local-remote-execution/generated/cc:toolchain: 
cc_toolchain_suite '//local-remote-execution/generated/cc:toolchain' does not contain a toolchain for cpu 'darwin_arm64'

Looking into how to fix this now

bclark8923 avatar Jan 10 '24 22:01 bclark8923

@bclark8923 atm using bazel directly on this repo for build/test on mac is a work in progress. Using cargo for now is the best option on mac cargo test --all

adam-singer avatar Jan 11 '24 00:01 adam-singer