| gnzlbg | 37a0bd3 | 2018-11-19 15:49:56 +0100 | [diff] [blame] | 1 | #!/usr/bin/env sh |
| 2 | |
| Alex Crichton | d820c4a | 2016-01-18 11:16:38 -0800 | [diff] [blame] | 3 | # Initial script which is run inside of all qemu images. The first argument to |
| 4 | # this script (as arranged by the qemu image itself) is the path to where the |
| 5 | # libc crate is mounted. |
| 6 | # |
| 7 | # For qemu images we currently need to install Rust manually as this wasn't done |
| 8 | # by the initial run-travis.sh script |
| 9 | # |
| 10 | # FIXME: feels like run-travis.sh should be responsible for downloading the |
| 11 | # compiler. |
| 12 | |
| 13 | set -ex |
| 14 | |
| gnzlbg | 37a0bd3 | 2018-11-19 15:49:56 +0100 | [diff] [blame] | 15 | ROOT="${1}" |
| 16 | cp -r "${ROOT}/libc" /tmp/libc |
| Alex Crichton | d820c4a | 2016-01-18 11:16:38 -0800 | [diff] [blame] | 17 | cd /tmp/libc |
| 18 | |
| gnzlbg | 37a0bd3 | 2018-11-19 15:49:56 +0100 | [diff] [blame] | 19 | TARGET="$(cat "${ROOT}/TARGET")" |
| Alex Crichton | 3eb4a48 | 2016-06-10 05:03:23 -0700 | [diff] [blame] | 20 | export CARGO_TARGET_DIR=/tmp |
| Alex Crichton | d820c4a | 2016-01-18 11:16:38 -0800 | [diff] [blame] | 21 | |
| 22 | case $TARGET in |
| Alex Crichton | d820c4a | 2016-01-18 11:16:38 -0800 | [diff] [blame] | 23 | *-openbsd) |
| Sébastien Marie | a40adc6 | 2016-09-07 19:30:57 +0200 | [diff] [blame] | 24 | pkg_add cargo gcc%4.9 rust |
| Alex Crichton | d820c4a | 2016-01-18 11:16:38 -0800 | [diff] [blame] | 25 | export CC=egcc |
| 26 | ;; |
| 27 | |
| 28 | *) |
| gnzlbg | 37a0bd3 | 2018-11-19 15:49:56 +0100 | [diff] [blame] | 29 | echo "Unknown target: ${TARGET}" |
| Alex Crichton | d820c4a | 2016-01-18 11:16:38 -0800 | [diff] [blame] | 30 | exit 1 |
| 31 | ;; |
| 32 | esac |
| 33 | |
| gnzlbg | 37a0bd3 | 2018-11-19 15:49:56 +0100 | [diff] [blame] | 34 | exec sh ci/run.sh "${TARGET}" |