Skip to content

Commit

Permalink
BUG-FIX: host-triple str for bzl mod (#2587)
Browse files Browse the repository at this point in the history
- Resolves #2585
- Fixes the host triple string lookup for CARGO_BAZEL_URLs. 
- Will work on bzlmod bootstrap so we can bootstrap the bzlmod cargo
stuff so we have the URLS in a follow up MR

Co-authored-by: UebelAndre <[email protected]>
  • Loading branch information
ericmcbride and UebelAndre authored Apr 2, 2024
1 parent dd48a73 commit 4769fe6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crate_universe/extension.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,14 @@ def _get_generator(module_ctx):
elif len(CARGO_BAZEL_URLS) == 0:
return module_ctx.path(Label("@cargo_bazel_bootstrap//:cargo-bazel"))
else:
generator_sha256 = CARGO_BAZEL_SHA256S.get(host_triple)
generator_url = CARGO_BAZEL_URLS.get(host_triple)
generator_sha256 = CARGO_BAZEL_SHA256S.get(host_triple.str)
generator_url = CARGO_BAZEL_URLS.get(host_triple.str)

if not generator_url:
fail((
"No generator URL was found either in the `CARGO_BAZEL_GENERATOR_URL` " +
"environment variable or for the `{}` triple in the `generator_urls` attribute"
).format(host_triple))
).format(host_triple.str))

output = module_ctx.path("cargo-bazel.exe" if "win" in module_ctx.os.name else "cargo-bazel")

Expand Down

0 comments on commit 4769fe6

Please sign in to comment.