blob: 6fba6298768f4b06606d62e602a137e095166c03 [file] [log] [blame]
gnzlbg37a0bd32018-11-19 15:49:56 +01001#!/usr/bin/env sh
2
Alex Crichtond820c4a2016-01-18 11:16:38 -08003# 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
13set -ex
14
gnzlbg37a0bd32018-11-19 15:49:56 +010015ROOT="${1}"
16cp -r "${ROOT}/libc" /tmp/libc
Alex Crichtond820c4a2016-01-18 11:16:38 -080017cd /tmp/libc
18
gnzlbg37a0bd32018-11-19 15:49:56 +010019TARGET="$(cat "${ROOT}/TARGET")"
Alex Crichton3eb4a482016-06-10 05:03:23 -070020export CARGO_TARGET_DIR=/tmp
Alex Crichtond820c4a2016-01-18 11:16:38 -080021
22case $TARGET in
Alex Crichtond820c4a2016-01-18 11:16:38 -080023 *-openbsd)
Sébastien Mariea40adc62016-09-07 19:30:57 +020024 pkg_add cargo gcc%4.9 rust
Alex Crichtond820c4a2016-01-18 11:16:38 -080025 export CC=egcc
26 ;;
27
28 *)
gnzlbg37a0bd32018-11-19 15:49:56 +010029 echo "Unknown target: ${TARGET}"
Alex Crichtond820c4a2016-01-18 11:16:38 -080030 exit 1
31 ;;
32esac
33
gnzlbg37a0bd32018-11-19 15:49:56 +010034exec sh ci/run.sh "${TARGET}"