comparison contrib/automation/hgautomation/linux.py @ 42718:89ba81771fc9

automation: install Rust in Linux environment This will install Rust 1.31.1, 1.34.2, and whatever stable is at the time the install runs. We install 1.31.1 as our minimum supported Rust version (I think that's what we're currently targeting) and 1.34 because that's what Debian 10 is shipping. Differential Revision: https://phab.mercurial-scm.org/D6715
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 03 Aug 2019 16:03:11 -0700
parents 6f7262fe671c
children 198b51d453fe
comparison
equal deleted inserted replaced
42717:3495edddc78d 42718:89ba81771fc9
61 ${PYENV_ROOT}/versions/${v}/bin/pip install -r /hgdev/requirements-py3.txt 61 ${PYENV_ROOT}/versions/${v}/bin/pip install -r /hgdev/requirements-py3.txt
62 done 62 done
63 63
64 pyenv global ${PYENV2_VERSIONS} ${PYENV3_VERSIONS} system 64 pyenv global ${PYENV2_VERSIONS} ${PYENV3_VERSIONS} system
65 '''.lstrip().replace('\r\n', '\n') 65 '''.lstrip().replace('\r\n', '\n')
66
67
68 INSTALL_RUST = r'''
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
71 echo "${RUSTUP_INIT_SHA256} rustup-init" | sha256sum --check -
72
73 chmod +x rustup-init
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.34.2
76 sudo -H -u hg -g hg /home/hg/.cargo/bin/rustup component add clippy
77 '''
66 78
67 79
68 BOOTSTRAP_VIRTUALENV = r''' 80 BOOTSTRAP_VIRTUALENV = r'''
69 /usr/bin/virtualenv /hgdev/venv-bootstrap 81 /usr/bin/virtualenv /hgdev/venv-bootstrap
70 82
284 296
285 sudo mkdir /hgdev 297 sudo mkdir /hgdev
286 # Will be normalized to hg:hg later. 298 # Will be normalized to hg:hg later.
287 sudo chown `whoami` /hgdev 299 sudo chown `whoami` /hgdev
288 300
301 {install_rust}
302
289 cp requirements-py2.txt /hgdev/requirements-py2.txt 303 cp requirements-py2.txt /hgdev/requirements-py2.txt
290 cp requirements-py3.txt /hgdev/requirements-py3.txt 304 cp requirements-py3.txt /hgdev/requirements-py3.txt
291 305
292 # Disable the pip version check because it uses the network and can 306 # Disable the pip version check because it uses the network and can
293 # be annoying. 307 # be annoying.
307 publish = false 321 publish = false
308 EOF 322 EOF
309 323
310 sudo chown -R hg:hg /hgdev 324 sudo chown -R hg:hg /hgdev
311 '''.lstrip().format( 325 '''.lstrip().format(
326 install_rust=INSTALL_RUST,
312 install_pythons=INSTALL_PYTHONS, 327 install_pythons=INSTALL_PYTHONS,
313 bootstrap_virtualenv=BOOTSTRAP_VIRTUALENV 328 bootstrap_virtualenv=BOOTSTRAP_VIRTUALENV
314 ).replace('\r\n', '\n') 329 ).replace('\r\n', '\n')
315 330
316 331