Closed Bug 1131048 Opened 9 years ago Closed 2 years ago

client.py dies when hg is installed as a python package instead of standalone

Categories

(Firefox Build System :: General, defect)

x86
Windows 8.1
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: RyanVM, Unassigned)

References

Details

This was brought to my attention by Neil in bug 906200 RE: comm-central, but mozilla-central's client.py has the same issue.

$ python client.py checkout
Executing command: ['hg', 'pull', '-R', '.\\.']
The exception was:
WindowsError: [Error 2] The system cannot find the file specified

Retrying previous command: 1 of 1 time(s)
Executing command: ['hg', 'pull', '-R', '.\\.']
The exception was:
WindowsError: [Error 2] The system cannot find the file specified

Executing command: ['hg', 'update', '-r', 'default', '-R', '.\\.']
Traceback (most recent call last):
  File "client.py", line 661, in <module>
    do_hg_pull('.', options.comm_repo, options.hg, options.comm_rev)
  File "client.py", line 369, in do_hg_pull
    check_call_noisy(cmd, retryMax=0)
  File "client.py", line 144, in check_call_noisy
    execute_check_call(cmd, *args, **kwargs)
  File "client.py", line 140, in execute_check_call
    check_call(cmd, *args, **kwargs)
  File "c:\mozilla-build-test\python\lib\subprocess.py", line 535, in check_call
    retcode = call(*popenargs, **kwargs)
  File "c:\mozilla-build-test\python\lib\subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "c:\mozilla-build-test\python\lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "c:\mozilla-build-test\python\lib\subprocess.py", line 958, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
This feels like something you'll need to fix in MozillaBuild, doesn't it? This seems like a sane way to invoke hg, if that doesn't work then the hg install is weird.
I was waiting to see what Greg came up with in bug 1128586 to figure what if anything needed doing here.
The regression is found from "hg.exe" no longer being an available Windows executable now that Mercurial is distributed as a Python package and not a py2exe distribution in MozillaBuild. So, naive use of "hg" in subprocess.POpen() outside of shells will fail to resolve an executable. We have this problem with other Python commands. We know we need to execute things via `python` or by executing commands inside an msys shell which can resolve executables without the .exe.

Alternatively, installing an "hg.bat" in MozillaBuild *might* be a sufficient workaround. Although, then you run the risk of executing in Windows vs MSYS mode. This is all a can of worms.
(In reply to Gregory Szorc from comment #3)
> Alternatively, installing an "hg.bat" in MozillaBuild *might* be a
> sufficient workaround.

Ryan's MozillaBuild 2 beta already has python\Scripts\hg.bat on the path; In particular, if I start the MozillaBuild shell, then launch cmd.exe from there, I can still run hg commands.
Neil, can you please try out this build? Works for me in local testing.

http://people.mozilla.org/~rvandermeulen/MozillaBuildSetup2.0.0pre5.exe

sha1sum 8c12494706ae0cfc9d3ae17b2d1f803d76291297
Flags: needinfo?(neil)
I also experienced the issue and this new build fixes it.
(In reply to Ryan VanderMeulen from comment #5)
> Neil, can you please try out this build? Works for me in local testing.
> 
> http://people.mozilla.org/~rvandermeulen/MozillaBuildSetup2.0.0pre5.exe

python client.py checkout works fine in this build.

However I have already run into several other problems:
* The command prompt window from which I attempted to launch start-shell-msvc2013.bat unexpectedly closed itself
* vi seems to think all my files need to be converted from pc850 format
* Keypad arrow keys don't work in vi (can't edit e.g. the command line)
* The display of unapplied patches in hg qseries is unreadable
* The use of the -m -n and -S options to less by default still makes no sense
Flags: needinfo?(neil)
> * The display of unapplied patches in hg qseries is unreadable
That's bug 1141841.
Sounds like the vast majority of those are known issues with mintty that I assume go away if you turn off USE_MINTTY=1 at the top of start-shell.bat.
(In reply to neil@parkwaycc.co.uk from comment #7)
> * The command prompt window from which I attempted to launch
> start-shell-msvc2013.bat unexpectedly closed itself

Do me a favor and file this as a new bug so I don't lose track of it? I think I've gotten that report before but it never made it into a bug.
(In reply to Ryan VanderMeulen from comment #10)
> Do me a favor and file this as a new bug so I don't lose track of it?
[I filed Bug 1154514.]
Product: Core → Firefox Build System
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.