Skip to content

Commit c2fb51f

Browse files
committed
Remove Bazel 7.0 workaround
1 parent 88038aa commit c2fb51f

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

private/repositories.bzl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020, 2021, 2022, 2023, 2024 Google LLC
1+
# Copyright 2020, 2021, 2022, 2023, 2024, 2025 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -116,7 +116,7 @@ _emacs_repository = repository_rule(
116116

117117
def _local_emacs_impl(ctx):
118118
windows = ctx.os.name.startswith("windows")
119-
emacs = _getenv(ctx, "EMACS", "emacs")
119+
emacs = ctx.getenv("EMACS", "emacs")
120120
if windows and not emacs.lower().endswith(".exe"):
121121
emacs += ".exe"
122122
sep = "\\" if windows else "/"
@@ -141,10 +141,3 @@ _local_emacs = repository_rule(
141141
implementation = _local_emacs_impl,
142142
local = True,
143143
)
144-
145-
def _getenv(ctx, variable, default = None):
146-
if hasattr(ctx, "getenv"):
147-
return ctx.getenv(variable, default)
148-
else:
149-
# TODO: Remove this branch after dropping support for Bazel 7.0.
150-
return ctx.os.environ.get(variable, default)

0 commit comments

Comments
 (0)