Closed
Bug 782958
Opened 12 years ago
Closed 9 years ago
Add pip and virtualenv to MozillaBuild
Categories
(Firefox Build System :: MozillaBuild, task)
Firefox Build System
MozillaBuild
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: emorley, Assigned: RyanVM)
References
Details
Attachments
(1 file)
16.77 KB,
patch
|
gps
:
review+
|
Details | Diff | Splinter Review |
It would be useful to add pip to MozillaBuild, so we don't have to easy_install it whenever working on projects that use it for setup (eg OrangeFactor, bug 782953).
Assignee | ||
Updated•12 years ago
|
Blocks: MozillaBuild2.0
Assignee | ||
Comment 1•10 years ago
|
||
Not going to commit to it at this point, but I'll look into this.
Assignee: nobody → ryanvm
Comment 2•10 years ago
|
||
Add virtualenv and you get pip for free. FWIW, we already have virtualenv in m-c. If you create a virtualenv via m-c, that virtualenv will have pip in it. That should work in MozillaBuild today.
Assignee | ||
Updated•10 years ago
|
Summary: Add pip to MozillaBuild → Add pip and virtualenv to MozillaBuild
Assignee | ||
Comment 4•10 years ago
|
||
I have this mostly-working, except for one ugly issue. As alluded to by http://hg.mozilla.org/mozilla-build/file/58edf3344962/packageit.py#l160, the path to the python executable gets hard-coded during the installation process. In the current world, it gets baked into python/Scripts/*.exe (pip.exe, virtualenv.exe, etc). Looking at the page referenced in that comment, I guess that means I need to somehow make use of the --executable flag to override that, but I'm not exactly sure how that works yet.
Assignee | ||
Comment 5•10 years ago
|
||
So IIUC, basically munge_easy_install_script is going to have to be rewritten to find the <stagedir>\mozilla-build\python\python.exe line in each exe and re-write it to just python.exe without corrupting the end result. Fun.
Comment 6•10 years ago
|
||
It's been so long since I wrote that code that I don't remember anything about it. Rewriting exes sounds horrible, but if it's just C strings inside the binary that you're rewriting to a shorter string it should be doable. Alternately you could hack away at the stuff that's causing full paths to get inserted there, but that might be a losing battle.
Assignee | ||
Comment 7•10 years ago
|
||
I manually modified the path with Notepad++ and it appears to have worked ok, so I think that's going to be the way to go when I get back from vacation.
Assignee | ||
Comment 8•9 years ago
|
||
I shamelessly cribbed some example code off StackOverflow that appears to be working nicely. As it stands currently, I'm just downloading and installing whatever the latest version available is from pip (vs. installing an in-tree version or specifying the version when downloading from pip). Does anybody object to that? I don't see any major issues just going with the latest. And if we find some future version of one of the packages to be problematic, we can always fix it to a specific version then. And finally, a test build (including hg 3.2.4 from bug 545432): http://people.mozilla.org/~rvandermeulen/MozillaBuildSetup2.0.0pre.exe (78.1MB) SHA1: 21887713c187744a72081ba9ac1574e37c894411 I definitely recommend not installing this over top of an existing install. Feedback welcome!
Comment 9•9 years ago
|
||
Installing latest version from pip at time of the MozillaBuild install is somewhat concerning. One of the properties of today's MozillaBuild that I like is it is deterministic. If you have a specific MozillaBuild installer/binary, you are guaranteed certain results. And this means that Firefox builds are more easily deterministic and reproducible. Downloading the latest version of pip, virtualenv from the web would change that. I favor embedding the latest pip/virtualenv release in the MozillaBuild installer. Or, at least pin the version number in the installer. Those concerns aside, using the latest versions of pip and virtualenv should have minimal risk beyond determinism concerns. I'm very curious to see all the patches to MozillaBuild! Thanks so much for doing this work.
Assignee | ||
Comment 10•9 years ago
|
||
Pulling the latest versions from pip occurs during installer packaging. Nothing is pulled from the web during the installation process :)
Assignee | ||
Comment 11•9 years ago
|
||
This patch: 1) Runs ensurepip from python 2.7.9, then updates pip & setuptools to their latest versions (not sure why ensurepip doesn't install the latest to begin with). 2) Installs virtualenv from pip. 3) Removes the hardcoded paths to python.exe from each shebang in the python Scripts directory. 4) Removes obsolete components from the MozillaBuild repo. Note that all of the above happens during packaging, not as part of the client installation.
Attachment #8551428 -
Flags: review?(gps)
Comment 12•9 years ago
|
||
Comment on attachment 8551428 [details] [diff] [review] patch Review of attachment 8551428 [details] [diff] [review]: ----------------------------------------------------------------- What could possibly go wrong?
Attachment #8551428 -
Flags: review?(gps) → review+
Assignee | ||
Comment 13•9 years ago
|
||
http://hg.mozilla.org/mozilla-build/rev/05664c670e65
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Updated•1 year ago
|
Product: mozilla.org → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•