##// END OF EJS Templates
pyoxidizer: produce working Python 3 Windows installers (issue6366)...
Gregory Szorc -
r46277:57b5452a default
parent child Browse files
Show More
@@ -1,597 +1,597 b''
1 # linux.py - Linux specific automation functionality
1 # linux.py - Linux specific automation functionality
2 #
2 #
3 # Copyright 2019 Gregory Szorc <gregory.szorc@gmail.com>
3 # Copyright 2019 Gregory Szorc <gregory.szorc@gmail.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 # no-check-code because Python 3 native.
8 # no-check-code because Python 3 native.
9
9
10 import os
10 import os
11 import pathlib
11 import pathlib
12 import shlex
12 import shlex
13 import subprocess
13 import subprocess
14 import tempfile
14 import tempfile
15
15
16 from .ssh import exec_command
16 from .ssh import exec_command
17
17
18
18
19 # Linux distributions that are supported.
19 # Linux distributions that are supported.
20 DISTROS = {
20 DISTROS = {
21 'debian9',
21 'debian9',
22 'debian10',
22 'debian10',
23 'ubuntu18.04',
23 'ubuntu18.04',
24 'ubuntu19.04',
24 'ubuntu19.04',
25 }
25 }
26
26
27 INSTALL_PYTHONS = r'''
27 INSTALL_PYTHONS = r'''
28 PYENV2_VERSIONS="2.7.17 pypy2.7-7.2.0"
28 PYENV2_VERSIONS="2.7.17 pypy2.7-7.2.0"
29 PYENV3_VERSIONS="3.5.10 3.6.12 3.7.9 3.8.6 pypy3.5-7.0.0 pypy3.6-7.3.0"
29 PYENV3_VERSIONS="3.5.10 3.6.12 3.7.9 3.8.6 pypy3.5-7.0.0 pypy3.6-7.3.0"
30
30
31 git clone https://github.com/pyenv/pyenv.git /hgdev/pyenv
31 git clone https://github.com/pyenv/pyenv.git /hgdev/pyenv
32 pushd /hgdev/pyenv
32 pushd /hgdev/pyenv
33 git checkout 8bf79eb44ce1ea0a8b36544eb3e8a694a3a6ed78
33 git checkout 8bf79eb44ce1ea0a8b36544eb3e8a694a3a6ed78
34 popd
34 popd
35
35
36 export PYENV_ROOT="/hgdev/pyenv"
36 export PYENV_ROOT="/hgdev/pyenv"
37 export PATH="$PYENV_ROOT/bin:$PATH"
37 export PATH="$PYENV_ROOT/bin:$PATH"
38
38
39 # pip 19.2.3.
39 # pip 19.2.3.
40 PIP_SHA256=57e3643ff19f018f8a00dfaa6b7e4620e3c1a7a2171fd218425366ec006b3bfe
40 PIP_SHA256=57e3643ff19f018f8a00dfaa6b7e4620e3c1a7a2171fd218425366ec006b3bfe
41 wget -O get-pip.py --progress dot:mega https://github.com/pypa/get-pip/raw/309a56c5fd94bd1134053a541cb4657a4e47e09d/get-pip.py
41 wget -O get-pip.py --progress dot:mega https://github.com/pypa/get-pip/raw/309a56c5fd94bd1134053a541cb4657a4e47e09d/get-pip.py
42 echo "${PIP_SHA256} get-pip.py" | sha256sum --check -
42 echo "${PIP_SHA256} get-pip.py" | sha256sum --check -
43
43
44 VIRTUALENV_SHA256=f78d81b62d3147396ac33fc9d77579ddc42cc2a98dd9ea38886f616b33bc7fb2
44 VIRTUALENV_SHA256=f78d81b62d3147396ac33fc9d77579ddc42cc2a98dd9ea38886f616b33bc7fb2
45 VIRTUALENV_TARBALL=virtualenv-16.7.5.tar.gz
45 VIRTUALENV_TARBALL=virtualenv-16.7.5.tar.gz
46 wget -O ${VIRTUALENV_TARBALL} --progress dot:mega https://files.pythonhosted.org/packages/66/f0/6867af06d2e2f511e4e1d7094ff663acdebc4f15d4a0cb0fed1007395124/${VIRTUALENV_TARBALL}
46 wget -O ${VIRTUALENV_TARBALL} --progress dot:mega https://files.pythonhosted.org/packages/66/f0/6867af06d2e2f511e4e1d7094ff663acdebc4f15d4a0cb0fed1007395124/${VIRTUALENV_TARBALL}
47 echo "${VIRTUALENV_SHA256} ${VIRTUALENV_TARBALL}" | sha256sum --check -
47 echo "${VIRTUALENV_SHA256} ${VIRTUALENV_TARBALL}" | sha256sum --check -
48
48
49 for v in ${PYENV2_VERSIONS}; do
49 for v in ${PYENV2_VERSIONS}; do
50 pyenv install -v ${v}
50 pyenv install -v ${v}
51 ${PYENV_ROOT}/versions/${v}/bin/python get-pip.py
51 ${PYENV_ROOT}/versions/${v}/bin/python get-pip.py
52 ${PYENV_ROOT}/versions/${v}/bin/pip install ${VIRTUALENV_TARBALL}
52 ${PYENV_ROOT}/versions/${v}/bin/pip install ${VIRTUALENV_TARBALL}
53 ${PYENV_ROOT}/versions/${v}/bin/pip install -r /hgdev/requirements-py2.txt
53 ${PYENV_ROOT}/versions/${v}/bin/pip install -r /hgdev/requirements-py2.txt
54 done
54 done
55
55
56 for v in ${PYENV3_VERSIONS}; do
56 for v in ${PYENV3_VERSIONS}; do
57 pyenv install -v ${v}
57 pyenv install -v ${v}
58 ${PYENV_ROOT}/versions/${v}/bin/python get-pip.py
58 ${PYENV_ROOT}/versions/${v}/bin/python get-pip.py
59 ${PYENV_ROOT}/versions/${v}/bin/pip install -r /hgdev/requirements-py3.txt
59 ${PYENV_ROOT}/versions/${v}/bin/pip install -r /hgdev/requirements-py3.txt
60 done
60 done
61
61
62 pyenv global ${PYENV2_VERSIONS} ${PYENV3_VERSIONS} system
62 pyenv global ${PYENV2_VERSIONS} ${PYENV3_VERSIONS} system
63 '''.lstrip().replace(
63 '''.lstrip().replace(
64 '\r\n', '\n'
64 '\r\n', '\n'
65 )
65 )
66
66
67
67
68 INSTALL_RUST = r'''
68 INSTALL_RUST = r'''
69 RUSTUP_INIT_SHA256=a46fe67199b7bcbbde2dcbc23ae08db6f29883e260e23899a88b9073effc9076
69 RUSTUP_INIT_SHA256=a46fe67199b7bcbbde2dcbc23ae08db6f29883e260e23899a88b9073effc9076
70 wget -O rustup-init --progress dot:mega https://static.rust-lang.org/rustup/archive/1.18.3/x86_64-unknown-linux-gnu/rustup-init
70 wget -O rustup-init --progress dot:mega https://static.rust-lang.org/rustup/archive/1.18.3/x86_64-unknown-linux-gnu/rustup-init
71 echo "${RUSTUP_INIT_SHA256} rustup-init" | sha256sum --check -
71 echo "${RUSTUP_INIT_SHA256} rustup-init" | sha256sum --check -
72
72
73 chmod +x rustup-init
73 chmod +x rustup-init
74 sudo -H -u hg -g hg ./rustup-init -y
74 sudo -H -u hg -g hg ./rustup-init -y
75 sudo -H -u hg -g hg /home/hg/.cargo/bin/rustup install 1.31.1 1.46.0
75 sudo -H -u hg -g hg /home/hg/.cargo/bin/rustup install 1.31.1 1.46.0
76 sudo -H -u hg -g hg /home/hg/.cargo/bin/rustup component add clippy
76 sudo -H -u hg -g hg /home/hg/.cargo/bin/rustup component add clippy
77
77
78 sudo -H -u hg -g hg /home/hg/.cargo/bin/cargo install --version 0.7.0 pyoxidizer
78 sudo -H -u hg -g hg /home/hg/.cargo/bin/cargo install --git https://github.com/indygreg/PyOxidizer.git --rev 4697fb25918dfad6dc73288daeea501063963a08 pyoxidizer
79 '''
79 '''
80
80
81
81
82 BOOTSTRAP_VIRTUALENV = r'''
82 BOOTSTRAP_VIRTUALENV = r'''
83 /usr/bin/virtualenv /hgdev/venv-bootstrap
83 /usr/bin/virtualenv /hgdev/venv-bootstrap
84
84
85 HG_SHA256=35fc8ba5e0379c1b3affa2757e83fb0509e8ac314cbd9f1fd133cf265d16e49f
85 HG_SHA256=35fc8ba5e0379c1b3affa2757e83fb0509e8ac314cbd9f1fd133cf265d16e49f
86 HG_TARBALL=mercurial-5.1.1.tar.gz
86 HG_TARBALL=mercurial-5.1.1.tar.gz
87
87
88 wget -O ${HG_TARBALL} --progress dot:mega https://www.mercurial-scm.org/release/${HG_TARBALL}
88 wget -O ${HG_TARBALL} --progress dot:mega https://www.mercurial-scm.org/release/${HG_TARBALL}
89 echo "${HG_SHA256} ${HG_TARBALL}" | sha256sum --check -
89 echo "${HG_SHA256} ${HG_TARBALL}" | sha256sum --check -
90
90
91 /hgdev/venv-bootstrap/bin/pip install ${HG_TARBALL}
91 /hgdev/venv-bootstrap/bin/pip install ${HG_TARBALL}
92 '''.lstrip().replace(
92 '''.lstrip().replace(
93 '\r\n', '\n'
93 '\r\n', '\n'
94 )
94 )
95
95
96
96
97 BOOTSTRAP_DEBIAN = (
97 BOOTSTRAP_DEBIAN = (
98 r'''
98 r'''
99 #!/bin/bash
99 #!/bin/bash
100
100
101 set -ex
101 set -ex
102
102
103 DISTRO=`grep DISTRIB_ID /etc/lsb-release | awk -F= '{{print $2}}'`
103 DISTRO=`grep DISTRIB_ID /etc/lsb-release | awk -F= '{{print $2}}'`
104 DEBIAN_VERSION=`cat /etc/debian_version`
104 DEBIAN_VERSION=`cat /etc/debian_version`
105 LSB_RELEASE=`lsb_release -cs`
105 LSB_RELEASE=`lsb_release -cs`
106
106
107 sudo /usr/sbin/groupadd hg
107 sudo /usr/sbin/groupadd hg
108 sudo /usr/sbin/groupadd docker
108 sudo /usr/sbin/groupadd docker
109 sudo /usr/sbin/useradd -g hg -G sudo,docker -d /home/hg -m -s /bin/bash hg
109 sudo /usr/sbin/useradd -g hg -G sudo,docker -d /home/hg -m -s /bin/bash hg
110 sudo mkdir /home/hg/.ssh
110 sudo mkdir /home/hg/.ssh
111 sudo cp ~/.ssh/authorized_keys /home/hg/.ssh/authorized_keys
111 sudo cp ~/.ssh/authorized_keys /home/hg/.ssh/authorized_keys
112 sudo chown -R hg:hg /home/hg/.ssh
112 sudo chown -R hg:hg /home/hg/.ssh
113 sudo chmod 700 /home/hg/.ssh
113 sudo chmod 700 /home/hg/.ssh
114 sudo chmod 600 /home/hg/.ssh/authorized_keys
114 sudo chmod 600 /home/hg/.ssh/authorized_keys
115
115
116 cat << EOF | sudo tee /etc/sudoers.d/90-hg
116 cat << EOF | sudo tee /etc/sudoers.d/90-hg
117 hg ALL=(ALL) NOPASSWD:ALL
117 hg ALL=(ALL) NOPASSWD:ALL
118 EOF
118 EOF
119
119
120 sudo apt-get update
120 sudo apt-get update
121 sudo DEBIAN_FRONTEND=noninteractive apt-get -yq dist-upgrade
121 sudo DEBIAN_FRONTEND=noninteractive apt-get -yq dist-upgrade
122
122
123 # Install packages necessary to set up Docker Apt repo.
123 # Install packages necessary to set up Docker Apt repo.
124 sudo DEBIAN_FRONTEND=noninteractive apt-get -yq install --no-install-recommends \
124 sudo DEBIAN_FRONTEND=noninteractive apt-get -yq install --no-install-recommends \
125 apt-transport-https \
125 apt-transport-https \
126 gnupg
126 gnupg
127
127
128 cat > docker-apt-key << EOF
128 cat > docker-apt-key << EOF
129 -----BEGIN PGP PUBLIC KEY BLOCK-----
129 -----BEGIN PGP PUBLIC KEY BLOCK-----
130
130
131 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
188 YT90qFF93M3v01BbxP+EIY2/9tiIPbrd
188 YT90qFF93M3v01BbxP+EIY2/9tiIPbrd
189 =0YYh
189 =0YYh
190 -----END PGP PUBLIC KEY BLOCK-----
190 -----END PGP PUBLIC KEY BLOCK-----
191 EOF
191 EOF
192
192
193 sudo apt-key add docker-apt-key
193 sudo apt-key add docker-apt-key
194
194
195 if [ "$LSB_RELEASE" = "stretch" ]; then
195 if [ "$LSB_RELEASE" = "stretch" ]; then
196 cat << EOF | sudo tee -a /etc/apt/sources.list
196 cat << EOF | sudo tee -a /etc/apt/sources.list
197 # Need backports for clang-format-6.0
197 # Need backports for clang-format-6.0
198 deb http://deb.debian.org/debian stretch-backports main
198 deb http://deb.debian.org/debian stretch-backports main
199 EOF
199 EOF
200 fi
200 fi
201
201
202 if [ "$LSB_RELEASE" = "stretch" -o "$LSB_RELEASE" = "buster" ]; then
202 if [ "$LSB_RELEASE" = "stretch" -o "$LSB_RELEASE" = "buster" ]; then
203 cat << EOF | sudo tee -a /etc/apt/sources.list
203 cat << EOF | sudo tee -a /etc/apt/sources.list
204 # Sources are useful if we want to compile things locally.
204 # Sources are useful if we want to compile things locally.
205 deb-src http://deb.debian.org/debian $LSB_RELEASE main
205 deb-src http://deb.debian.org/debian $LSB_RELEASE main
206 deb-src http://security.debian.org/debian-security $LSB_RELEASE/updates main
206 deb-src http://security.debian.org/debian-security $LSB_RELEASE/updates main
207 deb-src http://deb.debian.org/debian $LSB_RELEASE-updates main
207 deb-src http://deb.debian.org/debian $LSB_RELEASE-updates main
208 deb-src http://deb.debian.org/debian $LSB_RELEASE-backports main
208 deb-src http://deb.debian.org/debian $LSB_RELEASE-backports main
209
209
210 deb [arch=amd64] https://download.docker.com/linux/debian $LSB_RELEASE stable
210 deb [arch=amd64] https://download.docker.com/linux/debian $LSB_RELEASE stable
211 EOF
211 EOF
212
212
213 elif [ "$DISTRO" = "Ubuntu" ]; then
213 elif [ "$DISTRO" = "Ubuntu" ]; then
214 cat << EOF | sudo tee -a /etc/apt/sources.list
214 cat << EOF | sudo tee -a /etc/apt/sources.list
215 deb [arch=amd64] https://download.docker.com/linux/ubuntu $LSB_RELEASE stable
215 deb [arch=amd64] https://download.docker.com/linux/ubuntu $LSB_RELEASE stable
216 EOF
216 EOF
217
217
218 fi
218 fi
219
219
220 sudo apt-get update
220 sudo apt-get update
221
221
222 PACKAGES="\
222 PACKAGES="\
223 awscli \
223 awscli \
224 btrfs-progs \
224 btrfs-progs \
225 build-essential \
225 build-essential \
226 bzr \
226 bzr \
227 clang-format-6.0 \
227 clang-format-6.0 \
228 cvs \
228 cvs \
229 darcs \
229 darcs \
230 debhelper \
230 debhelper \
231 devscripts \
231 devscripts \
232 docker-ce \
232 docker-ce \
233 dpkg-dev \
233 dpkg-dev \
234 dstat \
234 dstat \
235 emacs \
235 emacs \
236 gettext \
236 gettext \
237 git \
237 git \
238 htop \
238 htop \
239 iotop \
239 iotop \
240 jfsutils \
240 jfsutils \
241 libbz2-dev \
241 libbz2-dev \
242 libexpat1-dev \
242 libexpat1-dev \
243 libffi-dev \
243 libffi-dev \
244 libgdbm-dev \
244 libgdbm-dev \
245 liblzma-dev \
245 liblzma-dev \
246 libncurses5-dev \
246 libncurses5-dev \
247 libnss3-dev \
247 libnss3-dev \
248 libreadline-dev \
248 libreadline-dev \
249 libsqlite3-dev \
249 libsqlite3-dev \
250 libssl-dev \
250 libssl-dev \
251 netbase \
251 netbase \
252 ntfs-3g \
252 ntfs-3g \
253 nvme-cli \
253 nvme-cli \
254 pyflakes \
254 pyflakes \
255 pyflakes3 \
255 pyflakes3 \
256 pylint \
256 pylint \
257 pylint3 \
257 pylint3 \
258 python-all-dev \
258 python-all-dev \
259 python-dev \
259 python-dev \
260 python-docutils \
260 python-docutils \
261 python-fuzzywuzzy \
261 python-fuzzywuzzy \
262 python-pygments \
262 python-pygments \
263 python-subversion \
263 python-subversion \
264 python-vcr \
264 python-vcr \
265 python3-boto3 \
265 python3-boto3 \
266 python3-dev \
266 python3-dev \
267 python3-docutils \
267 python3-docutils \
268 python3-fuzzywuzzy \
268 python3-fuzzywuzzy \
269 python3-pygments \
269 python3-pygments \
270 python3-vcr \
270 python3-vcr \
271 python3-venv \
271 python3-venv \
272 rsync \
272 rsync \
273 sqlite3 \
273 sqlite3 \
274 subversion \
274 subversion \
275 tcl-dev \
275 tcl-dev \
276 tk-dev \
276 tk-dev \
277 tla \
277 tla \
278 unzip \
278 unzip \
279 uuid-dev \
279 uuid-dev \
280 vim \
280 vim \
281 virtualenv \
281 virtualenv \
282 wget \
282 wget \
283 xfsprogs \
283 xfsprogs \
284 zip \
284 zip \
285 zlib1g-dev"
285 zlib1g-dev"
286
286
287 if [ "LSB_RELEASE" = "stretch" ]; then
287 if [ "LSB_RELEASE" = "stretch" ]; then
288 PACKAGES="$PACKAGES linux-perf"
288 PACKAGES="$PACKAGES linux-perf"
289 elif [ "$DISTRO" = "Ubuntu" ]; then
289 elif [ "$DISTRO" = "Ubuntu" ]; then
290 PACKAGES="$PACKAGES linux-tools-common"
290 PACKAGES="$PACKAGES linux-tools-common"
291 fi
291 fi
292
292
293 # Monotone only available in older releases.
293 # Monotone only available in older releases.
294 if [ "$LSB_RELEASE" = "stretch" -o "$LSB_RELEASE" = "xenial" ]; then
294 if [ "$LSB_RELEASE" = "stretch" -o "$LSB_RELEASE" = "xenial" ]; then
295 PACKAGES="$PACKAGES monotone"
295 PACKAGES="$PACKAGES monotone"
296 fi
296 fi
297
297
298 sudo DEBIAN_FRONTEND=noninteractive apt-get -yq install --no-install-recommends $PACKAGES
298 sudo DEBIAN_FRONTEND=noninteractive apt-get -yq install --no-install-recommends $PACKAGES
299
299
300 # Create clang-format symlink so test harness finds it.
300 # Create clang-format symlink so test harness finds it.
301 sudo update-alternatives --install /usr/bin/clang-format clang-format \
301 sudo update-alternatives --install /usr/bin/clang-format clang-format \
302 /usr/bin/clang-format-6.0 1000
302 /usr/bin/clang-format-6.0 1000
303
303
304 sudo mkdir /hgdev
304 sudo mkdir /hgdev
305 # Will be normalized to hg:hg later.
305 # Will be normalized to hg:hg later.
306 sudo chown `whoami` /hgdev
306 sudo chown `whoami` /hgdev
307
307
308 {install_rust}
308 {install_rust}
309
309
310 cp requirements-py2.txt /hgdev/requirements-py2.txt
310 cp requirements-py2.txt /hgdev/requirements-py2.txt
311 cp requirements-py3.txt /hgdev/requirements-py3.txt
311 cp requirements-py3.txt /hgdev/requirements-py3.txt
312
312
313 # Disable the pip version check because it uses the network and can
313 # Disable the pip version check because it uses the network and can
314 # be annoying.
314 # be annoying.
315 cat << EOF | sudo tee -a /etc/pip.conf
315 cat << EOF | sudo tee -a /etc/pip.conf
316 [global]
316 [global]
317 disable-pip-version-check = True
317 disable-pip-version-check = True
318 EOF
318 EOF
319
319
320 {install_pythons}
320 {install_pythons}
321 {bootstrap_virtualenv}
321 {bootstrap_virtualenv}
322
322
323 /hgdev/venv-bootstrap/bin/hg clone https://www.mercurial-scm.org/repo/hg /hgdev/src
323 /hgdev/venv-bootstrap/bin/hg clone https://www.mercurial-scm.org/repo/hg /hgdev/src
324
324
325 # Mark the repo as non-publishing.
325 # Mark the repo as non-publishing.
326 cat >> /hgdev/src/.hg/hgrc << EOF
326 cat >> /hgdev/src/.hg/hgrc << EOF
327 [phases]
327 [phases]
328 publish = false
328 publish = false
329 EOF
329 EOF
330
330
331 sudo chown -R hg:hg /hgdev
331 sudo chown -R hg:hg /hgdev
332 '''.lstrip()
332 '''.lstrip()
333 .format(
333 .format(
334 install_rust=INSTALL_RUST,
334 install_rust=INSTALL_RUST,
335 install_pythons=INSTALL_PYTHONS,
335 install_pythons=INSTALL_PYTHONS,
336 bootstrap_virtualenv=BOOTSTRAP_VIRTUALENV,
336 bootstrap_virtualenv=BOOTSTRAP_VIRTUALENV,
337 )
337 )
338 .replace('\r\n', '\n')
338 .replace('\r\n', '\n')
339 )
339 )
340
340
341
341
342 # Prepares /hgdev for operations.
342 # Prepares /hgdev for operations.
343 PREPARE_HGDEV = '''
343 PREPARE_HGDEV = '''
344 #!/bin/bash
344 #!/bin/bash
345
345
346 set -e
346 set -e
347
347
348 FS=$1
348 FS=$1
349
349
350 ensure_device() {
350 ensure_device() {
351 if [ -z "${DEVICE}" ]; then
351 if [ -z "${DEVICE}" ]; then
352 echo "could not find block device to format"
352 echo "could not find block device to format"
353 exit 1
353 exit 1
354 fi
354 fi
355 }
355 }
356
356
357 # Determine device to partition for extra filesystem.
357 # Determine device to partition for extra filesystem.
358 # If only 1 volume is present, it will be the root volume and
358 # If only 1 volume is present, it will be the root volume and
359 # should be /dev/nvme0. If multiple volumes are present, the
359 # should be /dev/nvme0. If multiple volumes are present, the
360 # root volume could be nvme0 or nvme1. Use whichever one doesn't have
360 # root volume could be nvme0 or nvme1. Use whichever one doesn't have
361 # a partition.
361 # a partition.
362 if [ -e /dev/nvme1n1 ]; then
362 if [ -e /dev/nvme1n1 ]; then
363 if [ -e /dev/nvme0n1p1 ]; then
363 if [ -e /dev/nvme0n1p1 ]; then
364 DEVICE=/dev/nvme1n1
364 DEVICE=/dev/nvme1n1
365 else
365 else
366 DEVICE=/dev/nvme0n1
366 DEVICE=/dev/nvme0n1
367 fi
367 fi
368 else
368 else
369 DEVICE=
369 DEVICE=
370 fi
370 fi
371
371
372 sudo mkdir /hgwork
372 sudo mkdir /hgwork
373
373
374 if [ "${FS}" != "default" -a "${FS}" != "tmpfs" ]; then
374 if [ "${FS}" != "default" -a "${FS}" != "tmpfs" ]; then
375 ensure_device
375 ensure_device
376 echo "creating ${FS} filesystem on ${DEVICE}"
376 echo "creating ${FS} filesystem on ${DEVICE}"
377 fi
377 fi
378
378
379 if [ "${FS}" = "default" ]; then
379 if [ "${FS}" = "default" ]; then
380 :
380 :
381
381
382 elif [ "${FS}" = "btrfs" ]; then
382 elif [ "${FS}" = "btrfs" ]; then
383 sudo mkfs.btrfs ${DEVICE}
383 sudo mkfs.btrfs ${DEVICE}
384 sudo mount ${DEVICE} /hgwork
384 sudo mount ${DEVICE} /hgwork
385
385
386 elif [ "${FS}" = "ext3" ]; then
386 elif [ "${FS}" = "ext3" ]; then
387 # lazy_journal_init speeds up filesystem creation at the expense of
387 # lazy_journal_init speeds up filesystem creation at the expense of
388 # integrity if things crash. We are an ephemeral instance, so we don't
388 # integrity if things crash. We are an ephemeral instance, so we don't
389 # care about integrity.
389 # care about integrity.
390 sudo mkfs.ext3 -E lazy_journal_init=1 ${DEVICE}
390 sudo mkfs.ext3 -E lazy_journal_init=1 ${DEVICE}
391 sudo mount ${DEVICE} /hgwork
391 sudo mount ${DEVICE} /hgwork
392
392
393 elif [ "${FS}" = "ext4" ]; then
393 elif [ "${FS}" = "ext4" ]; then
394 sudo mkfs.ext4 -E lazy_journal_init=1 ${DEVICE}
394 sudo mkfs.ext4 -E lazy_journal_init=1 ${DEVICE}
395 sudo mount ${DEVICE} /hgwork
395 sudo mount ${DEVICE} /hgwork
396
396
397 elif [ "${FS}" = "jfs" ]; then
397 elif [ "${FS}" = "jfs" ]; then
398 sudo mkfs.jfs ${DEVICE}
398 sudo mkfs.jfs ${DEVICE}
399 sudo mount ${DEVICE} /hgwork
399 sudo mount ${DEVICE} /hgwork
400
400
401 elif [ "${FS}" = "tmpfs" ]; then
401 elif [ "${FS}" = "tmpfs" ]; then
402 echo "creating tmpfs volume in /hgwork"
402 echo "creating tmpfs volume in /hgwork"
403 sudo mount -t tmpfs -o size=1024M tmpfs /hgwork
403 sudo mount -t tmpfs -o size=1024M tmpfs /hgwork
404
404
405 elif [ "${FS}" = "xfs" ]; then
405 elif [ "${FS}" = "xfs" ]; then
406 sudo mkfs.xfs ${DEVICE}
406 sudo mkfs.xfs ${DEVICE}
407 sudo mount ${DEVICE} /hgwork
407 sudo mount ${DEVICE} /hgwork
408
408
409 else
409 else
410 echo "unsupported filesystem: ${FS}"
410 echo "unsupported filesystem: ${FS}"
411 exit 1
411 exit 1
412 fi
412 fi
413
413
414 echo "/hgwork ready"
414 echo "/hgwork ready"
415
415
416 sudo chown hg:hg /hgwork
416 sudo chown hg:hg /hgwork
417 mkdir /hgwork/tmp
417 mkdir /hgwork/tmp
418 chown hg:hg /hgwork/tmp
418 chown hg:hg /hgwork/tmp
419
419
420 rsync -a /hgdev/src /hgwork/
420 rsync -a /hgdev/src /hgwork/
421 '''.lstrip().replace(
421 '''.lstrip().replace(
422 '\r\n', '\n'
422 '\r\n', '\n'
423 )
423 )
424
424
425
425
426 HG_UPDATE_CLEAN = '''
426 HG_UPDATE_CLEAN = '''
427 set -ex
427 set -ex
428
428
429 HG=/hgdev/venv-bootstrap/bin/hg
429 HG=/hgdev/venv-bootstrap/bin/hg
430
430
431 cd /hgwork/src
431 cd /hgwork/src
432 ${HG} --config extensions.purge= purge --all
432 ${HG} --config extensions.purge= purge --all
433 ${HG} update -C $1
433 ${HG} update -C $1
434 ${HG} log -r .
434 ${HG} log -r .
435 '''.lstrip().replace(
435 '''.lstrip().replace(
436 '\r\n', '\n'
436 '\r\n', '\n'
437 )
437 )
438
438
439
439
440 def prepare_exec_environment(ssh_client, filesystem='default'):
440 def prepare_exec_environment(ssh_client, filesystem='default'):
441 """Prepare an EC2 instance to execute things.
441 """Prepare an EC2 instance to execute things.
442
442
443 The AMI has an ``/hgdev`` bootstrapped with various Python installs
443 The AMI has an ``/hgdev`` bootstrapped with various Python installs
444 and a clone of the Mercurial repo.
444 and a clone of the Mercurial repo.
445
445
446 In EC2, EBS volumes launched from snapshots have wonky performance behavior.
446 In EC2, EBS volumes launched from snapshots have wonky performance behavior.
447 Notably, blocks have to be copied on first access, which makes volume
447 Notably, blocks have to be copied on first access, which makes volume
448 I/O extremely slow on fresh volumes.
448 I/O extremely slow on fresh volumes.
449
449
450 Furthermore, we may want to run operations, tests, etc on alternative
450 Furthermore, we may want to run operations, tests, etc on alternative
451 filesystems so we examine behavior on different filesystems.
451 filesystems so we examine behavior on different filesystems.
452
452
453 This function is used to facilitate executing operations on alternate
453 This function is used to facilitate executing operations on alternate
454 volumes.
454 volumes.
455 """
455 """
456 sftp = ssh_client.open_sftp()
456 sftp = ssh_client.open_sftp()
457
457
458 with sftp.open('/hgdev/prepare-hgdev', 'wb') as fh:
458 with sftp.open('/hgdev/prepare-hgdev', 'wb') as fh:
459 fh.write(PREPARE_HGDEV)
459 fh.write(PREPARE_HGDEV)
460 fh.chmod(0o0777)
460 fh.chmod(0o0777)
461
461
462 command = 'sudo /hgdev/prepare-hgdev %s' % filesystem
462 command = 'sudo /hgdev/prepare-hgdev %s' % filesystem
463 chan, stdin, stdout = exec_command(ssh_client, command)
463 chan, stdin, stdout = exec_command(ssh_client, command)
464 stdin.close()
464 stdin.close()
465
465
466 for line in stdout:
466 for line in stdout:
467 print(line, end='')
467 print(line, end='')
468
468
469 res = chan.recv_exit_status()
469 res = chan.recv_exit_status()
470
470
471 if res:
471 if res:
472 raise Exception('non-0 exit code updating working directory; %d' % res)
472 raise Exception('non-0 exit code updating working directory; %d' % res)
473
473
474
474
475 def synchronize_hg(
475 def synchronize_hg(
476 source_path: pathlib.Path, ec2_instance, revision: str = None
476 source_path: pathlib.Path, ec2_instance, revision: str = None
477 ):
477 ):
478 """Synchronize a local Mercurial source path to remote EC2 instance."""
478 """Synchronize a local Mercurial source path to remote EC2 instance."""
479
479
480 with tempfile.TemporaryDirectory() as temp_dir:
480 with tempfile.TemporaryDirectory() as temp_dir:
481 temp_dir = pathlib.Path(temp_dir)
481 temp_dir = pathlib.Path(temp_dir)
482
482
483 ssh_dir = temp_dir / '.ssh'
483 ssh_dir = temp_dir / '.ssh'
484 ssh_dir.mkdir()
484 ssh_dir.mkdir()
485 ssh_dir.chmod(0o0700)
485 ssh_dir.chmod(0o0700)
486
486
487 public_ip = ec2_instance.public_ip_address
487 public_ip = ec2_instance.public_ip_address
488
488
489 ssh_config = ssh_dir / 'config'
489 ssh_config = ssh_dir / 'config'
490
490
491 with ssh_config.open('w', encoding='utf-8') as fh:
491 with ssh_config.open('w', encoding='utf-8') as fh:
492 fh.write('Host %s\n' % public_ip)
492 fh.write('Host %s\n' % public_ip)
493 fh.write(' User hg\n')
493 fh.write(' User hg\n')
494 fh.write(' StrictHostKeyChecking no\n')
494 fh.write(' StrictHostKeyChecking no\n')
495 fh.write(' UserKnownHostsFile %s\n' % (ssh_dir / 'known_hosts'))
495 fh.write(' UserKnownHostsFile %s\n' % (ssh_dir / 'known_hosts'))
496 fh.write(' IdentityFile %s\n' % ec2_instance.ssh_private_key_path)
496 fh.write(' IdentityFile %s\n' % ec2_instance.ssh_private_key_path)
497
497
498 if not (source_path / '.hg').is_dir():
498 if not (source_path / '.hg').is_dir():
499 raise Exception(
499 raise Exception(
500 '%s is not a Mercurial repository; synchronization '
500 '%s is not a Mercurial repository; synchronization '
501 'not yet supported' % source_path
501 'not yet supported' % source_path
502 )
502 )
503
503
504 env = dict(os.environ)
504 env = dict(os.environ)
505 env['HGPLAIN'] = '1'
505 env['HGPLAIN'] = '1'
506 env['HGENCODING'] = 'utf-8'
506 env['HGENCODING'] = 'utf-8'
507
507
508 hg_bin = source_path / 'hg'
508 hg_bin = source_path / 'hg'
509
509
510 res = subprocess.run(
510 res = subprocess.run(
511 ['python2.7', str(hg_bin), 'log', '-r', revision, '-T', '{node}'],
511 ['python2.7', str(hg_bin), 'log', '-r', revision, '-T', '{node}'],
512 cwd=str(source_path),
512 cwd=str(source_path),
513 env=env,
513 env=env,
514 check=True,
514 check=True,
515 capture_output=True,
515 capture_output=True,
516 )
516 )
517
517
518 full_revision = res.stdout.decode('ascii')
518 full_revision = res.stdout.decode('ascii')
519
519
520 args = [
520 args = [
521 'python2.7',
521 'python2.7',
522 str(hg_bin),
522 str(hg_bin),
523 '--config',
523 '--config',
524 'ui.ssh=ssh -F %s' % ssh_config,
524 'ui.ssh=ssh -F %s' % ssh_config,
525 '--config',
525 '--config',
526 'ui.remotecmd=/hgdev/venv-bootstrap/bin/hg',
526 'ui.remotecmd=/hgdev/venv-bootstrap/bin/hg',
527 # Also ensure .hgtags changes are present so auto version
527 # Also ensure .hgtags changes are present so auto version
528 # calculation works.
528 # calculation works.
529 'push',
529 'push',
530 '-f',
530 '-f',
531 '-r',
531 '-r',
532 full_revision,
532 full_revision,
533 '-r',
533 '-r',
534 'file(.hgtags)',
534 'file(.hgtags)',
535 'ssh://%s//hgwork/src' % public_ip,
535 'ssh://%s//hgwork/src' % public_ip,
536 ]
536 ]
537
537
538 res = subprocess.run(args, cwd=str(source_path), env=env)
538 res = subprocess.run(args, cwd=str(source_path), env=env)
539
539
540 # Allow 1 (no-op) to not trigger error.
540 # Allow 1 (no-op) to not trigger error.
541 if res.returncode not in (0, 1):
541 if res.returncode not in (0, 1):
542 res.check_returncode()
542 res.check_returncode()
543
543
544 # TODO support synchronizing dirty working directory.
544 # TODO support synchronizing dirty working directory.
545
545
546 sftp = ec2_instance.ssh_client.open_sftp()
546 sftp = ec2_instance.ssh_client.open_sftp()
547
547
548 with sftp.open('/hgdev/hgup', 'wb') as fh:
548 with sftp.open('/hgdev/hgup', 'wb') as fh:
549 fh.write(HG_UPDATE_CLEAN)
549 fh.write(HG_UPDATE_CLEAN)
550 fh.chmod(0o0700)
550 fh.chmod(0o0700)
551
551
552 chan, stdin, stdout = exec_command(
552 chan, stdin, stdout = exec_command(
553 ec2_instance.ssh_client, '/hgdev/hgup %s' % full_revision
553 ec2_instance.ssh_client, '/hgdev/hgup %s' % full_revision
554 )
554 )
555 stdin.close()
555 stdin.close()
556
556
557 for line in stdout:
557 for line in stdout:
558 print(line, end='')
558 print(line, end='')
559
559
560 res = chan.recv_exit_status()
560 res = chan.recv_exit_status()
561
561
562 if res:
562 if res:
563 raise Exception(
563 raise Exception(
564 'non-0 exit code updating working directory; %d' % res
564 'non-0 exit code updating working directory; %d' % res
565 )
565 )
566
566
567
567
568 def run_tests(ssh_client, python_version, test_flags=None):
568 def run_tests(ssh_client, python_version, test_flags=None):
569 """Run tests on a remote Linux machine via an SSH client."""
569 """Run tests on a remote Linux machine via an SSH client."""
570 test_flags = test_flags or []
570 test_flags = test_flags or []
571
571
572 print('running tests')
572 print('running tests')
573
573
574 if python_version == 'system2':
574 if python_version == 'system2':
575 python = '/usr/bin/python2'
575 python = '/usr/bin/python2'
576 elif python_version == 'system3':
576 elif python_version == 'system3':
577 python = '/usr/bin/python3'
577 python = '/usr/bin/python3'
578 elif python_version.startswith('pypy'):
578 elif python_version.startswith('pypy'):
579 python = '/hgdev/pyenv/shims/%s' % python_version
579 python = '/hgdev/pyenv/shims/%s' % python_version
580 else:
580 else:
581 python = '/hgdev/pyenv/shims/python%s' % python_version
581 python = '/hgdev/pyenv/shims/python%s' % python_version
582
582
583 test_flags = ' '.join(shlex.quote(a) for a in test_flags)
583 test_flags = ' '.join(shlex.quote(a) for a in test_flags)
584
584
585 command = (
585 command = (
586 '/bin/sh -c "export TMPDIR=/hgwork/tmp; '
586 '/bin/sh -c "export TMPDIR=/hgwork/tmp; '
587 'cd /hgwork/src/tests && %s run-tests.py %s"' % (python, test_flags)
587 'cd /hgwork/src/tests && %s run-tests.py %s"' % (python, test_flags)
588 )
588 )
589
589
590 chan, stdin, stdout = exec_command(ssh_client, command)
590 chan, stdin, stdout = exec_command(ssh_client, command)
591
591
592 stdin.close()
592 stdin.close()
593
593
594 for line in stdout:
594 for line in stdout:
595 print(line, end='')
595 print(line, end='')
596
596
597 return chan.recv_exit_status()
597 return chan.recv_exit_status()
@@ -1,220 +1,220 b''
1 # install-dependencies.ps1 - Install Windows dependencies for building Mercurial
1 # install-dependencies.ps1 - Install Windows dependencies for building Mercurial
2 #
2 #
3 # Copyright 2019 Gregory Szorc <gregory.szorc@gmail.com>
3 # Copyright 2019 Gregory Szorc <gregory.szorc@gmail.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 # This script can be used to bootstrap a Mercurial build environment on
8 # This script can be used to bootstrap a Mercurial build environment on
9 # Windows.
9 # Windows.
10 #
10 #
11 # The script makes a lot of assumptions about how things should work.
11 # The script makes a lot of assumptions about how things should work.
12 # For example, the install location of Python is hardcoded to c:\hgdev\*.
12 # For example, the install location of Python is hardcoded to c:\hgdev\*.
13 #
13 #
14 # The script should be executed from a PowerShell with elevated privileges
14 # The script should be executed from a PowerShell with elevated privileges
15 # if you don't want to see a UAC prompt for various installers.
15 # if you don't want to see a UAC prompt for various installers.
16 #
16 #
17 # The script is tested on Windows 10 and Windows Server 2019 (in EC2).
17 # The script is tested on Windows 10 and Windows Server 2019 (in EC2).
18
18
19 $VS_BUILD_TOOLS_URL = "https://download.visualstudio.microsoft.com/download/pr/a1603c02-8a66-4b83-b821-811e3610a7c4/aa2db8bb39e0cbd23e9940d8951e0bc3/vs_buildtools.exe"
19 $VS_BUILD_TOOLS_URL = "https://download.visualstudio.microsoft.com/download/pr/a1603c02-8a66-4b83-b821-811e3610a7c4/aa2db8bb39e0cbd23e9940d8951e0bc3/vs_buildtools.exe"
20 $VS_BUILD_TOOLS_SHA256 = "911E292B8E6E5F46CBC17003BDCD2D27A70E616E8D5E6E69D5D489A605CAA139"
20 $VS_BUILD_TOOLS_SHA256 = "911E292B8E6E5F46CBC17003BDCD2D27A70E616E8D5E6E69D5D489A605CAA139"
21
21
22 $VC9_PYTHON_URL = "https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi"
22 $VC9_PYTHON_URL = "https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi"
23 $VC9_PYTHON_SHA256 = "070474db76a2e625513a5835df4595df9324d820f9cc97eab2a596dcbc2f5cbf"
23 $VC9_PYTHON_SHA256 = "070474db76a2e625513a5835df4595df9324d820f9cc97eab2a596dcbc2f5cbf"
24
24
25 $PYTHON27_x64_URL = "https://www.python.org/ftp/python/2.7.18/python-2.7.18.amd64.msi"
25 $PYTHON27_x64_URL = "https://www.python.org/ftp/python/2.7.18/python-2.7.18.amd64.msi"
26 $PYTHON27_x64_SHA256 = "b74a3afa1e0bf2a6fc566a7b70d15c9bfabba3756fb077797d16fffa27800c05"
26 $PYTHON27_x64_SHA256 = "b74a3afa1e0bf2a6fc566a7b70d15c9bfabba3756fb077797d16fffa27800c05"
27 $PYTHON27_X86_URL = "https://www.python.org/ftp/python/2.7.18/python-2.7.18.msi"
27 $PYTHON27_X86_URL = "https://www.python.org/ftp/python/2.7.18/python-2.7.18.msi"
28 $PYTHON27_X86_SHA256 = "d901802e90026e9bad76b8a81f8dd7e43c7d7e8269d9281c9e9df7a9c40480a9"
28 $PYTHON27_X86_SHA256 = "d901802e90026e9bad76b8a81f8dd7e43c7d7e8269d9281c9e9df7a9c40480a9"
29
29
30 $PYTHON35_x86_URL = "https://www.python.org/ftp/python/3.5.4/python-3.5.4.exe"
30 $PYTHON35_x86_URL = "https://www.python.org/ftp/python/3.5.4/python-3.5.4.exe"
31 $PYTHON35_x86_SHA256 = "F27C2D67FD9688E4970F3BFF799BB9D722A0D6C2C13B04848E1F7D620B524B0E"
31 $PYTHON35_x86_SHA256 = "F27C2D67FD9688E4970F3BFF799BB9D722A0D6C2C13B04848E1F7D620B524B0E"
32 $PYTHON35_x64_URL = "https://www.python.org/ftp/python/3.5.4/python-3.5.4-amd64.exe"
32 $PYTHON35_x64_URL = "https://www.python.org/ftp/python/3.5.4/python-3.5.4-amd64.exe"
33 $PYTHON35_x64_SHA256 = "9B7741CC32357573A77D2EE64987717E527628C38FD7EAF3E2AACA853D45A1EE"
33 $PYTHON35_x64_SHA256 = "9B7741CC32357573A77D2EE64987717E527628C38FD7EAF3E2AACA853D45A1EE"
34
34
35 $PYTHON36_x86_URL = "https://www.python.org/ftp/python/3.6.8/python-3.6.8.exe"
35 $PYTHON36_x86_URL = "https://www.python.org/ftp/python/3.6.8/python-3.6.8.exe"
36 $PYTHON36_x86_SHA256 = "89871D432BC06E4630D7B64CB1A8451E53C80E68DE29029976B12AAD7DBFA5A0"
36 $PYTHON36_x86_SHA256 = "89871D432BC06E4630D7B64CB1A8451E53C80E68DE29029976B12AAD7DBFA5A0"
37 $PYTHON36_x64_URL = "https://www.python.org/ftp/python/3.6.8/python-3.6.8-amd64.exe"
37 $PYTHON36_x64_URL = "https://www.python.org/ftp/python/3.6.8/python-3.6.8-amd64.exe"
38 $PYTHON36_x64_SHA256 = "96088A58B7C43BC83B84E6B67F15E8706C614023DD64F9A5A14E81FF824ADADC"
38 $PYTHON36_x64_SHA256 = "96088A58B7C43BC83B84E6B67F15E8706C614023DD64F9A5A14E81FF824ADADC"
39
39
40 $PYTHON37_x86_URL = "https://www.python.org/ftp/python/3.7.9/python-3.7.9.exe"
40 $PYTHON37_x86_URL = "https://www.python.org/ftp/python/3.7.9/python-3.7.9.exe"
41 $PYTHON37_x86_SHA256 = "769bb7c74ad1df6d7d74071cc16a984ff6182e4016e11b8949b93db487977220"
41 $PYTHON37_x86_SHA256 = "769bb7c74ad1df6d7d74071cc16a984ff6182e4016e11b8949b93db487977220"
42 $PYTHON37_X64_URL = "https://www.python.org/ftp/python/3.7.9/python-3.7.9-amd64.exe"
42 $PYTHON37_X64_URL = "https://www.python.org/ftp/python/3.7.9/python-3.7.9-amd64.exe"
43 $PYTHON37_x64_SHA256 = "e69ed52afb5a722e5c56f6c21d594e85c17cb29f12f18bb69751cf1714e0f987"
43 $PYTHON37_x64_SHA256 = "e69ed52afb5a722e5c56f6c21d594e85c17cb29f12f18bb69751cf1714e0f987"
44
44
45 $PYTHON38_x86_URL = "https://www.python.org/ftp/python/3.8.6/python-3.8.6.exe"
45 $PYTHON38_x86_URL = "https://www.python.org/ftp/python/3.8.6/python-3.8.6.exe"
46 $PYTHON38_x86_SHA256 = "287d5df01ff22ff09e6a487ae018603ee19eade71d462ec703850c96f1d5e8a0"
46 $PYTHON38_x86_SHA256 = "287d5df01ff22ff09e6a487ae018603ee19eade71d462ec703850c96f1d5e8a0"
47 $PYTHON38_x64_URL = "https://www.python.org/ftp/python/3.8.6/python-3.8.6-amd64.exe"
47 $PYTHON38_x64_URL = "https://www.python.org/ftp/python/3.8.6/python-3.8.6-amd64.exe"
48 $PYTHON38_x64_SHA256 = "328a257f189cb500606bb26ab0fbdd298ed0e05d8c36540a322a1744f489a0a0"
48 $PYTHON38_x64_SHA256 = "328a257f189cb500606bb26ab0fbdd298ed0e05d8c36540a322a1744f489a0a0"
49
49
50 # PIP 19.2.3.
50 # PIP 19.2.3.
51 $PIP_URL = "https://github.com/pypa/get-pip/raw/309a56c5fd94bd1134053a541cb4657a4e47e09d/get-pip.py"
51 $PIP_URL = "https://github.com/pypa/get-pip/raw/309a56c5fd94bd1134053a541cb4657a4e47e09d/get-pip.py"
52 $PIP_SHA256 = "57e3643ff19f018f8a00dfaa6b7e4620e3c1a7a2171fd218425366ec006b3bfe"
52 $PIP_SHA256 = "57e3643ff19f018f8a00dfaa6b7e4620e3c1a7a2171fd218425366ec006b3bfe"
53
53
54 $VIRTUALENV_URL = "https://files.pythonhosted.org/packages/66/f0/6867af06d2e2f511e4e1d7094ff663acdebc4f15d4a0cb0fed1007395124/virtualenv-16.7.5.tar.gz"
54 $VIRTUALENV_URL = "https://files.pythonhosted.org/packages/66/f0/6867af06d2e2f511e4e1d7094ff663acdebc4f15d4a0cb0fed1007395124/virtualenv-16.7.5.tar.gz"
55 $VIRTUALENV_SHA256 = "f78d81b62d3147396ac33fc9d77579ddc42cc2a98dd9ea38886f616b33bc7fb2"
55 $VIRTUALENV_SHA256 = "f78d81b62d3147396ac33fc9d77579ddc42cc2a98dd9ea38886f616b33bc7fb2"
56
56
57 $INNO_SETUP_URL = "http://files.jrsoftware.org/is/5/innosetup-5.6.1-unicode.exe"
57 $INNO_SETUP_URL = "http://files.jrsoftware.org/is/5/innosetup-5.6.1-unicode.exe"
58 $INNO_SETUP_SHA256 = "27D49E9BC769E9D1B214C153011978DB90DC01C2ACD1DDCD9ED7B3FE3B96B538"
58 $INNO_SETUP_SHA256 = "27D49E9BC769E9D1B214C153011978DB90DC01C2ACD1DDCD9ED7B3FE3B96B538"
59
59
60 $MINGW_BIN_URL = "https://osdn.net/frs/redir.php?m=constant&f=mingw%2F68260%2Fmingw-get-0.6.3-mingw32-pre-20170905-1-bin.zip"
60 $MINGW_BIN_URL = "https://osdn.net/frs/redir.php?m=constant&f=mingw%2F68260%2Fmingw-get-0.6.3-mingw32-pre-20170905-1-bin.zip"
61 $MINGW_BIN_SHA256 = "2AB8EFD7C7D1FC8EAF8B2FA4DA4EEF8F3E47768284C021599BC7435839A046DF"
61 $MINGW_BIN_SHA256 = "2AB8EFD7C7D1FC8EAF8B2FA4DA4EEF8F3E47768284C021599BC7435839A046DF"
62
62
63 $MERCURIAL_WHEEL_FILENAME = "mercurial-5.1.2-cp27-cp27m-win_amd64.whl"
63 $MERCURIAL_WHEEL_FILENAME = "mercurial-5.1.2-cp27-cp27m-win_amd64.whl"
64 $MERCURIAL_WHEEL_URL = "https://files.pythonhosted.org/packages/6d/47/e031e47f7fe9b16e4e3383da47e2b0a7eae6e603996bc67a03ec4fa1b3f4/$MERCURIAL_WHEEL_FILENAME"
64 $MERCURIAL_WHEEL_URL = "https://files.pythonhosted.org/packages/6d/47/e031e47f7fe9b16e4e3383da47e2b0a7eae6e603996bc67a03ec4fa1b3f4/$MERCURIAL_WHEEL_FILENAME"
65 $MERCURIAL_WHEEL_SHA256 = "1d18c7f6ca1456f0f62ee65c9a50c14cbba48ce6e924930cdb10537f5c9eaf5f"
65 $MERCURIAL_WHEEL_SHA256 = "1d18c7f6ca1456f0f62ee65c9a50c14cbba48ce6e924930cdb10537f5c9eaf5f"
66
66
67 $RUSTUP_INIT_URL = "https://static.rust-lang.org/rustup/archive/1.21.1/x86_64-pc-windows-gnu/rustup-init.exe"
67 $RUSTUP_INIT_URL = "https://static.rust-lang.org/rustup/archive/1.21.1/x86_64-pc-windows-gnu/rustup-init.exe"
68 $RUSTUP_INIT_SHA256 = "d17df34ba974b9b19cf5c75883a95475aa22ddc364591d75d174090d55711c72"
68 $RUSTUP_INIT_SHA256 = "d17df34ba974b9b19cf5c75883a95475aa22ddc364591d75d174090d55711c72"
69
69
70 # Writing progress slows down downloads substantially. So disable it.
70 # Writing progress slows down downloads substantially. So disable it.
71 $progressPreference = 'silentlyContinue'
71 $progressPreference = 'silentlyContinue'
72
72
73 function Secure-Download($url, $path, $sha256) {
73 function Secure-Download($url, $path, $sha256) {
74 if (Test-Path -Path $path) {
74 if (Test-Path -Path $path) {
75 Get-FileHash -Path $path -Algorithm SHA256 -OutVariable hash
75 Get-FileHash -Path $path -Algorithm SHA256 -OutVariable hash
76
76
77 if ($hash.Hash -eq $sha256) {
77 if ($hash.Hash -eq $sha256) {
78 Write-Output "SHA256 of $path verified as $sha256"
78 Write-Output "SHA256 of $path verified as $sha256"
79 return
79 return
80 }
80 }
81
81
82 Write-Output "hash mismatch on $path; downloading again"
82 Write-Output "hash mismatch on $path; downloading again"
83 }
83 }
84
84
85 Write-Output "downloading $url to $path"
85 Write-Output "downloading $url to $path"
86 Invoke-WebRequest -Uri $url -OutFile $path
86 Invoke-WebRequest -Uri $url -OutFile $path
87 Get-FileHash -Path $path -Algorithm SHA256 -OutVariable hash
87 Get-FileHash -Path $path -Algorithm SHA256 -OutVariable hash
88
88
89 if ($hash.Hash -ne $sha256) {
89 if ($hash.Hash -ne $sha256) {
90 Remove-Item -Path $path
90 Remove-Item -Path $path
91 throw "hash mismatch when downloading $url; got $($hash.Hash), expected $sha256"
91 throw "hash mismatch when downloading $url; got $($hash.Hash), expected $sha256"
92 }
92 }
93 }
93 }
94
94
95 function Invoke-Process($path, $arguments) {
95 function Invoke-Process($path, $arguments) {
96 $p = Start-Process -FilePath $path -ArgumentList $arguments -Wait -PassThru -WindowStyle Hidden
96 $p = Start-Process -FilePath $path -ArgumentList $arguments -Wait -PassThru -WindowStyle Hidden
97
97
98 if ($p.ExitCode -ne 0) {
98 if ($p.ExitCode -ne 0) {
99 throw "process exited non-0: $($p.ExitCode)"
99 throw "process exited non-0: $($p.ExitCode)"
100 }
100 }
101 }
101 }
102
102
103 function Install-Python3($name, $installer, $dest, $pip) {
103 function Install-Python3($name, $installer, $dest, $pip) {
104 Write-Output "installing $name"
104 Write-Output "installing $name"
105
105
106 # We hit this when running the script as part of Simple Systems Manager in
106 # We hit this when running the script as part of Simple Systems Manager in
107 # EC2. The Python 3 installer doesn't seem to like per-user installs
107 # EC2. The Python 3 installer doesn't seem to like per-user installs
108 # when running as the SYSTEM user. So enable global installs if executed in
108 # when running as the SYSTEM user. So enable global installs if executed in
109 # this mode.
109 # this mode.
110 if ($env:USERPROFILE -eq "C:\Windows\system32\config\systemprofile") {
110 if ($env:USERPROFILE -eq "C:\Windows\system32\config\systemprofile") {
111 Write-Output "running with SYSTEM account; installing for all users"
111 Write-Output "running with SYSTEM account; installing for all users"
112 $allusers = "1"
112 $allusers = "1"
113 }
113 }
114 else {
114 else {
115 $allusers = "0"
115 $allusers = "0"
116 }
116 }
117
117
118 Invoke-Process $installer "/quiet TargetDir=${dest} InstallAllUsers=${allusers} AssociateFiles=0 CompileAll=0 PrependPath=0 Include_doc=0 Include_launcher=0 InstallLauncherAllUsers=0 Include_pip=0 Include_test=0"
118 Invoke-Process $installer "/quiet TargetDir=${dest} InstallAllUsers=${allusers} AssociateFiles=0 CompileAll=0 PrependPath=0 Include_doc=0 Include_launcher=0 InstallLauncherAllUsers=0 Include_pip=0 Include_test=0"
119 Invoke-Process ${dest}\python.exe $pip
119 Invoke-Process ${dest}\python.exe $pip
120 }
120 }
121
121
122 function Install-Rust($prefix) {
122 function Install-Rust($prefix) {
123 Write-Output "installing Rust"
123 Write-Output "installing Rust"
124 $Env:RUSTUP_HOME = "${prefix}\rustup"
124 $Env:RUSTUP_HOME = "${prefix}\rustup"
125 $Env:CARGO_HOME = "${prefix}\cargo"
125 $Env:CARGO_HOME = "${prefix}\cargo"
126
126
127 Invoke-Process "${prefix}\assets\rustup-init.exe" "-y --default-host x86_64-pc-windows-msvc"
127 Invoke-Process "${prefix}\assets\rustup-init.exe" "-y --default-host x86_64-pc-windows-msvc"
128 Invoke-Process "${prefix}\cargo\bin\rustup.exe" "target add i686-pc-windows-msvc"
128 Invoke-Process "${prefix}\cargo\bin\rustup.exe" "target add i686-pc-windows-msvc"
129 Invoke-Process "${prefix}\cargo\bin\rustup.exe" "install 1.46.0"
129 Invoke-Process "${prefix}\cargo\bin\rustup.exe" "install 1.46.0"
130 Invoke-Process "${prefix}\cargo\bin\rustup.exe" "component add clippy"
130 Invoke-Process "${prefix}\cargo\bin\rustup.exe" "component add clippy"
131
131
132 # Install PyOxidizer for packaging.
132 # Install PyOxidizer for packaging.
133 Invoke-Process "${prefix}\cargo\bin\cargo.exe" "install --version 0.7.0 pyoxidizer"
133 Invoke-Process "${prefix}\cargo\bin\cargo.exe" "install --git https://github.com/indygreg/PyOxidizer.git --rev 4697fb25918dfad6dc73288daeea501063963a08 pyoxidizer"
134 }
134 }
135
135
136 function Install-Dependencies($prefix) {
136 function Install-Dependencies($prefix) {
137 if (!(Test-Path -Path $prefix\assets)) {
137 if (!(Test-Path -Path $prefix\assets)) {
138 New-Item -Path $prefix\assets -ItemType Directory
138 New-Item -Path $prefix\assets -ItemType Directory
139 }
139 }
140
140
141 $pip = "${prefix}\assets\get-pip.py"
141 $pip = "${prefix}\assets\get-pip.py"
142
142
143 Secure-Download $VC9_PYTHON_URL ${prefix}\assets\VCForPython27.msi $VC9_PYTHON_SHA256
143 Secure-Download $VC9_PYTHON_URL ${prefix}\assets\VCForPython27.msi $VC9_PYTHON_SHA256
144 Secure-Download $PYTHON27_x86_URL ${prefix}\assets\python27-x86.msi $PYTHON27_x86_SHA256
144 Secure-Download $PYTHON27_x86_URL ${prefix}\assets\python27-x86.msi $PYTHON27_x86_SHA256
145 Secure-Download $PYTHON27_x64_URL ${prefix}\assets\python27-x64.msi $PYTHON27_x64_SHA256
145 Secure-Download $PYTHON27_x64_URL ${prefix}\assets\python27-x64.msi $PYTHON27_x64_SHA256
146 Secure-Download $PYTHON35_x86_URL ${prefix}\assets\python35-x86.exe $PYTHON35_x86_SHA256
146 Secure-Download $PYTHON35_x86_URL ${prefix}\assets\python35-x86.exe $PYTHON35_x86_SHA256
147 Secure-Download $PYTHON35_x64_URL ${prefix}\assets\python35-x64.exe $PYTHON35_x64_SHA256
147 Secure-Download $PYTHON35_x64_URL ${prefix}\assets\python35-x64.exe $PYTHON35_x64_SHA256
148 Secure-Download $PYTHON36_x86_URL ${prefix}\assets\python36-x86.exe $PYTHON36_x86_SHA256
148 Secure-Download $PYTHON36_x86_URL ${prefix}\assets\python36-x86.exe $PYTHON36_x86_SHA256
149 Secure-Download $PYTHON36_x64_URL ${prefix}\assets\python36-x64.exe $PYTHON36_x64_SHA256
149 Secure-Download $PYTHON36_x64_URL ${prefix}\assets\python36-x64.exe $PYTHON36_x64_SHA256
150 Secure-Download $PYTHON37_x86_URL ${prefix}\assets\python37-x86.exe $PYTHON37_x86_SHA256
150 Secure-Download $PYTHON37_x86_URL ${prefix}\assets\python37-x86.exe $PYTHON37_x86_SHA256
151 Secure-Download $PYTHON37_x64_URL ${prefix}\assets\python37-x64.exe $PYTHON37_x64_SHA256
151 Secure-Download $PYTHON37_x64_URL ${prefix}\assets\python37-x64.exe $PYTHON37_x64_SHA256
152 Secure-Download $PYTHON38_x86_URL ${prefix}\assets\python38-x86.exe $PYTHON38_x86_SHA256
152 Secure-Download $PYTHON38_x86_URL ${prefix}\assets\python38-x86.exe $PYTHON38_x86_SHA256
153 Secure-Download $PYTHON38_x64_URL ${prefix}\assets\python38-x64.exe $PYTHON38_x64_SHA256
153 Secure-Download $PYTHON38_x64_URL ${prefix}\assets\python38-x64.exe $PYTHON38_x64_SHA256
154 Secure-Download $PIP_URL ${pip} $PIP_SHA256
154 Secure-Download $PIP_URL ${pip} $PIP_SHA256
155 Secure-Download $VIRTUALENV_URL ${prefix}\assets\virtualenv.tar.gz $VIRTUALENV_SHA256
155 Secure-Download $VIRTUALENV_URL ${prefix}\assets\virtualenv.tar.gz $VIRTUALENV_SHA256
156 Secure-Download $VS_BUILD_TOOLS_URL ${prefix}\assets\vs_buildtools.exe $VS_BUILD_TOOLS_SHA256
156 Secure-Download $VS_BUILD_TOOLS_URL ${prefix}\assets\vs_buildtools.exe $VS_BUILD_TOOLS_SHA256
157 Secure-Download $INNO_SETUP_URL ${prefix}\assets\InnoSetup.exe $INNO_SETUP_SHA256
157 Secure-Download $INNO_SETUP_URL ${prefix}\assets\InnoSetup.exe $INNO_SETUP_SHA256
158 Secure-Download $MINGW_BIN_URL ${prefix}\assets\mingw-get-bin.zip $MINGW_BIN_SHA256
158 Secure-Download $MINGW_BIN_URL ${prefix}\assets\mingw-get-bin.zip $MINGW_BIN_SHA256
159 Secure-Download $MERCURIAL_WHEEL_URL ${prefix}\assets\${MERCURIAL_WHEEL_FILENAME} $MERCURIAL_WHEEL_SHA256
159 Secure-Download $MERCURIAL_WHEEL_URL ${prefix}\assets\${MERCURIAL_WHEEL_FILENAME} $MERCURIAL_WHEEL_SHA256
160 Secure-Download $RUSTUP_INIT_URL ${prefix}\assets\rustup-init.exe $RUSTUP_INIT_SHA256
160 Secure-Download $RUSTUP_INIT_URL ${prefix}\assets\rustup-init.exe $RUSTUP_INIT_SHA256
161
161
162 Write-Output "installing Python 2.7 32-bit"
162 Write-Output "installing Python 2.7 32-bit"
163 Invoke-Process msiexec.exe "/i ${prefix}\assets\python27-x86.msi /l* ${prefix}\assets\python27-x86.log /q TARGETDIR=${prefix}\python27-x86 ALLUSERS="
163 Invoke-Process msiexec.exe "/i ${prefix}\assets\python27-x86.msi /l* ${prefix}\assets\python27-x86.log /q TARGETDIR=${prefix}\python27-x86 ALLUSERS="
164 Invoke-Process ${prefix}\python27-x86\python.exe ${prefix}\assets\get-pip.py
164 Invoke-Process ${prefix}\python27-x86\python.exe ${prefix}\assets\get-pip.py
165 Invoke-Process ${prefix}\python27-x86\Scripts\pip.exe "install ${prefix}\assets\virtualenv.tar.gz"
165 Invoke-Process ${prefix}\python27-x86\Scripts\pip.exe "install ${prefix}\assets\virtualenv.tar.gz"
166
166
167 Write-Output "installing Python 2.7 64-bit"
167 Write-Output "installing Python 2.7 64-bit"
168 Invoke-Process msiexec.exe "/i ${prefix}\assets\python27-x64.msi /l* ${prefix}\assets\python27-x64.log /q TARGETDIR=${prefix}\python27-x64 ALLUSERS="
168 Invoke-Process msiexec.exe "/i ${prefix}\assets\python27-x64.msi /l* ${prefix}\assets\python27-x64.log /q TARGETDIR=${prefix}\python27-x64 ALLUSERS="
169 Invoke-Process ${prefix}\python27-x64\python.exe ${prefix}\assets\get-pip.py
169 Invoke-Process ${prefix}\python27-x64\python.exe ${prefix}\assets\get-pip.py
170 Invoke-Process ${prefix}\python27-x64\Scripts\pip.exe "install ${prefix}\assets\virtualenv.tar.gz"
170 Invoke-Process ${prefix}\python27-x64\Scripts\pip.exe "install ${prefix}\assets\virtualenv.tar.gz"
171
171
172 Install-Python3 "Python 3.5 32-bit" ${prefix}\assets\python35-x86.exe ${prefix}\python35-x86 ${pip}
172 Install-Python3 "Python 3.5 32-bit" ${prefix}\assets\python35-x86.exe ${prefix}\python35-x86 ${pip}
173 Install-Python3 "Python 3.5 64-bit" ${prefix}\assets\python35-x64.exe ${prefix}\python35-x64 ${pip}
173 Install-Python3 "Python 3.5 64-bit" ${prefix}\assets\python35-x64.exe ${prefix}\python35-x64 ${pip}
174 Install-Python3 "Python 3.6 32-bit" ${prefix}\assets\python36-x86.exe ${prefix}\python36-x86 ${pip}
174 Install-Python3 "Python 3.6 32-bit" ${prefix}\assets\python36-x86.exe ${prefix}\python36-x86 ${pip}
175 Install-Python3 "Python 3.6 64-bit" ${prefix}\assets\python36-x64.exe ${prefix}\python36-x64 ${pip}
175 Install-Python3 "Python 3.6 64-bit" ${prefix}\assets\python36-x64.exe ${prefix}\python36-x64 ${pip}
176 Install-Python3 "Python 3.7 32-bit" ${prefix}\assets\python37-x86.exe ${prefix}\python37-x86 ${pip}
176 Install-Python3 "Python 3.7 32-bit" ${prefix}\assets\python37-x86.exe ${prefix}\python37-x86 ${pip}
177 Install-Python3 "Python 3.7 64-bit" ${prefix}\assets\python37-x64.exe ${prefix}\python37-x64 ${pip}
177 Install-Python3 "Python 3.7 64-bit" ${prefix}\assets\python37-x64.exe ${prefix}\python37-x64 ${pip}
178 Install-Python3 "Python 3.8 32-bit" ${prefix}\assets\python38-x86.exe ${prefix}\python38-x86 ${pip}
178 Install-Python3 "Python 3.8 32-bit" ${prefix}\assets\python38-x86.exe ${prefix}\python38-x86 ${pip}
179 Install-Python3 "Python 3.8 64-bit" ${prefix}\assets\python38-x64.exe ${prefix}\python38-x64 ${pip}
179 Install-Python3 "Python 3.8 64-bit" ${prefix}\assets\python38-x64.exe ${prefix}\python38-x64 ${pip}
180
180
181 Write-Output "installing Visual Studio 2017 Build Tools and SDKs"
181 Write-Output "installing Visual Studio 2017 Build Tools and SDKs"
182 Invoke-Process ${prefix}\assets\vs_buildtools.exe "--quiet --wait --norestart --nocache --channelUri https://aka.ms/vs/15/release/channel --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Component.Windows10SDK.17763 --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.Windows10SDK --add Microsoft.VisualStudio.Component.VC.140"
182 Invoke-Process ${prefix}\assets\vs_buildtools.exe "--quiet --wait --norestart --nocache --channelUri https://aka.ms/vs/15/release/channel --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Component.Windows10SDK.17763 --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.Windows10SDK --add Microsoft.VisualStudio.Component.VC.140"
183
183
184 Install-Rust ${prefix}
184 Install-Rust ${prefix}
185
185
186 Write-Output "installing Visual C++ 9.0 for Python 2.7"
186 Write-Output "installing Visual C++ 9.0 for Python 2.7"
187 Invoke-Process msiexec.exe "/i ${prefix}\assets\VCForPython27.msi /l* ${prefix}\assets\VCForPython27.log /q"
187 Invoke-Process msiexec.exe "/i ${prefix}\assets\VCForPython27.msi /l* ${prefix}\assets\VCForPython27.log /q"
188
188
189 Write-Output "installing Inno Setup"
189 Write-Output "installing Inno Setup"
190 Invoke-Process ${prefix}\assets\InnoSetup.exe "/SP- /VERYSILENT /SUPPRESSMSGBOXES"
190 Invoke-Process ${prefix}\assets\InnoSetup.exe "/SP- /VERYSILENT /SUPPRESSMSGBOXES"
191
191
192 Write-Output "extracting MinGW base archive"
192 Write-Output "extracting MinGW base archive"
193 Expand-Archive -Path ${prefix}\assets\mingw-get-bin.zip -DestinationPath "${prefix}\MinGW" -Force
193 Expand-Archive -Path ${prefix}\assets\mingw-get-bin.zip -DestinationPath "${prefix}\MinGW" -Force
194
194
195 Write-Output "updating MinGW package catalogs"
195 Write-Output "updating MinGW package catalogs"
196 Invoke-Process ${prefix}\MinGW\bin\mingw-get.exe "update"
196 Invoke-Process ${prefix}\MinGW\bin\mingw-get.exe "update"
197
197
198 Write-Output "installing MinGW packages"
198 Write-Output "installing MinGW packages"
199 Invoke-Process ${prefix}\MinGW\bin\mingw-get.exe "install msys-base msys-coreutils msys-diffutils msys-unzip"
199 Invoke-Process ${prefix}\MinGW\bin\mingw-get.exe "install msys-base msys-coreutils msys-diffutils msys-unzip"
200
200
201 # Construct a virtualenv useful for bootstrapping. It conveniently contains a
201 # Construct a virtualenv useful for bootstrapping. It conveniently contains a
202 # Mercurial install.
202 # Mercurial install.
203 Write-Output "creating bootstrap virtualenv with Mercurial"
203 Write-Output "creating bootstrap virtualenv with Mercurial"
204 Invoke-Process "$prefix\python27-x64\Scripts\virtualenv.exe" "${prefix}\venv-bootstrap"
204 Invoke-Process "$prefix\python27-x64\Scripts\virtualenv.exe" "${prefix}\venv-bootstrap"
205 Invoke-Process "${prefix}\venv-bootstrap\Scripts\pip.exe" "install ${prefix}\assets\${MERCURIAL_WHEEL_FILENAME}"
205 Invoke-Process "${prefix}\venv-bootstrap\Scripts\pip.exe" "install ${prefix}\assets\${MERCURIAL_WHEEL_FILENAME}"
206 }
206 }
207
207
208 function Clone-Mercurial-Repo($prefix, $repo_url, $dest) {
208 function Clone-Mercurial-Repo($prefix, $repo_url, $dest) {
209 Write-Output "cloning $repo_url to $dest"
209 Write-Output "cloning $repo_url to $dest"
210 # TODO Figure out why CA verification isn't working in EC2 and remove
210 # TODO Figure out why CA verification isn't working in EC2 and remove
211 # --insecure.
211 # --insecure.
212 Invoke-Process "${prefix}\venv-bootstrap\Scripts\hg.exe" "clone --insecure $repo_url $dest"
212 Invoke-Process "${prefix}\venv-bootstrap\Scripts\hg.exe" "clone --insecure $repo_url $dest"
213
213
214 # Mark repo as non-publishing by default for convenience.
214 # Mark repo as non-publishing by default for convenience.
215 Add-Content -Path "$dest\.hg\hgrc" -Value "`n[phases]`npublish = false"
215 Add-Content -Path "$dest\.hg\hgrc" -Value "`n[phases]`npublish = false"
216 }
216 }
217
217
218 $prefix = "c:\hgdev"
218 $prefix = "c:\hgdev"
219 Install-Dependencies $prefix
219 Install-Dependencies $prefix
220 Clone-Mercurial-Repo $prefix "https://www.mercurial-scm.org/repo/hg" $prefix\src
220 Clone-Mercurial-Repo $prefix "https://www.mercurial-scm.org/repo/hg" $prefix\src
@@ -1,145 +1,143 b''
1 # pyoxidizer.py - Packaging support for PyOxidizer
1 # pyoxidizer.py - Packaging support for PyOxidizer
2 #
2 #
3 # Copyright 2020 Gregory Szorc <gregory.szorc@gmail.com>
3 # Copyright 2020 Gregory Szorc <gregory.szorc@gmail.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 # no-check-code because Python 3 native.
8 # no-check-code because Python 3 native.
9
9
10 import os
10 import os
11 import pathlib
11 import pathlib
12 import shutil
12 import shutil
13 import subprocess
13 import subprocess
14 import sys
14 import sys
15
15
16 from .downloads import download_entry
16 from .downloads import download_entry
17 from .util import (
17 from .util import (
18 extract_zip_to_directory,
18 extract_zip_to_directory,
19 process_install_rules,
19 process_install_rules,
20 find_vc_runtime_dll,
20 find_vc_runtime_dll,
21 )
21 )
22
22
23
23
24 STAGING_RULES_WINDOWS = [
24 STAGING_RULES_WINDOWS = [
25 ('contrib/bash_completion', 'contrib/'),
25 ('contrib/bash_completion', 'contrib/'),
26 ('contrib/hgk', 'contrib/hgk.tcl'),
26 ('contrib/hgk', 'contrib/hgk.tcl'),
27 ('contrib/hgweb.fcgi', 'contrib/'),
27 ('contrib/hgweb.fcgi', 'contrib/'),
28 ('contrib/hgweb.wsgi', 'contrib/'),
28 ('contrib/hgweb.wsgi', 'contrib/'),
29 ('contrib/logo-droplets.svg', 'contrib/'),
29 ('contrib/logo-droplets.svg', 'contrib/'),
30 ('contrib/mercurial.el', 'contrib/'),
30 ('contrib/mercurial.el', 'contrib/'),
31 ('contrib/mq.el', 'contrib/'),
31 ('contrib/mq.el', 'contrib/'),
32 ('contrib/tcsh_completion', 'contrib/'),
32 ('contrib/tcsh_completion', 'contrib/'),
33 ('contrib/tcsh_completion_build.sh', 'contrib/'),
33 ('contrib/tcsh_completion_build.sh', 'contrib/'),
34 ('contrib/vim/*', 'contrib/vim/'),
34 ('contrib/vim/*', 'contrib/vim/'),
35 ('contrib/win32/postinstall.txt', 'ReleaseNotes.txt'),
35 ('contrib/win32/postinstall.txt', 'ReleaseNotes.txt'),
36 ('contrib/win32/ReadMe.html', 'ReadMe.html'),
36 ('contrib/win32/ReadMe.html', 'ReadMe.html'),
37 ('contrib/xml.rnc', 'contrib/'),
37 ('contrib/xml.rnc', 'contrib/'),
38 ('contrib/zsh_completion', 'contrib/'),
38 ('contrib/zsh_completion', 'contrib/'),
39 ('doc/*.html', 'doc/'),
39 ('doc/*.html', 'doc/'),
40 ('doc/style.css', 'doc/'),
40 ('doc/style.css', 'doc/'),
41 ('COPYING', 'Copying.txt'),
41 ('COPYING', 'Copying.txt'),
42 ]
42 ]
43
43
44 STAGING_RULES_APP = [
44 STAGING_RULES_APP = [
45 ('mercurial/helptext/**/*.txt', 'helptext/'),
45 ('lib/mercurial/helptext/**/*.txt', 'helptext/'),
46 ('mercurial/defaultrc/*.rc', 'defaultrc/'),
46 ('lib/mercurial/defaultrc/*.rc', 'defaultrc/'),
47 ('mercurial/locale/**/*', 'locale/'),
47 ('lib/mercurial/locale/**/*', 'locale/'),
48 ('mercurial/templates/**/*', 'templates/'),
48 ('lib/mercurial/templates/**/*', 'templates/'),
49 ]
49 ]
50
50
51 STAGING_EXCLUDES_WINDOWS = [
51 STAGING_EXCLUDES_WINDOWS = [
52 "doc/hg-ssh.8.html",
52 "doc/hg-ssh.8.html",
53 ]
53 ]
54
54
55
55
56 def run_pyoxidizer(
56 def run_pyoxidizer(
57 source_dir: pathlib.Path,
57 source_dir: pathlib.Path,
58 build_dir: pathlib.Path,
58 build_dir: pathlib.Path,
59 out_dir: pathlib.Path,
59 out_dir: pathlib.Path,
60 target_triple: str,
60 target_triple: str,
61 ):
61 ):
62 """Build Mercurial with PyOxidizer and copy additional files into place.
62 """Build Mercurial with PyOxidizer and copy additional files into place.
63
63
64 After successful completion, ``out_dir`` contains files constituting a
64 After successful completion, ``out_dir`` contains files constituting a
65 Mercurial install.
65 Mercurial install.
66 """
66 """
67 # We need to make gettext binaries available for compiling i18n files.
67 # We need to make gettext binaries available for compiling i18n files.
68 gettext_pkg, gettext_entry = download_entry('gettext', build_dir)
68 gettext_pkg, gettext_entry = download_entry('gettext', build_dir)
69 gettext_dep_pkg = download_entry('gettext-dep', build_dir)[0]
69 gettext_dep_pkg = download_entry('gettext-dep', build_dir)[0]
70
70
71 gettext_root = build_dir / ('gettext-win-%s' % gettext_entry['version'])
71 gettext_root = build_dir / ('gettext-win-%s' % gettext_entry['version'])
72
72
73 if not gettext_root.exists():
73 if not gettext_root.exists():
74 extract_zip_to_directory(gettext_pkg, gettext_root)
74 extract_zip_to_directory(gettext_pkg, gettext_root)
75 extract_zip_to_directory(gettext_dep_pkg, gettext_root)
75 extract_zip_to_directory(gettext_dep_pkg, gettext_root)
76
76
77 env = dict(os.environ)
77 env = dict(os.environ)
78 env["PATH"] = "%s%s%s" % (
78 env["PATH"] = "%s%s%s" % (
79 env["PATH"],
79 env["PATH"],
80 os.pathsep,
80 os.pathsep,
81 str(gettext_root / "bin"),
81 str(gettext_root / "bin"),
82 )
82 )
83
83
84 args = [
84 args = [
85 "pyoxidizer",
85 "pyoxidizer",
86 "build",
86 "build",
87 "--path",
87 "--path",
88 str(source_dir / "rust" / "hgcli"),
88 str(source_dir / "rust" / "hgcli"),
89 "--release",
89 "--release",
90 "--target-triple",
90 "--target-triple",
91 target_triple,
91 target_triple,
92 ]
92 ]
93
93
94 subprocess.run(args, env=env, check=True)
94 subprocess.run(args, env=env, check=True)
95
95
96 if "windows" in target_triple:
96 if "windows" in target_triple:
97 target = "app_windows"
97 target = "app_windows"
98 else:
98 else:
99 target = "app_posix"
99 target = "app_posix"
100
100
101 build_dir = (
101 build_dir = (
102 source_dir / "build" / "pyoxidizer" / target_triple / "release" / target
102 source_dir / "build" / "pyoxidizer" / target_triple / "release" / target
103 )
103 )
104
104
105 if out_dir.exists():
105 if out_dir.exists():
106 print("purging %s" % out_dir)
106 print("purging %s" % out_dir)
107 shutil.rmtree(out_dir)
107 shutil.rmtree(out_dir)
108
108
109 # Now assemble all the files from PyOxidizer into the staging directory.
109 # Now assemble all the files from PyOxidizer into the staging directory.
110 shutil.copytree(build_dir, out_dir)
110 shutil.copytree(build_dir, out_dir)
111
111
112 # Move some of those files around.
112 # Move some of those files around. We can get rid of this once Mercurial
113 # is taught to use the importlib APIs for reading resources.
113 process_install_rules(STAGING_RULES_APP, build_dir, out_dir)
114 process_install_rules(STAGING_RULES_APP, build_dir, out_dir)
114 # Nuke the mercurial/* directory, as we copied resources
115 # to an appropriate location just above.
116 shutil.rmtree(out_dir / "mercurial")
117
115
118 # We also need to run setup.py build_doc to produce html files,
116 # We also need to run setup.py build_doc to produce html files,
119 # as they aren't built as part of ``pip install``.
117 # as they aren't built as part of ``pip install``.
120 # This will fail if docutils isn't installed.
118 # This will fail if docutils isn't installed.
121 subprocess.run(
119 subprocess.run(
122 [sys.executable, str(source_dir / "setup.py"), "build_doc", "--html"],
120 [sys.executable, str(source_dir / "setup.py"), "build_doc", "--html"],
123 cwd=str(source_dir),
121 cwd=str(source_dir),
124 check=True,
122 check=True,
125 )
123 )
126
124
127 if "windows" in target_triple:
125 if "windows" in target_triple:
128 process_install_rules(STAGING_RULES_WINDOWS, source_dir, out_dir)
126 process_install_rules(STAGING_RULES_WINDOWS, source_dir, out_dir)
129
127
130 # Write out a default editor.rc file to configure notepad as the
128 # Write out a default editor.rc file to configure notepad as the
131 # default editor.
129 # default editor.
132 with (out_dir / "defaultrc" / "editor.rc").open(
130 with (out_dir / "defaultrc" / "editor.rc").open(
133 "w", encoding="utf-8"
131 "w", encoding="utf-8"
134 ) as fh:
132 ) as fh:
135 fh.write("[ui]\neditor = notepad\n")
133 fh.write("[ui]\neditor = notepad\n")
136
134
137 for f in STAGING_EXCLUDES_WINDOWS:
135 for f in STAGING_EXCLUDES_WINDOWS:
138 p = out_dir / f
136 p = out_dir / f
139 if p.exists():
137 if p.exists():
140 print("removing %s" % p)
138 print("removing %s" % p)
141 p.unlink()
139 p.unlink()
142
140
143 # Add vcruntimeXXX.dll next to executable.
141 # Add vcruntimeXXX.dll next to executable.
144 vc_runtime_dll = find_vc_runtime_dll(x64="x86_64" in target_triple)
142 vc_runtime_dll = find_vc_runtime_dll(x64="x86_64" in target_triple)
145 shutil.copy(vc_runtime_dll, out_dir / vc_runtime_dll.name)
143 shutil.copy(vc_runtime_dll, out_dir / vc_runtime_dll.name)
@@ -1,359 +1,509 b''
1 # This file is automatically @generated by Cargo.
1 # This file is automatically @generated by Cargo.
2 # It is not intended for manual editing.
2 # It is not intended for manual editing.
3 [[package]]
3 [[package]]
4 name = "aho-corasick"
4 name = "aho-corasick"
5 version = "0.7.10"
5 version = "0.7.13"
6 source = "registry+https://github.com/rust-lang/crates.io-index"
6 source = "registry+https://github.com/rust-lang/crates.io-index"
7 dependencies = [
7 dependencies = [
8 "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
8 "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
9 ]
9 ]
10
10
11 [[package]]
11 [[package]]
12 name = "anyhow"
12 name = "anyhow"
13 version = "1.0.28"
13 version = "1.0.32"
14 source = "registry+https://github.com/rust-lang/crates.io-index"
14 source = "registry+https://github.com/rust-lang/crates.io-index"
15
15
16 [[package]]
16 [[package]]
17 name = "autocfg"
17 name = "autocfg"
18 version = "1.0.0"
18 version = "1.0.1"
19 source = "registry+https://github.com/rust-lang/crates.io-index"
20
21 [[package]]
22 name = "base64"
23 version = "0.10.1"
24 source = "registry+https://github.com/rust-lang/crates.io-index"
25 dependencies = [
26 "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
27 ]
28
29 [[package]]
30 name = "base64"
31 version = "0.12.3"
19 source = "registry+https://github.com/rust-lang/crates.io-index"
32 source = "registry+https://github.com/rust-lang/crates.io-index"
20
33
21 [[package]]
34 [[package]]
22 name = "byteorder"
35 name = "byteorder"
23 version = "1.3.4"
36 version = "1.3.4"
24 source = "registry+https://github.com/rust-lang/crates.io-index"
37 source = "registry+https://github.com/rust-lang/crates.io-index"
25
38
26 [[package]]
39 [[package]]
27 name = "cc"
40 name = "cc"
28 version = "1.0.50"
41 version = "1.0.60"
29 source = "registry+https://github.com/rust-lang/crates.io-index"
42 source = "registry+https://github.com/rust-lang/crates.io-index"
30
43
31 [[package]]
44 [[package]]
32 name = "cfg-if"
45 name = "cfg-if"
33 version = "0.1.10"
46 version = "0.1.10"
34 source = "registry+https://github.com/rust-lang/crates.io-index"
47 source = "registry+https://github.com/rust-lang/crates.io-index"
35
48
36 [[package]]
49 [[package]]
50 name = "charset"
51 version = "0.1.2"
52 source = "registry+https://github.com/rust-lang/crates.io-index"
53 dependencies = [
54 "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
55 "encoding_rs 0.8.24 (registry+https://github.com/rust-lang/crates.io-index)",
56 ]
57
58 [[package]]
37 name = "cpython"
59 name = "cpython"
38 version = "0.4.1"
60 version = "0.5.0"
39 source = "git+https://github.com/dgrunwald/rust-cpython?rev=387e87d9deb6b678508888239f9f87dc36973d3f#387e87d9deb6b678508888239f9f87dc36973d3f"
61 source = "git+https://github.com/dgrunwald/rust-cpython.git?rev=4283acd94f4e794fe03679efc7a6c18bc50938a8#4283acd94f4e794fe03679efc7a6c18bc50938a8"
40 dependencies = [
62 dependencies = [
41 "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)",
63 "libc 0.2.78 (registry+https://github.com/rust-lang/crates.io-index)",
42 "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
64 "num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
43 "paste 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
65 "paste 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
44 "python3-sys 0.4.1 (git+https://github.com/dgrunwald/rust-cpython?rev=387e87d9deb6b678508888239f9f87dc36973d3f)",
66 "python3-sys 0.5.0 (git+https://github.com/dgrunwald/rust-cpython.git?rev=4283acd94f4e794fe03679efc7a6c18bc50938a8)",
67 ]
68
69 [[package]]
70 name = "either"
71 version = "1.6.1"
72 source = "registry+https://github.com/rust-lang/crates.io-index"
73
74 [[package]]
75 name = "encoding_rs"
76 version = "0.8.24"
77 source = "registry+https://github.com/rust-lang/crates.io-index"
78 dependencies = [
79 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
45 ]
80 ]
46
81
47 [[package]]
82 [[package]]
48 name = "fs_extra"
83 name = "fs_extra"
49 version = "1.1.0"
84 version = "1.2.0"
85 source = "registry+https://github.com/rust-lang/crates.io-index"
86
87 [[package]]
88 name = "fuchsia-cprng"
89 version = "0.1.1"
50 source = "registry+https://github.com/rust-lang/crates.io-index"
90 source = "registry+https://github.com/rust-lang/crates.io-index"
51
91
52 [[package]]
92 [[package]]
53 name = "getrandom"
93 name = "getrandom"
54 version = "0.1.14"
94 version = "0.1.15"
55 source = "registry+https://github.com/rust-lang/crates.io-index"
95 source = "registry+https://github.com/rust-lang/crates.io-index"
56 dependencies = [
96 dependencies = [
57 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
97 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
58 "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)",
98 "libc 0.2.78 (registry+https://github.com/rust-lang/crates.io-index)",
59 "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)",
99 "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)",
60 ]
100 ]
61
101
62 [[package]]
102 [[package]]
63 name = "hgcli"
103 name = "hgcli"
64 version = "0.1.0"
104 version = "0.1.0"
65 dependencies = [
105 dependencies = [
66 "jemallocator-global 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
106 "jemallocator-global 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
67 "pyembed 0.7.0-pre (git+https://github.com/indygreg/PyOxidizer.git?rev=c772a1379c3026314eda1c8ea244b86c0658951d)",
107 "pyembed 0.8.0-pre (git+https://github.com/indygreg/PyOxidizer.git?rev=4697fb25918dfad6dc73288daeea501063963a08)",
108 ]
109
110 [[package]]
111 name = "itertools"
112 version = "0.9.0"
113 source = "registry+https://github.com/rust-lang/crates.io-index"
114 dependencies = [
115 "either 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
68 ]
116 ]
69
117
70 [[package]]
118 [[package]]
71 name = "jemalloc-sys"
119 name = "jemalloc-sys"
72 version = "0.3.2"
120 version = "0.3.2"
73 source = "registry+https://github.com/rust-lang/crates.io-index"
121 source = "registry+https://github.com/rust-lang/crates.io-index"
74 dependencies = [
122 dependencies = [
75 "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)",
123 "cc 1.0.60 (registry+https://github.com/rust-lang/crates.io-index)",
76 "fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
124 "fs_extra 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
77 "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)",
125 "libc 0.2.78 (registry+https://github.com/rust-lang/crates.io-index)",
78 ]
126 ]
79
127
80 [[package]]
128 [[package]]
81 name = "jemallocator"
129 name = "jemallocator"
82 version = "0.3.2"
130 version = "0.3.2"
83 source = "registry+https://github.com/rust-lang/crates.io-index"
131 source = "registry+https://github.com/rust-lang/crates.io-index"
84 dependencies = [
132 dependencies = [
85 "jemalloc-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
133 "jemalloc-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
86 "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)",
134 "libc 0.2.78 (registry+https://github.com/rust-lang/crates.io-index)",
87 ]
135 ]
88
136
89 [[package]]
137 [[package]]
90 name = "jemallocator-global"
138 name = "jemallocator-global"
91 version = "0.3.2"
139 version = "0.3.2"
92 source = "registry+https://github.com/rust-lang/crates.io-index"
140 source = "registry+https://github.com/rust-lang/crates.io-index"
93 dependencies = [
141 dependencies = [
94 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
142 "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
95 "jemallocator 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
143 "jemallocator 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
96 ]
144 ]
97
145
98 [[package]]
146 [[package]]
99 name = "lazy_static"
147 name = "lazy_static"
100 version = "1.4.0"
148 version = "1.4.0"
101 source = "registry+https://github.com/rust-lang/crates.io-index"
149 source = "registry+https://github.com/rust-lang/crates.io-index"
102
150
103 [[package]]
151 [[package]]
104 name = "libc"
152 name = "libc"
105 version = "0.2.68"
153 version = "0.2.78"
106 source = "registry+https://github.com/rust-lang/crates.io-index"
154 source = "registry+https://github.com/rust-lang/crates.io-index"
107
155
108 [[package]]
156 [[package]]
157 name = "mailparse"
158 version = "0.13.0"
159 source = "registry+https://github.com/rust-lang/crates.io-index"
160 dependencies = [
161 "base64 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)",
162 "charset 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
163 "quoted_printable 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
164 ]
165
166 [[package]]
109 name = "memchr"
167 name = "memchr"
110 version = "2.3.3"
168 version = "2.3.3"
111 source = "registry+https://github.com/rust-lang/crates.io-index"
169 source = "registry+https://github.com/rust-lang/crates.io-index"
112
170
113 [[package]]
171 [[package]]
172 name = "memmap"
173 version = "0.7.0"
174 source = "registry+https://github.com/rust-lang/crates.io-index"
175 dependencies = [
176 "libc 0.2.78 (registry+https://github.com/rust-lang/crates.io-index)",
177 "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
178 ]
179
180 [[package]]
114 name = "memory-module-sys"
181 name = "memory-module-sys"
115 version = "0.3.0"
182 version = "0.3.0"
116 source = "registry+https://github.com/rust-lang/crates.io-index"
183 source = "registry+https://github.com/rust-lang/crates.io-index"
117 dependencies = [
184 dependencies = [
118 "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)",
185 "cc 1.0.60 (registry+https://github.com/rust-lang/crates.io-index)",
119 "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)",
186 "libc 0.2.78 (registry+https://github.com/rust-lang/crates.io-index)",
120 "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
187 "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
121 ]
188 ]
122
189
123 [[package]]
190 [[package]]
124 name = "num-traits"
191 name = "num-traits"
125 version = "0.2.11"
192 version = "0.2.12"
126 source = "registry+https://github.com/rust-lang/crates.io-index"
193 source = "registry+https://github.com/rust-lang/crates.io-index"
127 dependencies = [
194 dependencies = [
128 "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
195 "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
129 ]
196 ]
130
197
131 [[package]]
198 [[package]]
132 name = "paste"
199 name = "paste"
133 version = "0.1.9"
200 version = "0.1.18"
134 source = "registry+https://github.com/rust-lang/crates.io-index"
201 source = "registry+https://github.com/rust-lang/crates.io-index"
135 dependencies = [
202 dependencies = [
136 "paste-impl 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
203 "paste-impl 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
137 "proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)",
204 "proc-macro-hack 0.5.18 (registry+https://github.com/rust-lang/crates.io-index)",
138 ]
205 ]
139
206
140 [[package]]
207 [[package]]
141 name = "paste-impl"
208 name = "paste-impl"
142 version = "0.1.9"
209 version = "0.1.18"
143 source = "registry+https://github.com/rust-lang/crates.io-index"
210 source = "registry+https://github.com/rust-lang/crates.io-index"
144 dependencies = [
211 dependencies = [
145 "proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)",
212 "proc-macro-hack 0.5.18 (registry+https://github.com/rust-lang/crates.io-index)",
146 "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
147 "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
148 "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
149 ]
213 ]
150
214
151 [[package]]
215 [[package]]
152 name = "ppv-lite86"
216 name = "ppv-lite86"
153 version = "0.2.6"
217 version = "0.2.9"
154 source = "registry+https://github.com/rust-lang/crates.io-index"
218 source = "registry+https://github.com/rust-lang/crates.io-index"
155
219
156 [[package]]
220 [[package]]
157 name = "proc-macro-hack"
221 name = "proc-macro-hack"
158 version = "0.5.15"
222 version = "0.5.18"
159 source = "registry+https://github.com/rust-lang/crates.io-index"
223 source = "registry+https://github.com/rust-lang/crates.io-index"
160
224
161 [[package]]
225 [[package]]
162 name = "proc-macro2"
163 version = "1.0.10"
164 source = "registry+https://github.com/rust-lang/crates.io-index"
165 dependencies = [
166 "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
167 ]
168
169 [[package]]
170 name = "pyembed"
226 name = "pyembed"
171 version = "0.7.0-pre"
227 version = "0.8.0-pre"
172 source = "git+https://github.com/indygreg/PyOxidizer.git?rev=c772a1379c3026314eda1c8ea244b86c0658951d#c772a1379c3026314eda1c8ea244b86c0658951d"
228 source = "git+https://github.com/indygreg/PyOxidizer.git?rev=4697fb25918dfad6dc73288daeea501063963a08#4697fb25918dfad6dc73288daeea501063963a08"
173 dependencies = [
229 dependencies = [
174 "cpython 0.4.1 (git+https://github.com/dgrunwald/rust-cpython?rev=387e87d9deb6b678508888239f9f87dc36973d3f)",
230 "anyhow 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)",
231 "cpython 0.5.0 (git+https://github.com/dgrunwald/rust-cpython.git?rev=4283acd94f4e794fe03679efc7a6c18bc50938a8)",
175 "jemalloc-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
232 "jemalloc-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
176 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
233 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
177 "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)",
234 "libc 0.2.78 (registry+https://github.com/rust-lang/crates.io-index)",
235 "memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
178 "memory-module-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
236 "memory-module-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
179 "python-packed-resources 0.1.0-pre (git+https://github.com/indygreg/PyOxidizer.git?rev=c772a1379c3026314eda1c8ea244b86c0658951d)",
237 "python-packaging 0.1.0-pre (git+https://github.com/indygreg/PyOxidizer.git?rev=4697fb25918dfad6dc73288daeea501063963a08)",
180 "python3-sys 0.4.1 (git+https://github.com/dgrunwald/rust-cpython?rev=387e87d9deb6b678508888239f9f87dc36973d3f)",
238 "python-packed-resources 0.2.0-pre (git+https://github.com/indygreg/PyOxidizer.git?rev=4697fb25918dfad6dc73288daeea501063963a08)",
239 "python3-sys 0.5.0 (git+https://github.com/dgrunwald/rust-cpython.git?rev=4283acd94f4e794fe03679efc7a6c18bc50938a8)",
181 "uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
240 "uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
182 "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
241 "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
242 ]
243
244 [[package]]
245 name = "python-packaging"
246 version = "0.1.0-pre"
247 source = "git+https://github.com/indygreg/PyOxidizer.git?rev=4697fb25918dfad6dc73288daeea501063963a08#4697fb25918dfad6dc73288daeea501063963a08"
248 dependencies = [
249 "anyhow 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)",
250 "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
251 "encoding_rs 0.8.24 (registry+https://github.com/rust-lang/crates.io-index)",
252 "itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
253 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
254 "mailparse 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
255 "python-packed-resources 0.2.0-pre (git+https://github.com/indygreg/PyOxidizer.git?rev=4697fb25918dfad6dc73288daeea501063963a08)",
256 "regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
257 "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
258 "walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
183 ]
259 ]
184
260
185 [[package]]
261 [[package]]
186 name = "python-packed-resources"
262 name = "python-packed-resources"
187 version = "0.1.0-pre"
263 version = "0.2.0-pre"
188 source = "git+https://github.com/indygreg/PyOxidizer.git?rev=c772a1379c3026314eda1c8ea244b86c0658951d#c772a1379c3026314eda1c8ea244b86c0658951d"
264 source = "git+https://github.com/indygreg/PyOxidizer.git?rev=4697fb25918dfad6dc73288daeea501063963a08#4697fb25918dfad6dc73288daeea501063963a08"
189 dependencies = [
265 dependencies = [
190 "anyhow 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)",
266 "anyhow 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)",
191 "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
267 "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
192 ]
268 ]
193
269
194 [[package]]
270 [[package]]
195 name = "python3-sys"
271 name = "python3-sys"
196 version = "0.4.1"
272 version = "0.5.0"
197 source = "git+https://github.com/dgrunwald/rust-cpython?rev=387e87d9deb6b678508888239f9f87dc36973d3f#387e87d9deb6b678508888239f9f87dc36973d3f"
273 source = "git+https://github.com/dgrunwald/rust-cpython.git?rev=4283acd94f4e794fe03679efc7a6c18bc50938a8#4283acd94f4e794fe03679efc7a6c18bc50938a8"
198 dependencies = [
274 dependencies = [
199 "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)",
275 "libc 0.2.78 (registry+https://github.com/rust-lang/crates.io-index)",
200 "regex 1.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
276 "regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
201 ]
277 ]
202
278
203 [[package]]
279 [[package]]
204 name = "quote"
280 name = "quoted_printable"
205 version = "1.0.3"
281 version = "0.4.2"
282 source = "registry+https://github.com/rust-lang/crates.io-index"
283
284 [[package]]
285 name = "rand"
286 version = "0.4.6"
206 source = "registry+https://github.com/rust-lang/crates.io-index"
287 source = "registry+https://github.com/rust-lang/crates.io-index"
207 dependencies = [
288 dependencies = [
208 "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
289 "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
290 "libc 0.2.78 (registry+https://github.com/rust-lang/crates.io-index)",
291 "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
292 "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
293 "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
209 ]
294 ]
210
295
211 [[package]]
296 [[package]]
212 name = "rand"
297 name = "rand"
213 version = "0.7.3"
298 version = "0.7.3"
214 source = "registry+https://github.com/rust-lang/crates.io-index"
299 source = "registry+https://github.com/rust-lang/crates.io-index"
215 dependencies = [
300 dependencies = [
216 "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
301 "getrandom 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
217 "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)",
302 "libc 0.2.78 (registry+https://github.com/rust-lang/crates.io-index)",
218 "rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
303 "rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
219 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
304 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
220 "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
305 "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
221 ]
306 ]
222
307
223 [[package]]
308 [[package]]
224 name = "rand_chacha"
309 name = "rand_chacha"
225 version = "0.2.2"
310 version = "0.2.2"
226 source = "registry+https://github.com/rust-lang/crates.io-index"
311 source = "registry+https://github.com/rust-lang/crates.io-index"
227 dependencies = [
312 dependencies = [
228 "ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
313 "ppv-lite86 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
229 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
314 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
230 ]
315 ]
231
316
232 [[package]]
317 [[package]]
233 name = "rand_core"
318 name = "rand_core"
319 version = "0.3.1"
320 source = "registry+https://github.com/rust-lang/crates.io-index"
321 dependencies = [
322 "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
323 ]
324
325 [[package]]
326 name = "rand_core"
327 version = "0.4.2"
328 source = "registry+https://github.com/rust-lang/crates.io-index"
329
330 [[package]]
331 name = "rand_core"
234 version = "0.5.1"
332 version = "0.5.1"
235 source = "registry+https://github.com/rust-lang/crates.io-index"
333 source = "registry+https://github.com/rust-lang/crates.io-index"
236 dependencies = [
334 dependencies = [
237 "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
335 "getrandom 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
238 ]
336 ]
239
337
240 [[package]]
338 [[package]]
241 name = "rand_hc"
339 name = "rand_hc"
242 version = "0.2.0"
340 version = "0.2.0"
243 source = "registry+https://github.com/rust-lang/crates.io-index"
341 source = "registry+https://github.com/rust-lang/crates.io-index"
244 dependencies = [
342 dependencies = [
245 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
343 "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
246 ]
344 ]
247
345
248 [[package]]
346 [[package]]
249 name = "regex"
347 name = "rdrand"
250 version = "1.3.6"
348 version = "0.4.0"
251 source = "registry+https://github.com/rust-lang/crates.io-index"
349 source = "registry+https://github.com/rust-lang/crates.io-index"
252 dependencies = [
350 dependencies = [
253 "aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)",
351 "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
352 ]
353
354 [[package]]
355 name = "regex"
356 version = "1.3.9"
357 source = "registry+https://github.com/rust-lang/crates.io-index"
358 dependencies = [
359 "aho-corasick 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)",
254 "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
360 "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
255 "regex-syntax 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)",
361 "regex-syntax 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)",
256 "thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
362 "thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
257 ]
363 ]
258
364
259 [[package]]
365 [[package]]
260 name = "regex-syntax"
366 name = "regex-syntax"
261 version = "0.6.17"
367 version = "0.6.18"
262 source = "registry+https://github.com/rust-lang/crates.io-index"
368 source = "registry+https://github.com/rust-lang/crates.io-index"
263
369
264 [[package]]
370 [[package]]
265 name = "syn"
371 name = "remove_dir_all"
266 version = "1.0.17"
372 version = "0.5.3"
267 source = "registry+https://github.com/rust-lang/crates.io-index"
373 source = "registry+https://github.com/rust-lang/crates.io-index"
268 dependencies = [
374 dependencies = [
269 "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
375 "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
270 "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
376 ]
271 "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
377
378 [[package]]
379 name = "same-file"
380 version = "1.0.6"
381 source = "registry+https://github.com/rust-lang/crates.io-index"
382 dependencies = [
383 "winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
384 ]
385
386 [[package]]
387 name = "tempdir"
388 version = "0.3.7"
389 source = "registry+https://github.com/rust-lang/crates.io-index"
390 dependencies = [
391 "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
392 "remove_dir_all 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
272 ]
393 ]
273
394
274 [[package]]
395 [[package]]
275 name = "thread_local"
396 name = "thread_local"
276 version = "1.0.1"
397 version = "1.0.1"
277 source = "registry+https://github.com/rust-lang/crates.io-index"
398 source = "registry+https://github.com/rust-lang/crates.io-index"
278 dependencies = [
399 dependencies = [
279 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
400 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
280 ]
401 ]
281
402
282 [[package]]
403 [[package]]
283 name = "unicode-xid"
284 version = "0.2.0"
285 source = "registry+https://github.com/rust-lang/crates.io-index"
286
287 [[package]]
288 name = "uuid"
404 name = "uuid"
289 version = "0.8.1"
405 version = "0.8.1"
290 source = "registry+https://github.com/rust-lang/crates.io-index"
406 source = "registry+https://github.com/rust-lang/crates.io-index"
291 dependencies = [
407 dependencies = [
292 "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
408 "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
293 ]
409 ]
294
410
295 [[package]]
411 [[package]]
412 name = "walkdir"
413 version = "2.3.1"
414 source = "registry+https://github.com/rust-lang/crates.io-index"
415 dependencies = [
416 "same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
417 "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
418 "winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
419 ]
420
421 [[package]]
296 name = "wasi"
422 name = "wasi"
297 version = "0.9.0+wasi-snapshot-preview1"
423 version = "0.9.0+wasi-snapshot-preview1"
298 source = "registry+https://github.com/rust-lang/crates.io-index"
424 source = "registry+https://github.com/rust-lang/crates.io-index"
299
425
300 [[package]]
426 [[package]]
301 name = "winapi"
427 name = "winapi"
302 version = "0.3.8"
428 version = "0.3.9"
303 source = "registry+https://github.com/rust-lang/crates.io-index"
429 source = "registry+https://github.com/rust-lang/crates.io-index"
304 dependencies = [
430 dependencies = [
305 "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
431 "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
306 "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
432 "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
307 ]
433 ]
308
434
309 [[package]]
435 [[package]]
310 name = "winapi-i686-pc-windows-gnu"
436 name = "winapi-i686-pc-windows-gnu"
311 version = "0.4.0"
437 version = "0.4.0"
312 source = "registry+https://github.com/rust-lang/crates.io-index"
438 source = "registry+https://github.com/rust-lang/crates.io-index"
313
439
314 [[package]]
440 [[package]]
441 name = "winapi-util"
442 version = "0.1.5"
443 source = "registry+https://github.com/rust-lang/crates.io-index"
444 dependencies = [
445 "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
446 ]
447
448 [[package]]
315 name = "winapi-x86_64-pc-windows-gnu"
449 name = "winapi-x86_64-pc-windows-gnu"
316 version = "0.4.0"
450 version = "0.4.0"
317 source = "registry+https://github.com/rust-lang/crates.io-index"
451 source = "registry+https://github.com/rust-lang/crates.io-index"
318
452
319 [metadata]
453 [metadata]
320 "checksum aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)" = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada"
454 "checksum aho-corasick 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)" = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86"
321 "checksum anyhow 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)" = "d9a60d744a80c30fcb657dfe2c1b22bcb3e814c1a1e3674f32bf5820b570fbff"
455 "checksum anyhow 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)" = "6b602bfe940d21c130f3895acd65221e8a61270debe89d628b9cb4e3ccb8569b"
322 "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"
456 "checksum autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
457 "checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e"
458 "checksum base64 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
323 "checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
459 "checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
324 "checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd"
460 "checksum cc 1.0.60 (registry+https://github.com/rust-lang/crates.io-index)" = "ef611cc68ff783f18535d77ddd080185275713d852c4f5cbb6122c462a7a825c"
325 "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
461 "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
326 "checksum cpython 0.4.1 (git+https://github.com/dgrunwald/rust-cpython?rev=387e87d9deb6b678508888239f9f87dc36973d3f)" = "<none>"
462 "checksum charset 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4f426e64df1c3de26cbf44593c6ffff5dbfd43bbf9de0d075058558126b3fc73"
327 "checksum fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5f2a4a2034423744d2cc7ca2068453168dcdb82c438419e639a26bd87839c674"
463 "checksum cpython 0.5.0 (git+https://github.com/dgrunwald/rust-cpython.git?rev=4283acd94f4e794fe03679efc7a6c18bc50938a8)" = "<none>"
328 "checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb"
464 "checksum either 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
465 "checksum encoding_rs 0.8.24 (registry+https://github.com/rust-lang/crates.io-index)" = "a51b8cf747471cb9499b6d59e59b0444f4c90eba8968c4e44874e92b5b64ace2"
466 "checksum fs_extra 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394"
467 "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
468 "checksum getrandom 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6"
469 "checksum itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
329 "checksum jemalloc-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d3b9f3f5c9b31aa0f5ed3260385ac205db665baa41d49bb8338008ae94ede45"
470 "checksum jemalloc-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d3b9f3f5c9b31aa0f5ed3260385ac205db665baa41d49bb8338008ae94ede45"
330 "checksum jemallocator 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "43ae63fcfc45e99ab3d1b29a46782ad679e98436c3169d15a167a1108a724b69"
471 "checksum jemallocator 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "43ae63fcfc45e99ab3d1b29a46782ad679e98436c3169d15a167a1108a724b69"
331 "checksum jemallocator-global 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "991b61de8365c8b5707cf6cabbff98cfd6eaca9b851948b883efea408c7f581e"
472 "checksum jemallocator-global 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "991b61de8365c8b5707cf6cabbff98cfd6eaca9b851948b883efea408c7f581e"
332 "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
473 "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
333 "checksum libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)" = "dea0c0405123bba743ee3f91f49b1c7cfb684eef0da0a50110f758ccf24cdff0"
474 "checksum libc 0.2.78 (registry+https://github.com/rust-lang/crates.io-index)" = "aa7087f49d294270db4e1928fc110c976cd4b9e5a16348e0a1df09afa99e6c98"
475 "checksum mailparse 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "479b94621ea0fe875638d27f4a0b68213174b63e1ff9355d0948a04f71a5055a"
334 "checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
476 "checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
477 "checksum memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b"
335 "checksum memory-module-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bbdce2925c681860b08875119254fb5543dbf6337c56ff93afebeed9c686da3"
478 "checksum memory-module-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bbdce2925c681860b08875119254fb5543dbf6337c56ff93afebeed9c686da3"
336 "checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096"
479 "checksum num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611"
337 "checksum paste 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "092d791bf7847f70bbd49085489fba25fc2c193571752bff9e36e74e72403932"
480 "checksum paste 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880"
338 "checksum paste-impl 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "406c23fb4c45cc6f68a9bbabb8ec7bd6f8cfcbd17e9e8f72c2460282f8325729"
481 "checksum paste-impl 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6"
339 "checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b"
482 "checksum ppv-lite86 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20"
340 "checksum proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)" = "0d659fe7c6d27f25e9d80a1a094c223f5246f6a6596453e09d7229bf42750b63"
483 "checksum proc-macro-hack 0.5.18 (registry+https://github.com/rust-lang/crates.io-index)" = "99c605b9a0adc77b7211c6b1f722dcb613d68d66859a44f3d485a6da332b0598"
341 "checksum proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "df246d292ff63439fea9bc8c0a270bed0e390d5ebd4db4ba15aba81111b5abe3"
484 "checksum pyembed 0.8.0-pre (git+https://github.com/indygreg/PyOxidizer.git?rev=4697fb25918dfad6dc73288daeea501063963a08)" = "<none>"
342 "checksum pyembed 0.7.0-pre (git+https://github.com/indygreg/PyOxidizer.git?rev=c772a1379c3026314eda1c8ea244b86c0658951d)" = "<none>"
485 "checksum python-packaging 0.1.0-pre (git+https://github.com/indygreg/PyOxidizer.git?rev=4697fb25918dfad6dc73288daeea501063963a08)" = "<none>"
343 "checksum python-packed-resources 0.1.0-pre (git+https://github.com/indygreg/PyOxidizer.git?rev=c772a1379c3026314eda1c8ea244b86c0658951d)" = "<none>"
486 "checksum python-packed-resources 0.2.0-pre (git+https://github.com/indygreg/PyOxidizer.git?rev=4697fb25918dfad6dc73288daeea501063963a08)" = "<none>"
344 "checksum python3-sys 0.4.1 (git+https://github.com/dgrunwald/rust-cpython?rev=387e87d9deb6b678508888239f9f87dc36973d3f)" = "<none>"
487 "checksum python3-sys 0.5.0 (git+https://github.com/dgrunwald/rust-cpython.git?rev=4283acd94f4e794fe03679efc7a6c18bc50938a8)" = "<none>"
345 "checksum quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f"
488 "checksum quoted_printable 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "47b080c5db639b292ac79cbd34be0cfc5d36694768d8341109634d90b86930e2"
489 "checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293"
346 "checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
490 "checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
347 "checksum rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
491 "checksum rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
492 "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
493 "checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"
348 "checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
494 "checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
349 "checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
495 "checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
350 "checksum regex 1.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7f6946991529684867e47d86474e3a6d0c0ab9b82d5821e314b1ede31fa3a4b3"
496 "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
351 "checksum regex-syntax 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)" = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae"
497 "checksum regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6"
352 "checksum syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "0df0eb663f387145cab623dea85b09c2c5b4b0aef44e945d928e682fce71bb03"
498 "checksum regex-syntax 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)" = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8"
499 "checksum remove_dir_all 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
500 "checksum same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
501 "checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8"
353 "checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
502 "checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
354 "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"
355 "checksum uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11"
503 "checksum uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11"
504 "checksum walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d"
356 "checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
505 "checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
357 "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6"
506 "checksum winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
358 "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
507 "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
508 "checksum winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
359 "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
509 "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
@@ -1,24 +1,28 b''
1 [package]
1 [package]
2 name = "hgcli"
2 name = "hgcli"
3 version = "0.1.0"
3 version = "0.1.0"
4 build = "build.rs"
4 build = "build.rs"
5 authors = ["Gregory Szorc <gregory.szorc@gmail.com>"]
5 authors = ["Gregory Szorc <gregory.szorc@gmail.com>"]
6 edition = "2018"
6 edition = "2018"
7 license = "GPL-2.0"
7 license = "GPL-2.0"
8 readme = "README.md"
8 readme = "README.md"
9
9
10 [[bin]]
10 [[bin]]
11 name = "hg"
11 name = "hg"
12 path = "src/main.rs"
12 path = "src/main.rs"
13
13
14 [dependencies]
14 [dependencies]
15 jemallocator-global = { version = "0.3", optional = true }
15 jemallocator-global = { version = "0.3", optional = true }
16 pyembed = { git = "https://github.com/indygreg/PyOxidizer.git", rev = "c772a1379c3026314eda1c8ea244b86c0658951d", default-features=false }
16
17 [dependencies.pyembed]
18 git = "https://github.com/indygreg/PyOxidizer.git"
19 rev = "4697fb25918dfad6dc73288daeea501063963a08"
20 default-features = false
17
21
18 [features]
22 [features]
19 default = ["build-mode-pyoxidizer-exe"]
23 default = ["build-mode-pyoxidizer-exe"]
20 jemalloc = ["jemallocator-global", "pyembed/jemalloc"]
24 jemalloc = ["jemallocator-global", "pyembed/jemalloc"]
21 build-mode-pyoxidizer-exe = ["pyembed/build-mode-pyoxidizer-exe"]
25 build-mode-pyoxidizer-exe = ["pyembed/build-mode-pyoxidizer-exe"]
22 build-mode-prebuilt-artifacts = ["pyembed/build-mode-prebuilt-artifacts"]
26 build-mode-prebuilt-artifacts = ["pyembed/build-mode-prebuilt-artifacts"]
23 cpython-link-unresolved-static = ["pyembed/cpython-link-unresolved-static"]
27 cpython-link-unresolved-static = ["pyembed/cpython-link-unresolved-static"]
24 cpython-link-default = ["pyembed/cpython-link-default"]
28 cpython-link-default = ["pyembed/cpython-link-default"]
@@ -1,98 +1,108 b''
1 ROOT = CWD + "/../.."
1 ROOT = CWD + "/../.."
2
2
3 IS_WINDOWS = "windows" in BUILD_TARGET_TRIPLE
4
3 # Code to run in Python interpreter.
5 # Code to run in Python interpreter.
4 RUN_CODE = "import hgdemandimport; hgdemandimport.enable(); from mercurial import dispatch; dispatch.run()"
6 RUN_CODE = "import hgdemandimport; hgdemandimport.enable(); from mercurial import dispatch; dispatch.run()"
5
7
6 set_build_path(ROOT + "/build/pyoxidizer")
8 set_build_path(ROOT + "/build/pyoxidizer")
7
9
8 def make_distribution():
10 def make_distribution():
9 return default_python_distribution()
11 return default_python_distribution()
10
12
11 def make_distribution_windows():
13 def make_distribution_windows():
12 return default_python_distribution(flavor = "standalone_dynamic")
14 return default_python_distribution(flavor = "standalone_dynamic")
13
15
16 def resource_callback(policy, resource):
17 # We use a custom resource routing policy to influence where things are loaded
18 # from.
19 #
20 # For Python modules and resources, we load from memory if they are in
21 # the standard library and from the filesystem if not. This is because
22 # parts of Mercurial and some 3rd party packages aren't yet compatible
23 # with memory loading.
24 #
25 # For Python extension modules, we load from the filesystem because
26 # this yields greatest compatibility.
27 if type(resource) in ("PythonModuleSource", "PythonPackageResource", "PythonPackageDistributionResource"):
28 if resource.is_stdlib:
29 resource.add_location = "in-memory"
30 else:
31 resource.add_location = "filesystem-relative:lib"
32
33 elif type(resource) == "PythonExtensionModule":
34 resource.add_location = "filesystem-relative:lib"
35
14 def make_exe(dist):
36 def make_exe(dist):
15 """Builds a Rust-wrapped Mercurial binary."""
37 """Builds a Rust-wrapped Mercurial binary."""
38 packaging_policy = dist.make_python_packaging_policy()
39 # Extension may depend on any Python functionality. Include all
40 # extensions.
41 packaging_policy.extension_module_filter = "all"
42 packaging_policy.resources_policy = "prefer-in-memory-fallback-filesystem-relative:lib"
43 packaging_policy.register_resource_callback(resource_callback)
44
16 config = PythonInterpreterConfig(
45 config = PythonInterpreterConfig(
17 raw_allocator = "system",
46 raw_allocator = "system",
18 run_eval = RUN_CODE,
47 run_eval = RUN_CODE,
19 # We want to let the user load extensions from the file system
48 # We want to let the user load extensions from the file system
20 filesystem_importer = True,
49 filesystem_importer = True,
21 # We need this to make resourceutil happy, since it looks for sys.frozen.
50 # We need this to make resourceutil happy, since it looks for sys.frozen.
22 sys_frozen = True,
51 sys_frozen = True,
23 legacy_windows_stdio = True,
52 legacy_windows_stdio = True,
24 )
53 )
25
54
26 exe = dist.to_python_executable(
55 exe = dist.to_python_executable(
27 name = "hg",
56 name = "hg",
28 resources_policy = "prefer-in-memory-fallback-filesystem-relative:lib",
57 packaging_policy = packaging_policy,
29 config = config,
58 config = config,
30 # Extension may depend on any Python functionality. Include all
31 # extensions.
32 extension_module_filter = "all",
33 )
59 )
34
60
35 # Add Mercurial to resources.
61 # Add Mercurial to resources.
36 for resource in dist.pip_install(["--verbose", ROOT]):
62 exe.add_python_resources(exe.pip_install(["--verbose", ROOT]))
37 # This is a bit wonky and worth explaining.
38 #
39 # Various parts of Mercurial don't yet support loading package
40 # resources via the ResourceReader interface. Or, not having
41 # file-based resources would be too inconvenient for users.
42 #
43 # So, for package resources, we package them both in the
44 # filesystem as well as in memory. If both are defined,
45 # PyOxidizer will prefer the in-memory location. So even
46 # if the filesystem file isn't packaged in the location
47 # specified here, we should never encounter an errors as the
48 # resource will always be available in memory.
49 if type(resource) == "PythonPackageResource":
50 exe.add_filesystem_relative_python_resource(".", resource)
51 exe.add_in_memory_python_resource(resource)
52 else:
53 exe.add_python_resource(resource)
54
63
55 # On Windows, we install extra packages for convenience.
64 # On Windows, we install extra packages for convenience.
56 if "windows" in BUILD_TARGET_TRIPLE:
65 if IS_WINDOWS:
57 exe.add_python_resources(
66 exe.add_python_resources(
58 dist.pip_install(["-r", ROOT + "/contrib/packaging/requirements_win32.txt"]),
67 exe.pip_install(["-r", ROOT + "/contrib/packaging/requirements_win32.txt"]),
59 )
68 )
60
69
61 return exe
70 return exe
62
71
63 def make_manifest(dist, exe):
72 def make_manifest(dist, exe):
64 m = FileManifest()
73 m = FileManifest()
65 m.add_python_resource(".", exe)
74 m.add_python_resource(".", exe)
66
75
67 return m
76 return m
68
77
69 def make_embedded_resources(exe):
78 def make_embedded_resources(exe):
70 return exe.to_embedded_resources()
79 return exe.to_embedded_resources()
71
80
72 register_target("distribution_posix", make_distribution)
81 register_target("distribution_posix", make_distribution)
73 register_target("distribution_windows", make_distribution_windows)
82 register_target("distribution_windows", make_distribution_windows)
74
83
75 register_target("exe_posix", make_exe, depends = ["distribution_posix"])
84 register_target("exe_posix", make_exe, depends = ["distribution_posix"])
76 register_target("exe_windows", make_exe, depends = ["distribution_windows"])
85 register_target("exe_windows", make_exe, depends = ["distribution_windows"])
77
86
78 register_target(
87 register_target(
79 "app_posix",
88 "app_posix",
80 make_manifest,
89 make_manifest,
81 depends = ["distribution_posix", "exe_posix"],
90 depends = ["distribution_posix", "exe_posix"],
82 default = "windows" not in BUILD_TARGET_TRIPLE,
91 default = "windows" not in BUILD_TARGET_TRIPLE,
83 )
92 )
84 register_target(
93 register_target(
85 "app_windows",
94 "app_windows",
86 make_manifest,
95 make_manifest,
87 depends = ["distribution_windows", "exe_windows"],
96 depends = ["distribution_windows", "exe_windows"],
88 default = "windows" in BUILD_TARGET_TRIPLE,
97 default = "windows" in BUILD_TARGET_TRIPLE,
89 )
98 )
90
99
91 resolve_targets()
100 resolve_targets()
92
101
93 # END OF COMMON USER-ADJUSTED SETTINGS.
102 # END OF COMMON USER-ADJUSTED SETTINGS.
94 #
103 #
95 # Everything below this is typically managed by PyOxidizer and doesn't need
104 # Everything below this is typically managed by PyOxidizer and doesn't need
96 # to be updated by people.
105 # to be updated by people.
97
106
98 PYOXIDIZER_VERSION = "0.7.0"
107 PYOXIDIZER_VERSION = "0.8.0-pre"
108 PYOXIDIZER_COMMIT = "4697fb25918dfad6dc73288daeea501063963a08"
General Comments 0
You need to be logged in to leave comments. Login now