Enable kvm in docker images if available
This commit is contained in:
parent
05a2d19735
commit
0b05b2a845
@ -8,10 +8,14 @@ run() {
|
||||
# use -f so we can use ci/ as build context
|
||||
docker build -t libc -f ci/docker/$1/Dockerfile ci/
|
||||
mkdir -p target
|
||||
if [ -w /dev/kvm ]; then
|
||||
kvm="--volume /dev/kvm:/dev/kvm"
|
||||
fi
|
||||
docker run \
|
||||
--user `id -u`:`id -g` \
|
||||
--rm \
|
||||
--volume $HOME/.cargo:/cargo \
|
||||
$kvm \
|
||||
--env CARGO_HOME=/cargo \
|
||||
--volume `rustc --print sysroot`:/rust:ro \
|
||||
--volume `pwd`:/checkout:ro \
|
||||
|
@ -111,7 +111,11 @@ case "$TARGET" in
|
||||
# https://issues.jenkins-ci.org/browse/JENKINS-26930?focusedCommentId=230791&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-230791
|
||||
export SHELL=/bin/dash
|
||||
arch=$(echo $TARGET | cut -d- -f1)
|
||||
emulator @$arch -no-window -no-accel &
|
||||
accel="-no-accel"
|
||||
if emulator -accel-check; then
|
||||
accel=""
|
||||
fi
|
||||
emulator @$arch -no-window $accel &
|
||||
adb wait-for-device
|
||||
adb push $CARGO_TARGET_DIR/$TARGET/debug/libc-test /data/local/tmp/libc-test
|
||||
adb shell /data/local/tmp/libc-test 2>&1 | tee /tmp/out
|
||||
|
Loading…
Reference in New Issue
Block a user