Evolve broken: "failed to import extension evolve from .mozbuild/evolve/hgext3rd/evolve: unicode 'evolve|stabilize|solve' found in cmdtable
Categories
(Firefox Build System :: Bootstrap Configuration, defect, P2)
Tracking
(Not tracked)
People
(Reporter: jwatt, Assigned: jwatt)
Details
Attachments
(2 files)
I updated a bunch of software on my laptop (including updating homebrew packages) over the weekend and it seems something broke Mercurial's evolution extension:
$ hg st
*** failed to import extension evolve from $HOME/.mozbuild/evolve/hgext3rd/evolve: unicode 'evolve|stabilize|solve' found in cmdtable
*** (use b'' to make it byte string)
I'm assuming this is a Python 3 related issue - maybe Mercurial updating to use Python 3 now (which happened about a month ago).
Looking at the code in the latest incarnation of @eh.command in evolvecmd.py it seems this issue (the immediate one at least) has been fixed.
| Assignee | ||
Comment 1•6 years ago
|
||
I can confirm that an hg pull -u in $HOME/.mozbuild/evolve fixes this.
Comment 2•6 years ago
|
||
As I just noted on the newsgroup/mailing list, bootstrap offers to run vcs-setup which offers to update evolve. Does that not happen for you?
| Assignee | ||
Comment 3•6 years ago
|
||
| Assignee | ||
Comment 4•6 years ago
|
||
Yes, it does run it, but as you can see from the log I just attached it does not (sufficiently?) update evolve.
| Assignee | ||
Comment 5•6 years ago
|
||
Oh, wait, although the output asks "This wizard will guide you through configuring Mercurial...", it doesn't actually contain the lines that you mention in the mailing list. I wonder if this is happening because my ~/.hgrc contains:
evolve = $HOME/.mozbuild/evolve/hgext3rd/evolve
Instead of:
evolve = /Users/jwatt/.mozbuild/evolve/hgext3rd/evolve
That would be unfortunate, because I really want to continue to use the former so that I can share my ~/.hgrc between multiple machines where the user's $HOME is a different path.
| Assignee | ||
Comment 6•6 years ago
|
||
Nope, that doesn't seem to be it.
| Assignee | ||
Comment 7•6 years ago
|
||
FWIW the ~/.mozbuild/evolve repo is at rev dd68ce259708 which seems to be 4 months old. There doesn't seem to be anything unexpected in it (per hg st), and I don't think I've ever messed with it manually before.
Comment 8•6 years ago
|
||
(In reply to Jonathan Watt [:jwatt] from comment #4)
Yes, it does run it, but as you can see from the log I just attached it does not (sufficiently?) update evolve.
From the log, it doesn't look like it's trying to update evolve at all. It looks like it doesn't recognize the path where you've got evolve installed from:
https://hg.mozilla.org/hgcustom/version-control-tools/file/tip/hgext/configwizard/__init__.py#l964
https://hg.mozilla.org/hgcustom/version-control-tools/file/tip/hgext/configwizard/__init__.py#l985
ie
remote_evolve_path = b'https://www.mercurial-scm.org/repo/evolve/'
# Install to the same dir as v-c-t, unless the mozbuild directory path is passed (testing)
evolve_clone_dir = ui.config(b'mozilla', b'mozbuild_state_path', _vcthome())
local_evolve_path = b'%(evolve_clone_dir)s/evolve' % {b'evolve_clone_dir': evolve_clone_dir}
evolve_config_value = '%(evolve_path)s/hgext3rd/evolve' % \
{'evolve_path': pycompat.sysstr(local_evolve_path)}
# If evolve is not installed, install it
if not ui.hasconfig(b'extensions', b'evolve'):
...
# If evolve is installed and managed by this wizard,
# update it via pull/update
elif ui.config(b'extensions', b'evolve') == evolve_config_value:
You could try adding a print() of evolve_config_value and the rv of ui.config to your local ~/.mozbuild/version-control-tools/hgext/configwizard/__init__.py to see what the difference is that's causing it not to pick this up? Could be something pretty dumb like trailing slash or whatever...
Comment 9•6 years ago
|
||
Fwiw, I don't have a $HOME/.mozbuild/evolve folder at all. Mine appears to be in $HOME/.mozbuild/version-control-tools/hgext/evolve
| Assignee | ||
Comment 10•6 years ago
|
||
This treats the path to the evolve extension that is specified in the user's
Mercurial configuration in the same way as it is in the Mercurial code:
https://www.mercurial-scm.org/repo/hg-committed/file/0cc916004f22/mercurial/extensions.py#l89
This keeps our code for this consistent with Mercurial, allowing environment
variables such as $HOME to be expanded correctly.
Updated•6 years ago
|
| Assignee | ||
Comment 11•6 years ago
|
||
Thanks for pointing me to the right code, Gijs!
Mats: how old are the files in there? It may be worth nuking your .mozbuild dir and running ./mach bootstrap to freshen everything up if the files are really old.
Comment 12•6 years ago
|
||
FWIW, I had a ~/.mozbuild/evolve on the stable branch at v9.1.0 (rev cc96716f2ebf). A simple hg pull -u didn't move to the v9.2.x needed to support py3. Either hg pull -u -r stable, or hg pull && hg up, successfully updates to f3faafa1e064, and the byte string error disappears.
Comment 13•6 years ago
|
||
Pushed by bjones@mozilla.com:
https://hg.mozilla.org/hgcustom/version-control-tools/rev/32834452583d
configwizard: treat the extensions.evolve config path as Mercurial does r=glob
Description
•