The case of the supersized shebang
The case of the supersized shebang
Posted Feb 18, 2019 22:48 UTC (Mon) by rweikusat2 (subscriber, #117920)In reply to: The case of the supersized shebang by NYKevin
Parent article: The case of the supersized shebang
> by the (userspace components of the) distro, and are accidentally useful to end users,
https://www.in-ulm.de/~mascheck/various/shebang/4.0BSD_ne...
The assumption that people who aren't "involved with a distro" must be "end users" (who have no business programming anything) is ... interesting ...
Posted Feb 19, 2019 1:24 UTC (Tue)
by KaiRo (subscriber, #1987)
[Link]
Posted Feb 19, 2019 9:36 UTC (Tue)
by brooksmoses (guest, #88422)
[Link] (5 responses)
If you're not writing code that's part a distro's userspace, you should (generally) be writing code to be portable across different distros. (Even if you're an end-user with only one computer, you may well change your distro in the future and want to run your old code.) However, a shebang line is not reliably portable -- to pick an example that I've recently been having pains with, "#!/usr/bin/python2" assumes that your distro has Python version 2 installed in /usr/bin/python2. If you instead have only /usr/bin/python2.7, or /usr/local/bin/python2, or something else, then it doesn't work. And shebangs don't follow the PATH, so you have to specify an absolute path.
In the particular case I was having pains with, the relevant code was in a testsuite, and it would have been much nicer to have Autoconf find the right interpreter and then call it explicitly via something like "$PYTHON testfile.py".
Posted Feb 19, 2019 13:48 UTC (Tue)
by NAR (subscriber, #1313)
[Link] (2 responses)
I guess that's why
Posted Feb 19, 2019 16:36 UTC (Tue)
by rweikusat2 (subscriber, #117920)
[Link]
[*] Eg, starting with perl 5.16, xs functions can't be loaded via Dynaloader anymore unless a new keyword is added to the existing code. The documentation makes it very clear that loading xs-functions via Dynaloader Is Just Wrong[tm], but there's no positive justification for the change.
Posted Feb 19, 2019 16:46 UTC (Tue)
by NYKevin (subscriber, #129325)
[Link]
Posted Feb 19, 2019 15:11 UTC (Tue)
by rweikusat2 (subscriber, #117920)
[Link]
*If* you want to run other people's code, don't stick interpeters in /opt/var/local/ultima-thule/lib/bin/asterisk/moff just because this makes perfect sense to you.
Posted Feb 19, 2019 17:01 UTC (Tue)
by zblaxell (subscriber, #26385)
[Link]
I, for one, would prefer to solve that problem.
i.e. have a namespace that I can reference from portable scripts, like "#!/prefix/org/python/python/2.7.5", where the python installation puts in as many symlinks as required to accurately state the level of backward compatibility achieved.
The case of the supersized shebang
The case of the supersized shebang
However, a shebang line is not reliably portable
The case of the supersized shebang
/usr/bin/env
was invented for...
The case of the supersized shebang
The case of the supersized shebang
The case of the supersized shebang
The case of the supersized shebang