Skip to content

Commit

Permalink
chore(IDX): Use repository_ctx.getenv (#3442)
Browse files Browse the repository at this point in the history
This ensures that the repository rule get re-evaluated when the env var
changes without having to specify it as a rule input.
  • Loading branch information
nmattia authored Jan 14, 2025
1 parent 56015b7 commit e4479ba
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bazel/sanitizers_enabled_env/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ 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,
)

def sanitizers_enabled_env(name = None):
rule = repository_rule(
implementation = _impl,
local = True,
environ = ["SANITIZERS_ENABLED"],
)
rule(name = name)

0 comments on commit e4479ba

Please sign in to comment.