44set -eux
55
66echo " Setup toolchain"
7- toolchain=
8- if [ -n " $TOOLCHAIN " ]; then
9- toolchain=$TOOLCHAIN
10- else
11- toolchain=nightly
12- fi
137
14- if [ " $OS " = " windows" ]; then
8+ toolchain=" ${TOOLCHAIN:- nightly} "
9+ os=" ${OS:- } "
10+
11+ if [ " $os " = " windows" ]; then
1512 : " ${TARGET?The TARGET environment variable must be set.} "
1613 rustup set profile minimal
1714 rustup update --force " $toolchain -$TARGET "
2219 rustup default " $toolchain "
2320fi
2421
25- if [ -n " $TARGET " ]; then
22+ if [ -n " ${ TARGET:- } " ]; then
2623 echo " Install target"
2724 rustup target add " $TARGET "
2825fi
2926
30- if [ -n " $INSTALL_RUST_SRC " ]; then
27+ if [ -n " ${ INSTALL_RUST_SRC:- } " ]; then
3128 echo " Install rust-src"
3229 rustup component add rust-src
3330fi
3431
35- if [ " $OS " = " windows" ]; then
36- if [ " $ARCH_BITS " = " i686" ]; then
32+ if [ " $os " = " windows" ]; then
33+ if [ " ${ ARCH_BITS:- } " = " i686" ]; then
3734 echo " Install MinGW32"
3835 choco install mingw --x86 --force
3936 fi
@@ -44,7 +41,7 @@ if [ "$OS" = "windows" ]; then
4441 /usr/bin/find " C:\ProgramData\Chocolatey" -name " dllcrt2*"
4542 /usr/bin/find " C:\ProgramData\Chocolatey" -name " libmsvcrt*"
4643
47- if [ -n " $ARCH_BITS " ]; then
44+ if [ -n " ${ ARCH_BITS:- } " ]; then
4845 echo " Fix MinGW"
4946 for i in crt2.o dllcrt2.o libmingwex.a libmsvcrt.a ; do
5047 cp -f " /C/ProgramData/Chocolatey/lib/mingw/tools/install/mingw$ARCH_BITS /$ARCH -w64-mingw32/lib/$i " " $( rustc --print sysroot) /lib/rustlib/$TARGET /lib"
0 commit comments