You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempted to run kapp's build and test scripts (located in hack/ directory) on a system where bash is not located at /bin/bash (e.g., NixOS, some BSD variants, or custom configurations).
What happened:
Scripts fail to execute because they use hardcoded shebang paths like #!/bin/bash and #!/bin/sh, which assume the shell interpreter is in a specific location.
What did you expect:
Scripts should be portable and work across different Unix-like systems regardless of where the shell interpreter is installed. Using #!/usr/bin/env bash and #!/usr/bin/env sh allows the system to locate the interpreter via the PATH environment variable.
Anything else you would like to add:
This affects all shell scripts in the hack/ directory:
hack/build-and-lint.sh
hack/build-binaries.sh
hack/build.sh
hack/linter.sh
hack/test-all.sh
hack/test-e2e.sh
hack/test-external-loop-cert-manager.sh
hack/test-external.sh
hack/test.sh
hack/verify-no-dirty-files.sh
Systems where this is particularly relevant:
NixOS: Bash is located at /run/current-system/sw/bin/bash
Some BSD systems: May have bash in /usr/local/bin/bash
Custom environments: Where bash is installed in non-standard locations
Using /usr/bin/env is the POSIX-recommended approach for portable shell scripts and is already widely adopted in the Go ecosystem (many vendor scripts already use this pattern).
Environment:
kapp version: N/A (affects repository scripts, not runtime)
OS: Any non-standard Unix-like system (NixOS, BSD variants, etc.)
Activity