Closed Bug 1600559 Opened 6 years ago Closed 6 years ago

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)

defect

Tracking

(Not tracked)

RESOLVED FIXED

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.

I can confirm that an hg pull -u in $HOME/.mozbuild/evolve fixes this.

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?

Flags: needinfo?(jwatt)

Yes, it does run it, but as you can see from the log I just attached it does not (sufficiently?) update evolve.

Flags: needinfo?(jwatt)

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.

Nope, that doesn't seem to be it.

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.

(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...

Fwiw, I don't have a $HOME/.mozbuild/evolve folder at all. Mine appears to be in $HOME/.mozbuild/version-control-tools/hgext/evolve

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.

Assignee: nobody → jwatt

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.

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.

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

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: