Skip to content

Instantly share code, notes, and snippets.

@rrbutani
Created January 26, 2022 08:29
Show Gist options
  • Save rrbutani/a0a52776d87b026ef1339445070353fd to your computer and use it in GitHub Desktop.
Save rrbutani/a0a52776d87b026ef1339445070353fd to your computer and use it in GitHub Desktop.
.bazel-cc-macOS-install_name-test
Fails with and without `llvm_register_toolchains()`.
build --incompatible_enable_cc_toolchain_resolution
cc_binary(
name = "somelib.dylib",
linkshared = True,
srcs = ["lib.cc"],
linkopts = ["-install_name", "@execution_path/../lib/somelib.dylib"],
)
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
BAZEL_TOOLCHAIN_TAG = "0.6.3"
BAZEL_TOOLCHAIN_SHA = "da607faed78c4cb5a5637ef74a36fdd2286f85ca5192222c4664efec2d529bb8"
http_archive(
name = "com_grail_bazel_toolchain",
sha256 = BAZEL_TOOLCHAIN_SHA,
strip_prefix = "bazel-toolchain-{tag}".format(tag = BAZEL_TOOLCHAIN_TAG),
canonical_id = BAZEL_TOOLCHAIN_TAG,
url = "https://github.com/grailbio/bazel-toolchain/archive/{tag}.tar.gz".format(tag = BAZEL_TOOLCHAIN_TAG),
)
load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies")
bazel_toolchain_dependencies()
load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain")
llvm_toolchain(
name = "llvm_toolchain",
llvm_version = "13.0.0",
)
load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains")
# llvm_register_toolchains()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment