Closed
Bug 972329
Opened 11 years ago
Closed 11 years ago
Install setuptools as part of bootstrap
Categories
(Firefox Build System :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla33
People
(Reporter: past, Assigned: quadeer.leo)
Details
(Whiteboard: [mentor=gps][lang=python][good first bug])
Attachments
(1 file, 2 obsolete files)
|
923 bytes,
patch
|
gps
:
review+
|
Details | Diff | Splinter Review |
I get this error all the time on my Linux box, but not on my OS X box:
fx-team$ hg qref
error: commit.critic hook raised an exception: distribute
Disabling mozext makes it go away.
Comment 1•11 years ago
|
||
No stack trace?
That error message isn't a lot to go on. I suspect this may be an issue with Python packaging, as "distribute" is a [legacy] Python package manager thingy.
It would be amazing if you could provide reproduce steps.
| Reporter | ||
Comment 2•11 years ago
|
||
I'm on Ubuntu 13.10, Python 2.7.5+ (as reported by --version) and mercurial 2.8.2. In general I keep everything up to date ('mach mercurial-setup' every few days, etc.). I've always been getting this on fx-team tip every time I simply qrefresh the topmost patch without any changes. Is there anything else I could provide?
Comment 3•11 years ago
|
||
Try running the hg command with --traceback --debug?
| Reporter | ||
Comment 4•11 years ago
|
||
Certainly:
$ hg qref
error: commit.critic hook raised an exception: distribute
$ hg qref --traceback --debug
removing unknown node cfe39af7826e from 1-phase boundary
invalid branchheads cache (served): tip differs
js/src/jit-test/tests/debug/Frame-executionReason-01.js
js/src/jsapi.cpp
js/src/jsapi.h
js/src/jscntxt.cpp
js/src/jscntxt.h
js/src/shell/js.cpp
js/src/vm/Debugger.cpp
js/src/vm/Stack-inl.h
js/src/vm/Stack.h
running hook commit.whitespace: hg export tip | (! grep -C 3 --color=always -n '^+.*[ ]$')
calling hook commit.critic: <function critic_hook at 0x7f085dbc8398>
error: commit.critic hook raised an exception: distribute
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/mercurial/hook.py", line 81, in _pythonhook
r = obj(ui=ui, repo=repo, hooktype=name, **args)
File "/home/past/.mozbuild/version-control-tools/hgext/mozext/__init__.py", line 706, in critic_hook
critique(ui, repo, node=node, **opts)
File "/home/past/.mozbuild/version-control-tools/hgext/mozext/__init__.py", line 405, in critique
style = get_style_guide(parse_argv=False, ignore='E128')
File "/home/past/.mozbuild/version-control-tools/pylib/flake8/flake8/engine.py", line 75, in get_style_guide
kwargs['parser'], options_hooks = get_parser()
File "/home/past/.mozbuild/version-control-tools/pylib/flake8/flake8/engine.py", line 38, in get_parser
(extensions, parser_hooks, options_hooks) = _register_extensions()
File "/home/past/.mozbuild/version-control-tools/pylib/flake8/flake8/engine.py", line 24, in _register_extensions
checker = entry.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2014, in load
if require: self.require(env, installer)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2027, in require
working_set.resolve(self.dist.requires(self.extras),env,installer))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 594, in resolve
raise DistributionNotFound(req)
DistributionNotFound: distribute
Comment 5•11 years ago
|
||
I got something similar with "setuptools" instead of "distribute" and I resolved it by installing the python-setuptools package in my Linux.
Maybe a more useful feedback could be good, but I don't know enough Python to know how to do it :)
Comment 6•11 years ago
|
||
I'd say installing some combination of "pip" "setuptools" and "virtualenv" Python packages should resolve this. I would expect those to get installed as dependencies of other system packages. Kind of crazy these aren't available when Python is installed :/
| Reporter | ||
Comment 7•11 years ago
|
||
Installing python-setuptools fixed it for me, too! Should we close this bug or is there a way to make sure that package gets installed from 'mach bootstrap' or 'mach mercurial-setup'?
Comment 8•11 years ago
|
||
Ideally I'd like a better error message than "DistributionNotFound" that's not so useful for non-Python developers.
Comment 9•11 years ago
|
||
Let's install setuptools as part of bootstrap.
Code here in in python/mozboot. The hardest part here is digging up package names for all the operating systems.
Component: mozext → Build Config
Product: Other Applications → Core
Summary: commit.critic hook raised an exception: distribute → Install setuptools as part of bootstrap
Whiteboard: [mentor=gps][lang=python][good first bug]
Comment 10•11 years ago
|
||
I'd like to try this one. I guess that I have to change some of the files here: https://hg.mozilla.org/mozilla-central/file/9d3da41ad0b6/python/mozboot/mozboot, right?
I don't have to change anything for OS X (when using Homebrew, at least), since setuptools gets automatically installed. I'm going to check about MacPorts.
About Linux (and *BSD), it's going to be as "simple" as adding the appropriate package to the package list.
| Assignee | ||
Comment 11•11 years ago
|
||
Hello!
I have learned Python basics and would like to test them by trying to fix this bug. Can I get assigned to it with some starting pointers? I am completely new in open source.
Thanks!
Comment 12•11 years ago
|
||
There are files in python/mozboot/mozboot/ that contain lists of packages to install. You want to spin up some virtual machines, run the one-line bootstrapper from [1] and verify "setuptools" is a valid command in your shell when it completes.
[1] https://developer.mozilla.org/en-US/docs/Simple_Firefox_build/Linux_and_MacOS_build_preparation
| Assignee | ||
Comment 13•11 years ago
|
||
Thank you for your reply. So I completed the steps in [1]. Now do I need to build Firefox to modify the package list or just download the source? What do I do next?
Updated•11 years ago
|
Assignee: nobody → quadeer.leo
Status: NEW → ASSIGNED
| Assignee | ||
Comment 14•11 years ago
|
||
This is only for Debian distros.
Attachment #8434551 -
Flags: review?(gps)
Comment 15•11 years ago
|
||
Comment on attachment 8434551 [details] [diff] [review]
This file present in python/mozboot/mozboot installs setuptools as a part of bootstrap build
Could you please upload the attachment as a diff (as opposed to the full file)? Please see https://developer.mozilla.org/en-US/docs/Mercurial_FAQ#How_can_I_generate_a_patch_for_somebody_else_to_check-in_for_me.3F
Attachment #8434551 -
Flags: review?(gps)
Comment 16•11 years ago
|
||
virtualenv is supposed to be installing pip and setuptools. They are shipped as support files in python/virtualenv/virtualenv_support. I'd rather look why those aren't picked before adding dependencies on system libraries that shouldn't be used in the first place.
Comment 17•11 years ago
|
||
Forget comment 16, I missed the fact that this was not errors with the build system. That being said, if installing mercurial doesn't pull the right packages on a distro, bugs should be filed on that distro.
| Assignee | ||
Comment 18•11 years ago
|
||
Attachment #8438593 -
Flags: review?(gps)
| Assignee | ||
Comment 19•11 years ago
|
||
Sorry for late reply I was bed ridden
Comment 20•11 years ago
|
||
Comment on attachment 8438593 [details] [diff] [review]
Imports setuptools in Debian.py
Review of attachment 8438593 [details] [diff] [review]:
-----------------------------------------------------------------
This looks good. I'll check it in for you.
Attachment #8438593 -
Flags: review?(gps) → review+
Comment 21•11 years ago
|
||
Updated patch ready for checkin (added DONTBUILD to commit message).
Updated•11 years ago
|
Assignee: quadeer.leo → gps
Updated•11 years ago
|
Attachment #8434551 -
Attachment is obsolete: true
Updated•11 years ago
|
Attachment #8438620 -
Flags: review+
Updated•11 years ago
|
Attachment #8438593 -
Attachment is obsolete: true
Comment 22•11 years ago
|
||
Trees are closed. Adding checkin-needed. This is NPOTB, so no try run should be required.
Keywords: checkin-needed
Updated•11 years ago
|
Assignee: gps → quadeer.leo
Comment 23•11 years ago
|
||
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
Updated•7 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•