comparison contrib/automation/hgautomation/linux.py @ 47213:0de5eefbe4b2

contrib: install PyOxidizer 0.16.0 PyOxidizer now provides MSI installers and pre-built Linux binaries. So we install that way. This significantly reduces the time to bootstrap a new machine in automation, as building PyOxidizer from source on a low core count machine takes several minutes. This change temporarily breaks the ability of the automated environment to use the in-repo pyoxidizer.bzl configuration file, as there are backwards-incompatible changes with the upgrade that need to be reflected. We'll handle those in subsequent commits. Differential Revision: https://phab.mercurial-scm.org/D10680
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 06 May 2021 15:56:04 -0700
parents 2df655f682a6
children d953a42b157d
comparison
equal deleted inserted replaced
47212:95950dc832cf 47213:0de5eefbe4b2
75 pyenv global ${PYENV2_VERSIONS} ${PYENV3_VERSIONS} system 75 pyenv global ${PYENV2_VERSIONS} ${PYENV3_VERSIONS} system
76 '''.lstrip().replace( 76 '''.lstrip().replace(
77 '\r\n', '\n' 77 '\r\n', '\n'
78 ) 78 )
79 79
80 INSTALL_PYOXIDIZER = r'''
81 PYOXIDIZER_VERSION=0.16.0
82 PYOXIDIZER_SHA256=8875471c270312fbb934007fd30f65f1904cc0f5da6188d61c90ed2129b9f9c1
83 PYOXIDIZER_URL=https://github.com/indygreg/PyOxidizer/releases/download/pyoxidizer%2F${PYOXIDIZER_VERSION}/pyoxidizer-${PYOXIDIZER_VERSION}-linux_x86_64.zip
84
85 wget -O pyoxidizer.zip --progress dot:mega ${PYOXIDIZER_URL}
86 echo "${PYOXIDIZER_SHA256} pyoxidizer.zip" | sha256sum --check -
87
88 unzip pyoxidizer.zip
89 chmod +x pyoxidizer
90 sudo mv pyoxidizer /usr/local/bin/pyoxidizer
91 '''
80 92
81 INSTALL_RUST = r''' 93 INSTALL_RUST = r'''
82 RUSTUP_INIT_SHA256=a46fe67199b7bcbbde2dcbc23ae08db6f29883e260e23899a88b9073effc9076 94 RUSTUP_INIT_SHA256=a46fe67199b7bcbbde2dcbc23ae08db6f29883e260e23899a88b9073effc9076
83 wget -O rustup-init --progress dot:mega https://static.rust-lang.org/rustup/archive/1.18.3/x86_64-unknown-linux-gnu/rustup-init 95 wget -O rustup-init --progress dot:mega https://static.rust-lang.org/rustup/archive/1.18.3/x86_64-unknown-linux-gnu/rustup-init
84 echo "${RUSTUP_INIT_SHA256} rustup-init" | sha256sum --check - 96 echo "${RUSTUP_INIT_SHA256} rustup-init" | sha256sum --check -
85 97
86 chmod +x rustup-init 98 chmod +x rustup-init
87 sudo -H -u hg -g hg ./rustup-init -y 99 sudo -H -u hg -g hg ./rustup-init -y
88 sudo -H -u hg -g hg /home/hg/.cargo/bin/rustup install 1.41.1 1.52.0 100 sudo -H -u hg -g hg /home/hg/.cargo/bin/rustup install 1.41.1 1.52.0
89 sudo -H -u hg -g hg /home/hg/.cargo/bin/rustup component add clippy 101 sudo -H -u hg -g hg /home/hg/.cargo/bin/rustup component add clippy
90
91 sudo -H -u hg -g hg /home/hg/.cargo/bin/cargo install --version 0.10.3 pyoxidizer
92 ''' 102 '''
93 103
94 104
95 BOOTSTRAP_VIRTUALENV = r''' 105 BOOTSTRAP_VIRTUALENV = r'''
96 /usr/bin/virtualenv /hgdev/venv-bootstrap 106 /usr/bin/virtualenv /hgdev/venv-bootstrap
317 sudo mkdir /hgdev 327 sudo mkdir /hgdev
318 # Will be normalized to hg:hg later. 328 # Will be normalized to hg:hg later.
319 sudo chown `whoami` /hgdev 329 sudo chown `whoami` /hgdev
320 330
321 {install_rust} 331 {install_rust}
332 {install_pyoxidizer}
322 333
323 cp requirements-*.txt /hgdev/ 334 cp requirements-*.txt /hgdev/
324 335
325 # Disable the pip version check because it uses the network and can 336 # Disable the pip version check because it uses the network and can
326 # be annoying. 337 # be annoying.
342 353
343 sudo chown -R hg:hg /hgdev 354 sudo chown -R hg:hg /hgdev
344 '''.lstrip() 355 '''.lstrip()
345 .format( 356 .format(
346 install_rust=INSTALL_RUST, 357 install_rust=INSTALL_RUST,
358 install_pyoxidizer=INSTALL_PYOXIDIZER,
347 install_pythons=INSTALL_PYTHONS, 359 install_pythons=INSTALL_PYTHONS,
348 bootstrap_virtualenv=BOOTSTRAP_VIRTUALENV, 360 bootstrap_virtualenv=BOOTSTRAP_VIRTUALENV,
349 ) 361 )
350 .replace('\r\n', '\n') 362 .replace('\r\n', '\n')
351 ) 363 )