Skip to content

Instantly share code, notes, and snippets.

@ilyaluk
Created August 25, 2025 10:54
Show Gist options
  • Save ilyaluk/422dcb19b6ad78b5dd1b67cb6d495a66 to your computer and use it in GitHub Desktop.
Save ilyaluk/422dcb19b6ad78b5dd1b67cb6d495a66 to your computer and use it in GitHub Desktop.
diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.cpp b/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.cpp
index 1cd585887..09c42a230 100644
--- a/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.cpp
+++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.cpp
@@ -164,6 +164,13 @@ static fextl::string GetShebangInterpFile(std::span<char> Data) {
if (FHU::Filesystem::Exists(ShebangProgram)) {
return ShebangProgram;
}
+
+ // If the shebang program doesn't exist in rootfs, try the host filesystem
+ // This handles cases like /nix
+ ShebangProgram = ShebangArguments[0];
+ if (ShebangProgram[0] == '/' && FHU::Filesystem::Exists(ShebangProgram)) {
+ return ShebangProgram;
+ }
}
return {};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment