[PATCH v2] osx: explicitly build hg with /usr/bin/python2.7

Kevin Bullock kbullock+mercurial at ringworld.org
Wed Jul 13 14:14:44 EDT 2016


> On Jul 13, 2016, at 11:41, Augie Fackler <raf at durin42.com> wrote:
> 
> # HG changeset patch
> # User Augie Fackler <augie at google.com>
> # Date 1468420773 14400
> #      Wed Jul 13 10:39:33 2016 -0400
> # Node ID 0093ec77d1ec1a34dd34cf2cf47c06e1cbce246a
> # Parent  90c0b1d4d7c835c122552a4a52978b5fdd0cf9eb
> osx: explicitly build hg with /usr/bin/python2.7
> 
> This should help avoid creating a package that depends on a custom
> Python, as happened when I built a package for 3.8.
> 
> diff --git a/Makefile b/Makefile
> --- a/Makefile
> +++ b/Makefile
> @@ -156,7 +156,7 @@ i18n/hg.pot: $(PYFILES) $(DOCFILES) i18n
> # Packaging targets
> 
> osx:
> -	python setup.py install --optimize=1 \
> +	/usr/bin/python2.7 setup.py install --optimize=1 \
> 	  --root=build/mercurial/ --prefix=/usr/local/ \
> 	  --install-lib=/Library/Python/2.7/site-packages/
> 	make -C doc all install DESTDIR="$(PWD)/build/mercurial/"
> diff --git a/tests/test-mac-packages.t b/tests/test-mac-packages.t
> --- a/tests/test-mac-packages.t
> +++ b/tests/test-mac-packages.t
> @@ -43,5 +43,11 @@ Spot-check some randomly selected files:
>   $ grep '/hg	' boms.txt | cut -d '	' -f 1,2,3
>   ./usr/local/bin/hg	100755	0/0
> 
> +Make sure the built binary uses the system Python interpreter
> +  $ tar xf mercurial.pkg/Payload usr/local/bin

This fails for me:

--- /Users/kbullock/Source/Projects/hg/hg/tests/test-mac-packages.t
+++ /Users/kbullock/Source/Projects/hg/hg/tests/test-mac-packages.t.err
@@ -45,9 +45,15 @@
 
 Make sure the built binary uses the system Python interpreter
   $ tar xf mercurial.pkg/Payload usr/local/bin
+  tar: This does not look like a tar archive
+  tar: Skipping to next header
+  tar: usr/local/bin: Not found in archive
+  tar: Exiting with failure status due to previous errors
+  [2]
 Use a glob to find this to avoid check-code whining about a fixed path.
   $ head -n 1 usr/local/b?n/hg
-  #!/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
+  head: usr/local/b?n/hg: No such file or directory
+  [1]
 
 Note that we're not currently installing any /etc/mercurial stuff,
 including merge-tool configurations.

It seems that Payload is actually a gzipped cpio archive:

$ gunzip -c mercurial.pkg/Payload | file -
/dev/stdin: ASCII cpio archive (pre-SVR4 or odc)

I'm on Yosemite. Is this different on El Capitan?

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock



More information about the Mercurial-devel mailing list