Skip to content

Commit 94131bf

Browse files
committed
remove checks for versions
1 parent 05927d3 commit 94131bf

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

rust/private/repository_utils.bzl

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -656,21 +656,6 @@ def load_llvm_tools(ctx, target_triple, version, iso_date = None):
656656

657657
return BUILD_for_llvm_tools(target_triple), sha256
658658

659-
def check_version_valid(version, iso_date, param_prefix = ""):
660-
"""Verifies that the provided rust version and iso_date make sense.
661-
662-
Args:
663-
version (str): The rustc version
664-
iso_date (str): The rustc nightly version's iso date
665-
param_prefix (str, optional): The name of the tool who's version is being checked.
666-
"""
667-
668-
if not version and iso_date:
669-
fail("{param_prefix}iso_date must be paired with a {param_prefix}version".format(param_prefix = param_prefix))
670-
671-
if version in ("beta", "nightly") and not iso_date:
672-
fail("{param_prefix}iso_date must be specified if version is 'beta' or 'nightly'".format(param_prefix = param_prefix))
673-
674659
def produce_tool_suburl(tool_name, target_triple, version, iso_date = None):
675660
"""Produces a fully qualified Rust tool name for URL
676661
@@ -786,7 +771,6 @@ def load_arbitrary_tool(
786771
Dict[str, str]: A mapping of the tool name to it's sha256 value if the requested tool does not have
787772
enough information in the repository_ctx to be reproducible.
788773
"""
789-
check_version_valid(version, iso_date, param_prefix = tool_name + "_")
790774

791775
# View the indices mentioned in the docstring to find the tool_suburl for a given
792776
# tool.

rust/repositories.bzl

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ load(
2020
"DEFAULT_NIGHTLY_VERSION",
2121
"DEFAULT_STATIC_RUST_URL_TEMPLATES",
2222
"TINYJSON_KWARGS",
23-
"check_version_valid",
2423
"includes_rust_analyzer_proc_macro_srv",
2524
"load_cargo",
2625
"load_clippy",
@@ -425,8 +424,6 @@ def _rust_toolchain_tools_repository_impl(ctx):
425424
version = version_array[0]
426425
iso_date = version_array[1]
427426

428-
check_version_valid(ctx.attr.version, iso_date)
429-
430427
exec_triple = triple(ctx.attr.exec_triple)
431428

432429
rustc_content, rustc_sha256 = load_rust_compiler(
@@ -458,14 +455,7 @@ def _rust_toolchain_tools_repository_impl(ctx):
458455
if ctx.attr.rustfmt_version:
459456
rustfmt_version = ctx.attr.rustfmt_version
460457
rustfmt_iso_date = None
461-
if rustfmt_version in ("nightly", "beta"):
462-
if iso_date:
463-
rustfmt_iso_date = iso_date
464-
else:
465-
fail("`rustfmt_version` does not include an iso_date. The following reposiotry should either set `iso_date` or update `rustfmt_version` to include an iso_date suffix: {}".format(
466-
ctx.name,
467-
))
468-
elif rustfmt_version.startswith(("nightly", "beta")):
458+
if rustfmt_version.startswith(("nightly/", "beta/")):
469459
rustfmt_version, _, rustfmt_iso_date = rustfmt_version.partition("/")
470460
rustfmt_content, rustfmt_sha256 = load_rustfmt(
471461
ctx = ctx,

0 commit comments

Comments
 (0)