Open Bug 1185395 Opened 9 years ago Updated 7 years ago

mach mercurial-setup command always fails on Windows

Categories

(Developer Services :: Mercurial: configwizard, defect)

x86_64
Windows
defect
Not set
normal

Tracking

(Not tracked)

People

(Reporter: alpha.abdoulaye, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0
Build ID: 20150630154324

Steps to reproduce:

Run mach mercurial-setup
After prompt :
"To begin, press the enter/return key."
Press enter


Actual results:

The command fails, here is the output :

$ ./mach mercurial-setup
I'm going to help you ensure your Mercurial is configured for optimal
development on Mozilla projects.

If your environment is missing some recommended settings, I'm going to prompt
you whether you want me to make changes: I won't change anything you might not
want me changing without your permission!

If your config is up-to-date, I'm just going to ensure all 3rd party extensions
are up to date and you won't have to do anything.

To begin, press the enter/return key.

Traceback (most recent call last):
  File "c:\mozilla-build\python\Scripts\hg", line 41, in <module>
    mercurial.util.setbinary(fp)
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 106, in __getattribute__
    self._load()
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 78, in _load
    mod = _hgextimport(_import, head, globals, locals, None, level)
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 47, in _hgextimport
    return importfunc(name, globals, *args)
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\util.py", line 30, i
n <module>
    cachestat = platform.cachestat
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 106, in __getattribute__
    self._load()
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 78, in _load
    mod = _hgextimport(_import, head, globals, locals, None, level)
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 47, in _hgextimport
    return importfunc(name, globals, *args)
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\windows.py", line 13
, in <module>
    executablepath = win32.executablepath
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 106, in __getattribute__
    self._load()
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 78, in _load
    mod = _hgextimport(_import, head, globals, locals, None, level)
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 47, in _hgextimport
    return importfunc(name, globals, *args)
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\win32.py", line 10,
in <module>
    _kernel32 = ctypes.windll.kernel32
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 106, in __getattribute__
    self._load()
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 78, in _load
    mod = _hgextimport(_import, head, globals, locals, None, level)
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 47, in _hgextimport
    return importfunc(name, globals, *args)
  File "c:\mozilla-build\python\lib\ctypes\__init__.py", line 10, in <module>
    from _ctypes import Union, Structure, Array
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 134, in _demandimport
    mod = _hgextimport(_origimport, name, globals, locals)
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 47, in _hgextimport
    return importfunc(name, globals, *args)
ImportError: DLL load failed: The specified procedure could not be found.
Error running mach:

    ['mercurial-setup']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.

You should consider filing a bug for this issue.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

CalledProcessError: Command '[u'c:\\mozilla-build\\python\\Scripts\\hg.exe', u'-
-version']' returned non-zero exit status 1

  File "c:\mozilla-central\tools/mercurial/mach_commands.py", line 68, in mercur
ial_setup
    result = wizard.run(map(os.path.expanduser, config_paths))
  File "c:\mozilla-central\tools/mercurial\hgsetup\wizard.py", line 235, in run
    hg_version = get_hg_version(hg)
  File "c:\mozilla-central\python/mozversioncontrol\mozversioncontrol\__init__.p
y", line 19, in get_hg_version
    info = subprocess.check_output([hg, '--version'], env=env)
  File "c:\mozilla-build\python\lib\subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)


Expected results:

It should help configuring mercurial automatically without any problem.
Summary: mach mercurial-setup command always fail → mach mercurial-setup command always fails
Summary: mach mercurial-setup command always fails → mach mercurial-setup command always fails on Windows 8.1
Woah! Funky error. Thanks for reporting. It certainly looks like your Mercurial install is somewhat busted.

Are you using MozillaBuild 2.0? If not, please upgrade. If so, does `hg --version` work from your MozillaBuild shell? What about `c:\mozilla-build\python\Scripts\hg.exe --version` from a Windows command shell?
Flags: needinfo?(alpha)
I installed the latest version of Mozilla build a few days ago, because it was recommended when I ran `mach mercurial-setup`

So here is the output of `hg --version`:

Mercurial Distributed SCM (version 3.4.1)
(see http://mercurial.selenic.com for more information)

Copyright (C) 2005-2015 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



And here is the output for `c:\mozilla-build\python\Scripts\hg.exe --version` :

>c:\mozilla-build\python\Scripts\hg.exe --version
Traceback (most recent call last):
  File "c:\mozilla-build\python\Scripts\hg", line 41, in <module>
    mercurial.util.setbinary(fp)
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 106, in __getattribute__
    self._load()
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 78, in _load
    mod = _hgextimport(_import, head, globals, locals, None, level)
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 47, in _hgextimport
    return importfunc(name, globals, *args)
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\util.py", line 30, i
n <module>
    cachestat = platform.cachestat
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 106, in __getattribute__
    self._load()
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 78, in _load
    mod = _hgextimport(_import, head, globals, locals, None, level)
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 47, in _hgextimport
    return importfunc(name, globals, *args)
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\windows.py", line 13
, in <module>
    executablepath = win32.executablepath
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 106, in __getattribute__
    self._load()
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 78, in _load
    mod = _hgextimport(_import, head, globals, locals, None, level)
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 47, in _hgextimport
    return importfunc(name, globals, *args)
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\win32.py", line 10,
in <module>
    _kernel32 = ctypes.windll.kernel32
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 106, in __getattribute__
    self._load()
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 78, in _load
    mod = _hgextimport(_import, head, globals, locals, None, level)
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 47, in _hgextimport
    return importfunc(name, globals, *args)
  File "c:\mozilla-build\python\lib\ctypes\__init__.py", line 10, in <module>
    from _ctypes import Union, Structure, Array
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 134, in _demandimport
    mod = _hgextimport(_origimport, name, globals, locals)
  File "c:\mozilla-build\python\Lib\site-packages\mercurial\demandimport.py", li
ne 47, in _hgextimport
    return importfunc(name, globals, *args)
ImportError: DLL load failed: The specified procedure could not be found.
Flags: needinfo?(alpha)
Status: UNCONFIRMED → NEW
Ever confirmed: true
This sounds like a bug in MozillaBuild. RyanVM?

You may get a more useful stack trace by running:

  HGDEMANDIMPORT=disable c:\mozilla-build\python\Scripts\hg.exe --version

I can't remember if that is valid Windows command shell syntax. You may have to run SET to export the environment variable:

  $ SET HGDEMANDIMPORT=disable
  $ c:\mozilla-build\python\Scripts\hg.exe --version

I'd be interested in seeing that stack trace as well.
Flags: needinfo?(ryanvm)
I could have sworn this was working while we were testing MB 2.0.
Flags: needinfo?(ryanvm)
OS: Unspecified → Windows 8.1
Hardware: Unspecified → x86_64
I get a similar failure, only after about fifteen of the wizard's [Y/n] questions. It then fails thus (see notes at the bottom):

    Would you like qnew to set patch author by default? [Y/n]

    Configured qnew to set patch author by default.

    Error running mach:

        ['mercurial-setup']

    The error occurred in code that was called by the mach command. This is either
    a bug in the called code itself or in the way that mach is calling it.

    You should consider filing a bug for this issue.

    If filing a bug, please include the full output of mach, including this error
    message.

    The details of the failure are as follows:

    ValueError: need more than 2 values to unpack

      File "c:\Users\Giulio\Projects\Mozilla\comm-central\mozilla\tools/mercurial/mach_commands.py", line 68, in mercurial_setup
        result = wizard.run(map(os.path.expanduser, config_paths))
      File "c:\Users\Giulio\Projects\Mozilla\comm-central\mozilla\tools/mercurial\hgsetup\wizard.py", line 385, in run
        bzuser, bzpass, bzuserid, bzcookie = c.get_bugzilla_credentials()



NOTES:
======
- MozillaBulid 2.0 installed
- Building comm-central, not mozilla-central
- 'hg --version' works in the MozillaBuild shell
- 'mozilla-build\python\Scripts\hg.exe --version' from a Windows shell FAILS with message "abort: failed to load Python DLL"

Has anyone got any suggestion? Thanks!
That last error is fixed in mozilla-central (87c4b1fb525534d447a8cd97ed9597b5112a060a / bug 1188931).
And, it sounds like the bug here is hg.exe is broken in a Windows command prompt (as opposed to MozillaBuild/msys/bash shell).
gps: thanks, that worked. As a side note, I notice that the mercurial.ini file created by mercurial-setup (on Win 8.1) has every line ending with CR CR LF (or '\r\r\n'), i.e. it seems to adopt the Mac and Windows file formats combined.
Not sure if it's worth tidying that up, anyway.
Component: mach → Mercurial: configwizard
Product: Core → Developer Services
Version: 42 Branch → Trunk
I can reproduce this too (Windows 10).
OS: Windows 8.1 → Windows
Summary: mach mercurial-setup command always fails on Windows 8.1 → mach mercurial-setup command always fails on Windows
(I've just installed MozillaBuild 2.2.0)
You need to log in before you can comment on or make changes to this bug.