Closed mpoquet closed 1 year ago
Sorry it took so long. I usually work on GameShell while I'm using it for teaching, and that's ... now.
This PR looks good.
I'm probably going to keep the #!/usr/bin/awk -f
shebang for now (commit 994257d), for POSIX conformity, but this should be a problem for NixOS as all the awk scripts are called by invoking awk explicitly.
Can you confirm it works without commit 994257d?
Hi, I can confirm that all awk scripts are called by invoking awk explicitly, it should work on NixOS :).
Perfect. I merged the relevant commits : d7258941 and 3af84956c2.
Context
Hi and first of all, thanks for your work on GameShell!
While I was investigating this project to determine whether we can use for teaching purposes at our university, I was not able to run it on my machine (log below), which runs a NixOS linux.
NixOS does not put executable files in
/bin
nor/usr/bin
but keep them in separate directories and sets$PATH
accordingly. The modifications of this PR made GameShell run on my machine by avoiding the use of absolute paths for external executable files.Log of failed first execution (before modifications)
Modifications done
$PATH
to look for the first matching executable. env is located in/usr/bin/env
on all systems I know (including NixOS, that ony has two executable files accessible from a common absolute path:/bin/sh
for booting shenanigans and/usr/bin/env
to find other executables).env -S
is used to give the-f
argument toawk
. the option may not be available on all systems but should work on any recent linux (GNU coreutils 8.30+, released on 2018-07-01), recent macOS and freebsd.PATH
before its modification by GameShell, so that we can run real commands from the user-givenPATH
.rm
with a specificPATH
(the user-givenPATH
) instead of calling it from an absolute location.Tests done
utils/archive.sh
with no arguments.I did this on two setups:
nyx
machine fromflake.nix
))Linux dahu-6.grenoble.grid5000.fr 5.10.0-18-amd64 #1 SMP Debian 5.10.140-1 (2022-09-02) x86_64 GNU/Linux
.