On Tue, Aug 23, 2016 at 9:20 AM, jan matejek
hi,
On 23.8.2016 13:54, Christian Boltz wrote:
Hello,
Am Montag, 22. August 2016, 15:23:08 CEST schrieb jan matejek:
I like this idea. I'll see what I can do about making it work. ISTM you basically only need to substitute the correct executable? Possibly mess with what "env python" returns, but OTOH perhaps we should run the scripts with an explicit interpreter, and consider "env python" a bug... which we've been quietly doing since forever.
You are raising an interesting detail here - shoud python scripts have #!/usr/bin/python3 or #!/usr/bin/env python3 ?
Both work, but I wonder if (and why) one of them is "better". Can you give some insights, please?
This is rather clear-cut: for (almost) everything *we* as the distribution provide, "#!/usr/bin/python3" is correct and the "env" variant is incorrect.
The reason being, "/usr/bin/env python3" will happily pick up whichever hand-built version of python the user has placed in their $PATH (or $python3). This is also the purpose of using the "env" construction: as an ISV you can't know whether /usr/bin/python3 exists, or is it in /usr/local, or somewhere in /opt, or maybe in the user's home...
However, the programs that we provide must run against the runtimes that we provide -- hence, explicit path. (The users still have the option of executing /opt/myworkspace/bin/python3 script.py, skipping the shebang line altogether.)
...the situation in the build environment is less clear-cut, as the scripts that run during the build are not yet "provided by us"... that's why i was considering messing with the result of env.
So if we have a third-party package that provides python scripts, should we modify the scripts to change this, or does this only apply if we add it ourselves? If the former, is there any way to automate this since it would require changing a huge number of packages. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org