From 9d60ea59013de8d629083764d77a0252cb7426dd Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Wed, 12 Feb 2025 09:22:06 -0800 Subject: [PATCH] Make invocation of bash more Posix conformant. Hard-coding the location of the shell to be in /bin/bash is not always working as not all Posix-conformant operating systems (such as NixOS) provide the path /bin/bash; so shell scripts won't be able to execute. Instead, use the `/usr/bin/env bash` idiom to reliably find the shell to execute. This fix is only applied to the critical scripts that might be executed on the users' machine; the *_test*sh scripts are left as-is. --- toolchain/cc_wrapper.sh.tpl | 2 +- toolchain/osx_cc_wrapper.sh.tpl | 2 +- utils/llvm_checksums.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toolchain/cc_wrapper.sh.tpl b/toolchain/cc_wrapper.sh.tpl index e972d57e6..d563a71d8 100644 --- a/toolchain/cc_wrapper.sh.tpl +++ b/toolchain/cc_wrapper.sh.tpl @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Copyright 2021 The Bazel Authors. All rights reserved. # diff --git a/toolchain/osx_cc_wrapper.sh.tpl b/toolchain/osx_cc_wrapper.sh.tpl index 31122784b..b66814f34 100755 --- a/toolchain/osx_cc_wrapper.sh.tpl +++ b/toolchain/osx_cc_wrapper.sh.tpl @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Copyright 2015 The Bazel Authors. All rights reserved. # diff --git a/utils/llvm_checksums.sh b/utils/llvm_checksums.sh index ec47a23f9..2099f35ef 100755 --- a/utils/llvm_checksums.sh +++ b/utils/llvm_checksums.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Copyright 2022 The Bazel Authors. # # Licensed under the Apache License, Version 2.0 (the "License");