Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not fail if not matching LLVM toolchain root is found #249

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

gferon
Copy link
Contributor

@gferon gferon commented Jan 30, 2024

This fixes one small, but quite important, difference between using the repository rule with or without bzlmod enabled.

Example:

llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm")
llvm.toolchain(
    llvm_versions = {
        "linux-aarch64": "17.0.6",
        "linux-x86_64": "17.0.6",
    },
    sha256 = {
        "linux-aarch64": "6dd62762285326f223f40b8e4f2864b5c372de3f7de0731cb7cd55ca5287b75a",
        "linux-x86_64": "884ee67d647d77e58740c1e645649e29ae9e8a6fe87c1376be0f3a30f3cc9ab3",
    },
    stdlib = {
        "linux-aarch64": "stdc++",
        "linux-x86_64": "stdc++",
    },
    strip_prefix = {
        "linux-aarch64": "clang+llvm-17.0.6-aarch64-linux-gnu",
        "linux-x86_64": "clang+llvm-17.0.6-x86_64-linux-gnu-ubuntu-22.04",
    },
    urls = {
        "linux-aarch64": ["https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/clang+llvm-17.0.6-aarch64-linux-gnu.tar.xz"],
        "linux-x86_64": ["https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/clang+llvm-17.0.6-x86_64-linux-gnu-ubuntu-22.04.tar.xz"],
    },
)

and run the following on a Mac host (on which we want to use the Xcode LLVM toolchain from the system).

@siddharthab
Copy link
Contributor

Thanks for the PR. Makes sense.

@siddharthab siddharthab merged commit b2ddf53 into bazel-contrib:master Mar 12, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants