Bug 126512 - Web Inspector: jsmin.py uses shebang #!/usr/bin/python
Summary: Web Inspector: jsmin.py uses shebang #!/usr/bin/python
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-01-06 00:29 PST by Kerrick Staley
Modified: 2014-01-06 11:45 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kerrick Staley 2014-01-06 00:29:38 PST
WebCore/inspector/Scripts/jsmin.py uses the shebang #!/usr/bin/python; the correct shebang is #!/usr/bin/python2. See http://www.python.org/dev/peps/pep-0394/.
Comment 1 Radar WebKit Bug Importer 2014-01-06 00:29:50 PST
<rdar://problem/15751675>
Comment 2 Timothy Hatcher 2014-01-06 11:02:17 PST
What platforms does this affect?
Comment 3 Kerrick Staley 2014-01-06 11:17:04 PST
It affects Arch Linux and derived distros (e.g. Parabola).

All major Linux distros include the /usr/bin/python2 symlink, but OS X doesn't include it out-of-the-box. If you're concerned about out-of-the-box operation on OS X, you could make the shebang configurable using e.g. automake.

AFAIK the official Python installer for OS X *does* install /usr/bin/python2 by default and has done so for several years; not sure why it's not present on OS X.
Comment 4 Timothy Hatcher 2014-01-06 11:21:50 PST
Yes, out of the box on OS X is critical to keep working.

Would "#!/usr/bin/env python" be the right thing to do? That is what our other scripts in Tools/Scripts do.
Comment 5 Kerrick Staley 2014-01-06 11:32:51 PST
No, that won't work :(

The usual solution is that Arch Linux patches the upstream when creating packages, but I'm using a less sophisticated build system that doesn't allow automatic patching, and so manual action is needed before every build. It'd be nice if this weren't necessary.

Could you possibly look into why OS X doesn't provide /usr/bin/python2 ? It'd be nice if /usr/bin/python2 could work everywhere. Arch Linux changing /usr/bin/python was stupid IMHO, but upstream agrees with the eventual goal of making this change, and has recommended that scripts switch to /usr/bin/python2 now.
Comment 6 Timothy Hatcher 2014-01-06 11:45:01 PST
OS X switching to /usr/bin/python2 is out of our control and would be 1-2 years in the future if it happened. Plus WebKit supports building on OS X versions that will always only have /usr/bin/python.

This is a problem that needs solved on/by the affected platforms, not WebKit. As I mentioned all other scripts in WebKit use /usr/bin/python or /usr/bin/env python not just jsmin.py.