| Tim Windelschmidt | 5d357d8 | 2025-07-10 18:47:15 +0200 | [diff] [blame] | 1 | We have to set use_default_shell_env to find bash via /usr/bin/env, |
| 2 | as without it we don't have PATH available. The old behavior is fine |
| 3 | for NixOS as their /usr/bin/env tries to use /run/current-system/sw/bin/bash |
| 4 | which exist on NixOS, but not in our CI or any other nixos/nix container. |
| 5 | |
| 6 | diff --git a/oci/private/image.bzl b/oci/private/image.bzl |
| 7 | --- a/oci/private/image.bzl |
| 8 | +++ b/oci/private/image.bzl |
| 9 | @@ -131,8 +131,9 @@ |
| 10 | regctl.regctl_info.binary, |
| 11 | ], |
| 12 | mnemonic = "OCIDescriptor", |
| 13 | progress_message = "OCI Descriptor %{input}", |
| 14 | + use_default_shell_env = True, |
| 15 | ) |
| 16 | return descriptor |
| 17 | |
| 18 | def _oci_image_impl(ctx): |
| 19 | @@ -263,8 +264,9 @@ |
| 20 | mnemonic = "OCIImage", |
| 21 | progress_message = "OCI Image %{label}", |
| 22 | resource_set = resource_set(ctx.attr), |
| 23 | toolchain = None, |
| 24 | + use_default_shell_env = True, |
| 25 | ) |
| 26 | |
| 27 | return [ |
| 28 | DefaultInfo( |
| 29 | diff --git a/oci/private/image_index.bzl b/oci/private/image_index.bzl |
| 30 | --- a/oci/private/image_index.bzl |
| 31 | +++ b/oci/private/image_index.bzl |
| 32 | @@ -129,8 +129,9 @@ |
| 33 | tools = [jq.jqinfo.bin, coreutils.coreutils_info.bin], |
| 34 | mnemonic = "OCIIndex", |
| 35 | progress_message = "OCI Index %{label}", |
| 36 | toolchain = None, |
| 37 | + use_default_shell_env = True, |
| 38 | ) |
| 39 | |
| 40 | return DefaultInfo(files = depset([output])) |
| 41 | |
| 42 | diff --git a/oci/private/load.bzl b/oci/private/load.bzl |
| 43 | --- a/oci/private/load.bzl |
| 44 | +++ b/oci/private/load.bzl |
| 45 | @@ -179,8 +179,9 @@ |
| 46 | jq.jqinfo.bin, |
| 47 | coreutils.coreutils_info.bin, |
| 48 | ], |
| 49 | mnemonic = "OCITarballManifest", |
| 50 | + use_default_shell_env = True, |
| 51 | ) |
| 52 | |
| 53 | # This action produces a large output and should rarely be used as it puts load on the cache. |
| 54 | # It will only run if the "tarball" output_group is explicitly requested |
| 55 | @@ -195,8 +196,9 @@ |
| 56 | inputs = tar_inputs, |
| 57 | outputs = [tarball], |
| 58 | arguments = [tar_args], |
| 59 | mnemonic = "OCITarball", |
| 60 | + use_default_shell_env = True, |
| 61 | ) |
| 62 | |
| 63 | # Create an executable runner script that will create the tarball at runtime, |
| 64 | # as opposed to at build to avoid uploading large artifacts to remote cache. |