Mercurial > hg
view tests/test-stream-bundle-v2.t @ 44763:94f4f2ec7dee stable
packaging: support building Inno installer with PyOxidizer
We want to start distributing Mercurial on Python 3 on
Windows. PyOxidizer will be our vehicle for achieving that.
This commit implements basic support for producing Inno
installers using PyOxidizer.
While it is an eventual goal of PyOxidizer to produce
installers, those features aren't yet implemented. So our
strategy for producing Mercurial installers is similar to
what we've been doing with py2exe: invoke a build system to
produce files then stage those files into a directory so they
can be turned into an installer.
We had to make significant alterations to the pyoxidizer.bzl
config file to get it to produce the files that we desire for
a Windows install. This meant differentiating the build targets
so we can target Windows specifically.
We've added a new module to hgpackaging to deal with interacting
with PyOxidizer. It is similar to pyexe: we invoke a build process
then copy files to a staging directory. Ideally these extra
files would be defined in pyoxidizer.bzl. But I don't think it
is worth doing at this time, as PyOxidizer's config files are
lacking some features to make this turnkey.
The rest of the change is introducing a variant of the
Inno installer code that invokes PyOxidizer instead of
py2exe.
Comparing the Python 2.7 based Inno installers with this
one, the following changes were observed:
* No lib/*.{pyd, dll} files
* No Microsoft.VC90.CRT.manifest
* No msvc{m,p,r}90.dll files
* python27.dll replaced with python37.dll
* Add vcruntime140.dll file
The disappearance of the .pyd and .dll files is acceptable, as
PyOxidizer has embedded these in hg.exe and loads them from
memory.
The disappearance of the *90* files is acceptable because those
provide the Visual C++ 9 runtime, as required by Python 2.7.
Similarly, the appearance of vcruntime140.dll is a requirement
of Python 3.7.
Differential Revision: https://phab.mercurial-scm.org/D8473
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 23 Apr 2020 18:06:02 -0700 |
parents | 181ee2118a96 |
children | 95a615dd77bf |
line wrap: on
line source
#require no-reposimplestore Test creating a consuming stream bundle v2 $ getmainid() { > hg -R main log --template '{node}\n' --rev "$1" > } $ cp $HGRCPATH $TESTTMP/hgrc.orig $ cat >> $HGRCPATH << EOF > [experimental] > evolution.createmarkers=True > evolution.exchange=True > bundle2-output-capture=True > [ui] > ssh="$PYTHON" "$TESTDIR/dummyssh" > logtemplate={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline} > [web] > push_ssl = false > allow_push = * > [phases] > publish=False > [extensions] > drawdag=$TESTDIR/drawdag.py > clonebundles= > EOF The extension requires a repo (currently unused) $ hg init main $ cd main $ hg debugdrawdag <<'EOF' > E > | > D > | > C > | > B > | > A > EOF $ hg bundle -a --type="none-v2;stream=v2" bundle.hg $ hg debugbundle bundle.hg Stream params: {} stream2 -- {bytecount: 1693, filecount: 11, requirements: dotencode%2Cfncache%2Cgeneraldelta%2Crevlogv1%2Csparserevlog%2Cstore} (mandatory: True) $ hg debugbundle --spec bundle.hg none-v2;stream=v2;requirements%3Ddotencode%2Cfncache%2Cgeneraldelta%2Crevlogv1%2Csparserevlog%2Cstore Test that we can apply the bundle as a stream clone bundle $ cat > .hg/clonebundles.manifest << EOF > http://localhost:$HGPORT1/bundle.hg BUNDLESPEC=`hg debugbundle --spec bundle.hg` > EOF $ hg serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log $ cat hg.pid >> $DAEMON_PIDS $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid $ cat http.pid >> $DAEMON_PIDS $ cd .. $ hg clone http://localhost:$HGPORT streamv2-clone-implicit --debug using http://localhost:$HGPORT/ sending capabilities command sending clonebundles command applying clone bundle from http://localhost:$HGPORT1/bundle.hg bundle2-input-bundle: with-transaction bundle2-input-part: "stream2" (params: 3 mandatory) supported applying stream bundle 11 files to transfer, 1.65 KB of data starting 4 threads for background file closing (?) starting 4 threads for background file closing (?) adding [s] data/A.i (66 bytes) adding [s] data/B.i (66 bytes) adding [s] data/C.i (66 bytes) adding [s] data/D.i (66 bytes) adding [s] data/E.i (66 bytes) adding [s] 00manifest.i (584 bytes) adding [s] 00changelog.i (595 bytes) adding [s] phaseroots (43 bytes) adding [c] branch2-served (94 bytes) adding [c] rbc-names-v1 (7 bytes) adding [c] rbc-revs-v1 (40 bytes) transferred 1.65 KB in \d\.\d seconds \(.*/sec\) (re) bundle2-input-part: total payload size 1840 bundle2-input-bundle: 1 parts total updating the branch cache finished applying clone bundle query 1; heads sending batch command searching for changes all remote heads known locally no changes found sending getbundle command bundle2-input-bundle: with-transaction bundle2-input-part: "listkeys" (params: 1 mandatory) supported bundle2-input-part: "phase-heads" supported bundle2-input-part: total payload size 24 bundle2-input-bundle: 2 parts total checking for updated bookmarks updating to branch default resolving manifests branchmerge: False, force: False, partial: False ancestor: 000000000000, local: 000000000000+, remote: 9bc730a19041 A: remote created -> g getting A B: remote created -> g getting B C: remote created -> g getting C D: remote created -> g getting D E: remote created -> g getting E 5 files updated, 0 files merged, 0 files removed, 0 files unresolved (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob) $ hg clone --stream http://localhost:$HGPORT streamv2-clone-explicit --debug using http://localhost:$HGPORT/ sending capabilities command sending clonebundles command applying clone bundle from http://localhost:$HGPORT1/bundle.hg bundle2-input-bundle: with-transaction bundle2-input-part: "stream2" (params: 3 mandatory) supported applying stream bundle 11 files to transfer, 1.65 KB of data starting 4 threads for background file closing (?) starting 4 threads for background file closing (?) adding [s] data/A.i (66 bytes) adding [s] data/B.i (66 bytes) adding [s] data/C.i (66 bytes) adding [s] data/D.i (66 bytes) adding [s] data/E.i (66 bytes) adding [s] 00manifest.i (584 bytes) adding [s] 00changelog.i (595 bytes) adding [s] phaseroots (43 bytes) adding [c] branch2-served (94 bytes) adding [c] rbc-names-v1 (7 bytes) adding [c] rbc-revs-v1 (40 bytes) transferred 1.65 KB in *.* seconds (*/sec) (glob) bundle2-input-part: total payload size 1840 bundle2-input-bundle: 1 parts total updating the branch cache finished applying clone bundle query 1; heads sending batch command searching for changes all remote heads known locally no changes found sending getbundle command bundle2-input-bundle: with-transaction bundle2-input-part: "listkeys" (params: 1 mandatory) supported bundle2-input-part: "phase-heads" supported bundle2-input-part: total payload size 24 bundle2-input-bundle: 2 parts total checking for updated bookmarks updating to branch default resolving manifests branchmerge: False, force: False, partial: False ancestor: 000000000000, local: 000000000000+, remote: 9bc730a19041 A: remote created -> g getting A B: remote created -> g getting B C: remote created -> g getting C D: remote created -> g getting D E: remote created -> g getting E 5 files updated, 0 files merged, 0 files removed, 0 files unresolved (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)