~motiejus/bazel-zig-cc

79674a1d966b5c196a6f729ac7423223dc05cf83 — Motiejus Jakštys 9 months ago 342b239
replace /usr/bin/env sh with /bin/sh

/bin/sh exists in NixOS and in fact is the only file in `/bin`:

    $ docker run -ti --rm nixos/nix ls /bin /usr/bin
    /bin:
    sh

    /usr/bin:
    env

More context in
https://lists.sr.ht/~motiejus/bazel-zig-cc/%3CCAFVMu-pvNx%2BpeQYdge_fvmSGrHDmn78VmoYwTxkDgMjbzfVAwQ%40mail.gmail.com%3E
4 files changed, 7 insertions(+), 9 deletions(-)

M bin/mod-tidy
M ci/test
M test/c/test.sh
M toolchain/defs.bzl
M bin/mod-tidy => bin/mod-tidy +2 -3
@@ 1,6 1,5 @@
#!/usr/bin/env bash

set -xeuo pipefail
#!/bin/sh
set -eu

cd "$(git rev-parse --show-toplevel)/"
bazel run @go_sdk//:bin/go -- mod tidy

M ci/test => ci/test +1 -1
@@ 1,2 1,2 @@
#!/usr/bin/env sh
#!/bin/sh
exec bazel test "$@" ...

M test/c/test.sh => test/c/test.sh +2 -3
@@ 1,6 1,5 @@
#!/usr/bin/env bash

set -euo pipefail
#!/bin/sh
set -eu

# shellcheck disable=SC2153
want=$WANT

M toolchain/defs.bzl => toolchain/defs.bzl +2 -2
@@ 103,13 103,13 @@ set ZIG_GLOBAL_CACHE_DIR=%ZIG_LOCAL_CACHE_DIR%
"{zig}" "{zig_tool}" %*
"""

_ZIG_TOOL_WRAPPER_CACHE_KNOWN = """#!/usr/bin/env sh
_ZIG_TOOL_WRAPPER_CACHE_KNOWN = """#!/bin/sh
export ZIG_LOCAL_CACHE_DIR="{cache_prefix}/bazel-zig-cc"
export ZIG_GLOBAL_CACHE_DIR="{cache_prefix}/bazel-zig-cc"
exec "{zig}" "{zig_tool}" "$@"
"""

_ZIG_TOOL_WRAPPER_CACHE_GUESS = """#!/usr/bin/env sh
_ZIG_TOOL_WRAPPER_CACHE_GUESS = """#!/bin/sh
set -e
if [ -n "$TMPDIR" ]; then
    _cache_prefix=$TMPDIR