From 0cee187f8ce30ea0bf19be9158b0acd885b7f6fb Mon Sep 17 00:00:00 2001 From: Nicolas Mattia Date: Mon, 2 Feb 2026 16:10:34 +0100 Subject: [PATCH] chore: remove TLA feature flags This inline a `.bzl` file that contained some `select()`s for the TLA tests and clarifies some dependencies. --- rs/nns/governance/BUILD.bazel | 27 +++++++++++++++++---------- rs/nns/governance/feature_flags.bzl | 10 ---------- 2 files changed, 17 insertions(+), 20 deletions(-) delete mode 100644 rs/nns/governance/feature_flags.bzl diff --git a/rs/nns/governance/BUILD.bazel b/rs/nns/governance/BUILD.bazel index deb766cbc58b..03ad7cebaf5c 100644 --- a/rs/nns/governance/BUILD.bazel +++ b/rs/nns/governance/BUILD.bazel @@ -5,7 +5,6 @@ load("//bazel:canisters.bzl", "rust_canister") load("//bazel:defs.bzl", "rust_test_suite_with_extra_srcs") load("//bazel:prost.bzl", "generated_files_check") load("//rs/nervous_system/patch_canister_did:defs.bzl", "canister_test_did") -load(":feature_flags.bzl", "test_with_tla") package(default_visibility = ["//rs/nervous_system:default_visibility"]) @@ -16,6 +15,7 @@ exports_files( [ "canister/governance.did", "canister/governance_test.did.patch", + "tests/neurons.csv", ], visibility = [ "//visibility:public", @@ -31,8 +31,6 @@ canister_test_did( # Allows temporarily disabling TLA checks from the command line; # just pass `--define tla_disabled=true` to your Bazel command -# See feature_flags.bzl for how to disable TLA checks permanently -# (in the CI) config_setting( name = "tla_disabled", values = { @@ -40,6 +38,15 @@ config_setting( }, ) +TEST_WITH_TLA = select({ + # Add/remove "tla" here to enable/disable TLA-related checks in the CI + "//conditions:default": [ + "test", + "tla", + ], + "//rs/nns/governance:tla_disabled": ["test"], +}) + filegroup( name = "protos", srcs = glob(["proto/**/*.proto"]), @@ -196,7 +203,7 @@ rust_library( name = "governance--test_feature", srcs = LIB_SRCS, aliases = ALIASES, - crate_features = test_with_tla(), + crate_features = TEST_WITH_TLA, crate_name = "ic_nns_governance", proc_macro_deps = MACRO_DEPENDENCIES + [ "//rs/tla_instrumentation:proc_macros", @@ -303,7 +310,7 @@ rust_canister( ], aliases = ALIASES, compile_data = [":test_did"], - crate_features = test_with_tla(), + crate_features = TEST_WITH_TLA, crate_root = "canister/canister.rs", did_check = False, # we don't check in the did so can't meaningfully check proc_macro_deps = MACRO_DEPENDENCIES + [ @@ -370,7 +377,7 @@ rust_test( name = "canister_test_unit_test", srcs = glob(["canister/**/*.rs"]), compile_data = [":canister/governance_test.did"], - crate_features = test_with_tla(), + crate_features = TEST_WITH_TLA, crate_root = "canister/canister.rs", proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES, deps = DEPENDENCIES + DEV_DEPENDENCIES + [ @@ -397,7 +404,7 @@ rust_test( name = "governance_test-test_feature", srcs = glob(["src/**/*.rs"]), aliases = ALIASES, - crate_features = test_with_tla(), + crate_features = TEST_WITH_TLA, data = [ "//rs/nns/handlers/lifeline/impl:lifeline.did", "//rs/nns/handlers/root/impl:canister/root.did", @@ -430,15 +437,15 @@ rust_test_suite_with_extra_srcs( ], ), aliases = ALIASES, - crate_features = test_with_tla(), + crate_features = TEST_WITH_TLA, data = [ - "tests/neurons.csv", + ":tests/neurons.csv", ":tla_models", "@bazel_tools//tools/jdk:current_java_runtime", "@tla_apalache//:bin/apalache-mc", ], env = { - "NEURON_CSV_PATH": "rs/nns/governance/tests/neurons.csv", + "NEURON_CSV_PATH": "$(rootpath :tests/neurons.csv)", "JAVABASE": "$(JAVABASE)", "TLA_APALACHE_BIN": "$(rootpath @tla_apalache//:bin/apalache-mc)", "TLA_MODULES": "$(locations :tla_models)", diff --git a/rs/nns/governance/feature_flags.bzl b/rs/nns/governance/feature_flags.bzl deleted file mode 100644 index cf2fe6f67817..000000000000 --- a/rs/nns/governance/feature_flags.bzl +++ /dev/null @@ -1,10 +0,0 @@ -""" -Feature flags for turning TLA-based checks on and off. -""" - -def test_with_tla(): - return select({ - # Add/remove "tla" here to enable/disable TLA-related checks in the CI - "//conditions:default": ["test", "tla"], - "//rs/nns/governance:tla_disabled": ["test"], - })