From c4125cf13bccc292230a8eb257cbd3a39aced0bc Mon Sep 17 00:00:00 2001 From: Luis Holanda Date: Wed, 27 Jul 2022 17:33:52 -0300 Subject: [PATCH] Support NixOS and others non-FHS Linux distros As it expects Bash to be at `/bin/bash`, the current implementation fails to execute on NixOS, given that there bash is in a non-standard path (i.g. `/nix/store/-bash-interactive-/bin/bash`). This patch specifically changes `/bin/bash` paths to use `/usr/bin/env bash`, which should give the correct path in every Unix system. Signed-off-by: Luis Holanda --- test/c/test.sh | 2 +- toolchain/defs.bzl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/c/test.sh b/test/c/test.sh index ee67dd3..7cfac79 100755 --- a/test/c/test.sh +++ b/test/c/test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail diff --git a/toolchain/defs.bzl b/toolchain/defs.bzl index d200588..f640aa4 100644 --- a/toolchain/defs.bzl +++ b/toolchain/defs.bzl @@ -76,7 +76,7 @@ def toolchains( }, ) -ZIG_TOOL_WRAPPER = """#!/bin/bash +ZIG_TOOL_WRAPPER = """#!/usr/bin/env bash set -e if [[ -n "$TMPDIR" ]]; then