-
-
Notifications
You must be signed in to change notification settings - Fork 688
Description
What version of Racket are you using?
8.0 of course :-) Congratulations on that release!
What program did you run?
$ exec -a some-different-name ./mzscheme
What should have happened?
mzscheme should have started as normal, just as it does when invoked simply by ./mzscheme
.
If you got an error message, please include it here.
The start aborts:
$ $ exec -a some-different-name ./mzscheme
read failed to read all 23 bytes from file /tmp/mzscheme
Aborted (core dumped)
Please include any other relevant details
The issue was noticed in NixOS (specifically this issue). There, the mzscheme
binary is replaced by a wrapper shell script which first sets some environment variables, as NixOS takes care not to pollute the global /bin namespace (and their likes). As its final command, this wrapper shell script executes the true mzscheme binary (located in /nix/store/.../.mzscheme-wrapped
) as follows:
exec -a mzscheme /nix/store/.../.mzscheme-wrapped "$@"
It appears that the true binary attempts to read some bytes from argv[0]
. This fails because argv[0]
points to the wrapper shell script instead of the true binary.
A simple way out for us would be to patch the source so that the true binary no longer uses argv[0]
for direction but instead uses a hardcoded path. Could you point us to the relevant point in the source?