Bug 885233 - Use python2 when available in activation script - #1088
Bug 885233 - Use python2 when available in activation script#1088mrshu wants to merge 8 commits into
Conversation
|
Am I correct in understanding that this recursively edits every single file in the source tree (including JS, markdown, even .PNGs) and replaces "python" with "python2"? That sounds overkill.. wouldn't it be sufficient to only modify I'm a bit nervous about having bin/activate edit source code when it runs, but I suppose it's not too bad. One downside is that people using the SDK from a git checkout will observe some files being modified, so developers will need to pay attention and not commit the modified version. It might be safer to have the script replace the first line of Also, I'd recommend having the script run |
|
Sorry for this late reply.
You are absolutely correct and I do agree. Will change the code to do so.
Hmm, I understand where you nervousness comes from. Is there a better way of doing something like this? If not
Very good point, will do it that way.
Well, I don't very much see what would this be good for, I can only think of one scenario where this thinking fails and that is when |
There was a problem hiding this comment.
Changing bin/cfx as a part of the activation script isn't something we should do. At the least it will cause developers to accidentally submit those changes in patches
|
Sorry we won't be releasing any new versions of cfx, jpm is the replacement https://www.npmjs.com/package/jpm |
The following pull requests fixes the bug 885233.
The general procedure is as follows:
If there is a
python2executable present in the system the activation script will use it and change every occurrence ofpythonon lines like#!/usr/bin/env python.This approach has been used for long for the Arch Linux's PKGBUILD which can be found in the AUR (https://aur.archlinux.org/packages/ad/addon-sdk/PKGBUILD)
Please note that running
source bin/activatetakes a bit longer to run for the first time (around 3 seconds on my machine) but then uses the python2 executable without any delay.