Bug 72533 - hardcoding #!/usr/bin/python is not portable
Summary: hardcoding #!/usr/bin/python is not portable
Alias: None
Product: ITS Tool
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Shaun McCance
QA Contact:
Depends on:
Reported: 2013-12-09 18:11 UTC by Allison Lortie (desrt)
Modified: 2014-03-13 14:12 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

[PATCH] Don't hardcode python path (963 bytes, patch)
2013-12-09 18:22 UTC, Allison Lortie (desrt)
Details | Splinter Review

Description Allison Lortie (desrt) 2013-12-09 18:11:43 UTC
Many systems have python in /usr/local/bin

Should probably change this to #!/usr/bin/env python2

Not sure what to do about the -s... (since shbangs take only 1 argument).
Comment 1 Allison Lortie (desrt) 2013-12-09 18:11:59 UTC
I suppose we could have a configure check and a substitution macro.  I'll try a patch.
Comment 2 Allison Lortie (desrt) 2013-12-09 18:22:34 UTC
Created attachment 90532 [details] [review]
[PATCH] Don't hardcode python path

Instead, use automake to find it at runtime and put #!@PYTHON@ at the top of
Comment 3 Shaun McCance 2013-12-11 17:12:14 UTC
Pushed to master. Thanks.
Comment 4 Rafael Fontenelle 2014-03-13 14:12:32 UTC
The file 'configure.ac' calls 'python' binary, but Arch Linux has Python 2 binary named to 'python2'. This breaks the compilation. Would it be possible to use something more portable, like a $PYTHON variable?

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.