From 5a90feeb4602e57b295fe8b9000f3160fc0c813f Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 27 Apr 2022 15:05:30 -0700 Subject: [PATCH] Replace incomplete repository_os logic with get_host_triple --- tools/examples_repository.bzl | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/examples_repository.bzl b/tools/examples_repository.bzl index 2d18c96c0..821b5c34a 100644 --- a/tools/examples_repository.bzl +++ b/tools/examples_repository.bzl @@ -2,6 +2,7 @@ actual vendored sources""" load("@rules_rust//rust:repositories.bzl", "load_arbitrary_tool") +load("@rules_rust//rust/platform:triple.bzl", "get_host_triple") def _examples_dir(repository_ctx): """Returns the path to the cargo-raze workspace root @@ -34,12 +35,8 @@ def _examples_repository_impl(repository_ctx): if repository_ctx.attr.target_triple: target_triple = repository_ctx.attr.target_triple - elif "mac" in repository_ctx.os.name: - target_triple = "x86_64-apple-darwin" - elif "windows" in repository_ctx.os.name: - target_triple = "x86_64-pc-windows-msvc" else: - target_triple = "x86_64-unknown-linux-gnu" + target_triple = get_host_triple(repository_ctx).str # Download cargo load_arbitrary_tool(