]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_codegen_cranelift/scripts/rustup.sh
Rollup merge of #77691 - exrook:rename-layouterr, r=KodrAus
[rust.git] / compiler / rustc_codegen_cranelift / scripts / rustup.sh
1 #!/bin/bash
2
3 set -e
4
5 case $1 in
6     "prepare")
7         TOOLCHAIN=$(date +%Y-%m-%d)
8
9         echo "=> Installing new nightly"
10         rustup toolchain install --profile minimal nightly-${TOOLCHAIN} # Sanity check to see if the nightly exists
11         echo nightly-${TOOLCHAIN} > rust-toolchain
12         rustup component add rustfmt || true
13
14         echo "=> Uninstalling all old nighlies"
15         for nightly in $(rustup toolchain list | grep nightly | grep -v $TOOLCHAIN | grep -v nightly-x86_64); do
16             rustup toolchain uninstall $nightly
17         done
18
19         ./clean_all.sh
20         ./prepare.sh
21
22         (cd build_sysroot && cargo update)
23
24         ;;
25     "commit")
26         git add rust-toolchain build_sysroot/Cargo.lock
27         git commit -m "Rustup to $(rustc -V)"
28         ;;
29     "push")
30         cg_clif=$(pwd)
31         pushd ../rust
32         branch=update_cg_clif-$(date +%Y-%m-%d)
33         git checkout -b $branch
34         git subtree pull --prefix=compiler/rustc_codegen_cranelift/ https://github.com/bjorn3/rustc_codegen_cranelift.git master
35         git push -u my $branch
36         popd
37         ;;
38     *)
39         echo "Unknown command '$1'"
40         echo "Usage: ./rustup.sh prepare|commit"
41         ;;
42 esac