Closed Bug 1128586 Opened 5 years ago Closed 5 years ago

Make mach mercurial-setup work with a non-py2exe mercurial

Categories

(Firefox Build System :: Mach Core, enhancement)

37 Branch
All
Windows 7
enhancement
Not set

Tracking

(firefox38 fixed, firefox38.0.5 fixed, firefox39 fixed, firefox40 fixed, firefox-esr31 fixed, b2g-v2.0 fixed, b2g-v2.1 fixed, b2g-v2.1S fixed, b2g-v2.2 fixed, b2g-master fixed)

VERIFIED FIXED
mozilla40
Tracking Status
firefox38 --- fixed
firefox38.0.5 --- fixed
firefox39 --- fixed
firefox40 --- fixed
firefox-esr31 --- fixed
b2g-v2.0 --- fixed
b2g-v2.1 --- fixed
b2g-v2.1S --- fixed
b2g-v2.2 --- fixed
b2g-master --- fixed

People

(Reporter: gps, Assigned: gps)

References

Details

Attachments

(2 files)

Looks like the "find a binary" logic in mach mercurial-setup could use some work. See bug 545432 comment #40.
Just FYI, with these changes:

cp /path/to/mozilla-build/python/{lib/site-packages/setuptools/cli.exe,Scripts/hg.exe}
mv /path/to/mozilla-build/python/Scripts/hg{,-script.py}

I can use |mach mercurial-setup| to update ~/.hgrc and update version-control-tools w/o noticing any issue.

It seems a similar wrapper exe can be built by |python setup.py build_hgexe|, but I have no idea how to confirm it or how to do it with pip.

I hope this information could be of some help.
Yeah, I think we'd have to unpack the tar archive and manually run setup.py in order to use the build_hgexe option. Unfortunate that pip doesn't provide a way to run custom setup.py options AFAICT.
Pretty sure I've got this working now with build_hgexe. Will post a test build soon once I can test a bit locally.
OK, this generates the stub exe via build_hgexe. A cursory bit of testing says that it works as expected. Give it a shot and let me know please :)

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

sha1sum 8c12494706ae0cfc9d3ae17b2d1f803d76291297
Flags: needinfo?(gps)
(In reply to Ryan VanderMeulen [:RyanVM UTC-4] from comment #4)
> OK, this generates the stub exe via build_hgexe. A cursory bit of testing
> says that it works as expected. Give it a shot and let me know please :)
> 
> http://people.mozilla.org/~rvandermeulen/MozillaBuildSetup2.0.0pre5.exe
> 
> sha1sum 8c12494706ae0cfc9d3ae17b2d1f803d76291297

I have to |mv /c/mozilla-build-test/python/Scripts/hg{,exe.py}| for mach to pick up hg.exe instead of hg.
`mercurial version` doesn't always print the version number. `mercurial
--version` does. Use the latter.
Attachment #8598122 - Flags: review?(ryanvm)
Assignee: nobody → gps
Status: NEW → ASSIGNED
This is needed for compatibility with an upcoming release of
MozillaBuild, which distributes Mercurial as a Python package, not as a
standalone Windows program. As a result, it introduces "hg" into $PATH,
which "which" will happily prefer as the "hg" binary. This upsets
subprocess. So, we explicitly prefer "hg.exe" over "hg".

We could accomplish the same thing by calling which.whichall() and
sorting results. But this is more code and IMO not worth the effort to
implement.
Attachment #8598123 - Flags: review?(ryanvm)
Attachment #8598122 - Flags: review?(ryanvm) → review+
Attachment #8598123 - Flags: review?(ryanvm) → review+
I guess the landed patches address the needinfo :)
#fail
Flags: needinfo?(gps)
https://hg.mozilla.org/mozilla-central/rev/d439522e45ae
https://hg.mozilla.org/mozilla-central/rev/ae91360cc160
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
We may have set a record for most uplifts before a mozilla-central merge :)
(In reply to Hector Zhao [:hectorz] from comment #5)
> I have to |mv /c/mozilla-build-test/python/Scripts/hg{,exe.py}| for mach to
> pick up hg.exe instead of hg.

Better now after the patches that gps landed?
Flags: needinfo?(bzhao)
(In reply to Ryan VanderMeulen [:RyanVM UTC-4] from comment #18)
> (In reply to Hector Zhao [:hectorz] from comment #5)
> > I have to |mv /c/mozilla-build-test/python/Scripts/hg{,exe.py}| for mach to
> > pick up hg.exe instead of hg.
> 
> Better now after the patches that gps landed?

Yes, I changed it back and everything works fine.
Flags: needinfo?(bzhao)
Awesome, thanks for confirming!
Status: RESOLVED → VERIFIED
And the ugly-as-sin packaging patch to build hg.exe:
http://hg.mozilla.org/mozilla-build/rev/02826b9b3d53

I'd like to talk upstream into building hg.exe by default when |setup.py install| is invoked without --pure as it would make all of this go away and would be inconsequential to the final build.
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.