From e4479ba9d49923759e672ed83e742cd2a371bb61 Mon Sep 17 00:00:00 2001 From: Nicolas Mattia Date: Tue, 14 Jan 2025 17:41:24 +0100 Subject: [PATCH] chore(IDX): Use repository_ctx.getenv (#3442) This ensures that the repository rule get re-evaluated when the env var changes without having to specify it as a rule input. --- bazel/sanitizers_enabled_env/defs.bzl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bazel/sanitizers_enabled_env/defs.bzl b/bazel/sanitizers_enabled_env/defs.bzl index 091354e0076..a6e65bef9a2 100644 --- a/bazel/sanitizers_enabled_env/defs.bzl +++ b/bazel/sanitizers_enabled_env/defs.bzl @@ -8,7 +8,7 @@ def _impl(repository_ctx): ) repository_ctx.file( "defs.bzl", - content = "SANITIZERS_ENABLED=" + repository_ctx.os.environ.get("SANITIZERS_ENABLED", "0") + "\n", + content = "SANITIZERS_ENABLED=" + repository_ctx.getenv("SANITIZERS_ENABLED", "0") + "\n", executable = False, ) @@ -16,6 +16,5 @@ def sanitizers_enabled_env(name = None): rule = repository_rule( implementation = _impl, local = True, - environ = ["SANITIZERS_ENABLED"], ) rule(name = name)