Skip to content

Commit

Permalink
always set 'use_default_shell_env' in ctx.actions.run
Browse files Browse the repository at this point in the history
Aspect uses shell wrappers that invoke tools like `dirname` and `uname`.
When the default shell env is not inherited, this prevents tools to be
found.

See also: NixOS/nixpkgs#289505
  • Loading branch information
malt3 committed Jun 4, 2024
1 parent 50ff189 commit 8b00df0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions ts/private/ts_project.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ This is an error because Bazel does not run actions unless their outputs are nee
env = {
"BAZEL_BINDIR": ctx.bin_dir.path,
},
use_default_shell_env = True,
)

transitive_sources = js_lib_helpers.gather_transitive_sources(output_sources, ctx.attr.srcs + [ctx.attr.tsconfig] + ctx.attr.deps)
Expand Down
1 change: 1 addition & 0 deletions ts/private/ts_proto_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def _protoc_action(ctx, proto_info, outputs, options = {
[ctx.executable.protoc_gen_connect_query] if ctx.attr.gen_connect_query else []
),
env = {"BAZEL_BINDIR": ctx.bin_dir.path},
use_default_shell_env = True,
)

def _declare_outs(ctx, info, ext):
Expand Down
1 change: 1 addition & 0 deletions ts/private/ts_validate_options.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def _validate_action(ctx, tsconfig_inputs):
env = {
"BAZEL_BINDIR": ctx.bin_dir.path,
},
use_default_shell_env = True,
)

return [marker]
Expand Down

0 comments on commit 8b00df0

Please sign in to comment.