From 39ac0d34f5020481a3f1331e5884cfc8d169be02 Mon Sep 17 00:00:00 2001 From: Malte Poll <1780588+malt3@users.noreply.github.com> Date: Tue, 4 Jun 2024 13:49:48 +0200 Subject: [PATCH] always set 'use_default_shell_env' in ctx.actions.run 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: https://github.com/NixOS/nixpkgs/issues/289505 --- ts/private/ts_project.bzl | 1 + ts/private/ts_proto_library.bzl | 1 + ts/private/ts_validate_options.bzl | 1 + 3 files changed, 3 insertions(+) diff --git a/ts/private/ts_project.bzl b/ts/private/ts_project.bzl index fcdf651a..32ef5f07 100644 --- a/ts/private/ts_project.bzl +++ b/ts/private/ts_project.bzl @@ -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) diff --git a/ts/private/ts_proto_library.bzl b/ts/private/ts_proto_library.bzl index 6fa8c30f..fe3b2aef 100644 --- a/ts/private/ts_proto_library.bzl +++ b/ts/private/ts_proto_library.bzl @@ -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): diff --git a/ts/private/ts_validate_options.bzl b/ts/private/ts_validate_options.bzl index 6d979a4c..a368b5cd 100644 --- a/ts/private/ts_validate_options.bzl +++ b/ts/private/ts_validate_options.bzl @@ -78,6 +78,7 @@ def _validate_action(ctx, tsconfig_inputs): env = { "BAZEL_BINDIR": ctx.bin_dir.path, }, + use_default_shell_env = True, ) return [marker]