Size: 2175
Comment:
|
Size: 5776
Comment: minor tweaks to test setup description
|
Deletions are marked like this. | Additions are marked like this. |
Line 2: | Line 2: |
Line 4: | Line 3: |
Line 10: | Line 8: |
Line 20: | Line 17: |
The package can be found [[http://mercurial.selenic.com/release/windows/hackable/|here]]. Simply download, unzip, and run the included hg.exe. This package will not interfere with your existing Mercurial or Python installation. | |
Line 21: | Line 19: |
The package can be found [[http://mercurial.selenic.com/release/windows/hackable/|here]]. Simply download, unzip, and run the included hg.exe. Simply use `hg pull` and `hg update` to upgrade to the latest version. This package will not interfere with your existing Mercurial or Python installation. |
<!> There is usually no need to download new copies between releases, simply pull and update. |
Line 28: | Line 24: |
Line 32: | Line 27: |
* Mercurial source release, see [Downloads] | * Mercurial source release (see [[Download]]) |
Line 34: | Line 29: |
* The [[http://effbot.org/zone/exemaker.htm|exemaker]] launcher | * The [[https://bitbucket.org/timeless/exemaker/overview|exemaker]] launcher (binary available [[https://bitbucket.org/alexandrul/exemaker/downloads|here]]) |
Line 46: | Line 41: |
* Copy the `c:\hg\hg` to `c:\hg.py` and change the #! line to '#!hg-python/python.exe' | * Copy the `c:\hg\hg` to `c:\hg\hg.py` and change the #! line to '#!hg-python/python.exe' |
Line 49: | Line 44: |
== Running the test suite under MSYS == Most of the test suite can now be run on windows too. Writing tests and debugging failures might however require both knowledge of the traditional unix environment and of the windows environment. The tests that can’t be run on windows will automatically be skipped, so no test failures should be seen. It is not acceptable that so many tests are skipped - please improve that. Nobody is running the tests regularly, so it is very positive that you will see some false negatives. Creating a `hg-winhack` package and running the test suite requires almost the same environment. The following instructions will thus contain a lot of duplication of the instructions given above, and the instructions could perhaps be merged. (The “hackable” mentioned above might not work in development branches.) === Install MinGW/MSYS environment === * Install MinGW/MSYS with 'mingw-get-inst-*.exe' from http://sourceforge.net/projects/mingw/files/latest/download * Install some mandatory extra packages: `c:\MinGW\bin\mingw-get install msys-base msys-coreutils gcc` * Install some optional extra packages: `c:\MinGW\bin\mingw-get install msys-rxvt msys-vim msys-wget msys-unzip msys-zip msys-openssh` * Launch a console/terminal with: `c:\MinGW\msys\1.0\msys.bat --rxvt` and enjoy having a decent shell * Put 'c:/MinGW/bin' in '$PATH' ... or 'mount c:/MinGW /mingw' === Build hg-winhack === {{{ # create build directory hg clone http://selenic.com/hg hg-winhack # bootstrap Mercurial somehow cd hg-winhack # install python wget http://python.org/ftp/python/2.7.2/python-2.7.2.msi msiexec //i python-2.7.2.msi //qb # avoid MSYS magic mangling of '/i' cp -ar c:/Python27 hg-python27 # python can and should now be uninstalled again sed -i 's,-mno-cygwin, ,g' hg-python27/Lib/distutils/cygwinccompiler.py # build Mercurial extensions hg-python27/python setup.py build_ext -i --compiler=mingw32 # create hg.exe launcher sed 's,^#!/usr/bin/env python,#!hg-python27/python27.dll,g' hg > hg.py rm hg wget http://effbot.org/media/downloads/exemaker-1.2-20041012.zip -O exemaker.zip unzip -j exemaker.zip '*/exemaker.exe' rm exemaker.zip mv exemaker.exe hg.exe # zip it and ship it ... or continue running the test suite cd .. zip -r hg-winhack-x.x.zip hg-winhack/ }}} Note that this will leave you with both a `hg.exe` which can be used from windows and a `hg.py` which might be picked up if you have python with a .py installed. /i\ This version of exemaker will interpret the relative python path as relative to the current working directory. A new version from timeless should fix that. === Run the test suite === {{{ cd hg-winhack/tests export TMPDIR=c:/tmp # to avoid path that contains ~ which in general would require escaping PATH="`pwd`/../hg-python27:$PATH" ./run-tests.py -l }}} === Run tests involving Git === If you have Git installed on your Windows box, `hg-winhack` will incorrectly detect that git command is available, and will try to run Git-related tests. It will fail to do so, because it cannot run "git.cmd" from shell. * If you don't want to run Git tests, edit `hghave` file to `return False` instead of `return matchoutput('git --version 2>&1', r'^git version')` * If you prefer Git tests to be executed, find your Git installation folder, enter `cmd` folder and create `git` file (no extension) with the following contents: {{{#!/bin/sh $COMSPEC //C git.cmd $* }}} |
|
Line 50: | Line 100: |
Line 53: | Line 102: |
Line 55: | Line 103: |
CategoryDevelopers | CategoryDeveloper |
Hackable Mercurial for Windows
An approach to easily hack on the Mercurial source on Windows.
Contents
1. What is the Hackable package?
Compiling Mercurial is a significant barrier to testing and developing Mercurial on Windows. This package attempts to minimize that barrier by including:
- a private copy of Python (32-bit)
- complete Mercurial history
- pre-compiled extensions (32-bit MinGW GCC)
- an hg.exe wrapper to add to your path
- in-place editable source checked out and ready to go
2. Downloading and using
The package can be found here. Simply download, unzip, and run the included hg.exe. This package will not interfere with your existing Mercurial or Python installation.
There is usually no need to download new copies between releases, simply pull and update.
This package includes no global configuration, so if you're not already using Mercurial, you will need to configure your username and merge tools.
3. How it's built and how to build your own from scratch
Needed components:
- Python MSI installer, versions 2.4 - 2.7
Mercurial source release (see Download)
MinGW mingw-get tool
Steps:
- Download all the needed components
Install Python with msiexec /i python-2.6.6.msi /qb
Unpack the mingw-get tool into c:\MinGW and add c:\MinGW\bin to your path
Install the gcc compiler with mingw-get gcc
Unpack Mercurial source into c:\hg
Copy the Python install from c:\Python26 to c:\hg\hg-python26
Edit c:\hg\hg-python26\Lib\distutils\cygwinccompiler.py to remove all references to -mno-cygwin (thanks, GCC!)
Build Mercurial extensions in c:\hg with hg-python26\python setup.py build_ext -i --compiler=mingw32
Copy the c:\hg\hg to c:\hg\hg.py and change the #! line to '#!hg-python/python.exe'
Unpack exemaker and copy exemaker.exe to c:\hg\hg.exe
4. Running the test suite under MSYS
Most of the test suite can now be run on windows too. Writing tests and debugging failures might however require both knowledge of the traditional unix environment and of the windows environment.
The tests that can’t be run on windows will automatically be skipped, so no test failures should be seen. It is not acceptable that so many tests are skipped - please improve that. Nobody is running the tests regularly, so it is very positive that you will see some false negatives.
Creating a hg-winhack package and running the test suite requires almost the same environment. The following instructions will thus contain a lot of duplication of the instructions given above, and the instructions could perhaps be merged. (The “hackable” mentioned above might not work in development branches.)
4.1. Install MinGW/MSYS environment
Install MinGW/MSYS with 'mingw-get-inst-*.exe' from http://sourceforge.net/projects/mingw/files/latest/download
Install some mandatory extra packages: c:\MinGW\bin\mingw-get install msys-base msys-coreutils gcc
Install some optional extra packages: c:\MinGW\bin\mingw-get install msys-rxvt msys-vim msys-wget msys-unzip msys-zip msys-openssh
Launch a console/terminal with: c:\MinGW\msys\1.0\msys.bat --rxvt and enjoy having a decent shell
- Put 'c:/MinGW/bin' in '$PATH' ... or 'mount c:/MinGW /mingw'
4.2. Build hg-winhack
# create build directory hg clone http://selenic.com/hg hg-winhack # bootstrap Mercurial somehow cd hg-winhack # install python wget http://python.org/ftp/python/2.7.2/python-2.7.2.msi msiexec //i python-2.7.2.msi //qb # avoid MSYS magic mangling of '/i' cp -ar c:/Python27 hg-python27 # python can and should now be uninstalled again sed -i 's,-mno-cygwin, ,g' hg-python27/Lib/distutils/cygwinccompiler.py # build Mercurial extensions hg-python27/python setup.py build_ext -i --compiler=mingw32 # create hg.exe launcher sed 's,^#!/usr/bin/env python,#!hg-python27/python27.dll,g' hg > hg.py rm hg wget http://effbot.org/media/downloads/exemaker-1.2-20041012.zip -O exemaker.zip unzip -j exemaker.zip '*/exemaker.exe' rm exemaker.zip mv exemaker.exe hg.exe # zip it and ship it ... or continue running the test suite cd .. zip -r hg-winhack-x.x.zip hg-winhack/
Note that this will leave you with both a hg.exe which can be used from windows and a hg.py which might be picked up if you have python with a .py installed.
/i\ This version of exemaker will interpret the relative python path as relative to the current working directory. A new version from timeless should fix that.
4.3. Run the test suite
cd hg-winhack/tests export TMPDIR=c:/tmp # to avoid path that contains ~ which in general would require escaping PATH="`pwd`/../hg-python27:$PATH" ./run-tests.py -l
4.4. Run tests involving Git
If you have Git installed on your Windows box, hg-winhack will incorrectly detect that git command is available, and will try to run Git-related tests. It will fail to do so, because it cannot run "git.cmd" from shell.
If you don't want to run Git tests, edit hghave file to return False instead of return matchoutput('git --version 2>&1', r'^git version')
If you prefer Git tests to be executed, find your Git installation folder, enter cmd folder and create git file (no extension) with the following contents:
#!/bin/sh $COMSPEC //C git.cmd $*