docker: check out minijail in expected location
Move the minijail source checkout location in the Dockerfile so that it
is in the expected place relative to the crosvm checkout so that Docker
(and kokoro) can successfully find it.
Also update Cargo.lock for the new minijail-sys dependency; this fixes
"read-only filesystem" errors from cargo running inside Docker when it
tries to write the updated Cargo.lock.
BUG=None
TEST=docker/build_crosvm_base.sh && docker/wrapped_smoke_test.sh
Change-Id: Ic399030004c2c4891a03a60474348b0bed9f01d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2062675
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
diff --git a/Cargo.lock b/Cargo.lock
index 1aea075..0ec0a39 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -106,6 +106,7 @@
"kvm_sys 0.1.0",
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
"libcras 0.1.0",
+ "minijail-sys 0.0.11",
"msg_socket 0.1.0",
"net_util 0.1.0",
"p9 0.1.0",
@@ -240,7 +241,7 @@
version = "0.1.0"
dependencies = [
"libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
- "net_sys 0.1.0",
+ "minijail-sys 0.0.11",
]
[[package]]
@@ -311,6 +312,14 @@
]
[[package]]
+name = "minijail-sys"
+version = "0.0.11"
+dependencies = [
+ "libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
name = "msg_on_socket_derive"
version = "0.1.0"
dependencies = [
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 41d755a..fecc31d 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -59,12 +59,6 @@
# Used /scratch for building dependencies which are too new or don't exist on Debian stretch.
WORKDIR /scratch
-# minijail does not exist in upstream linux distros.
-RUN git clone https://android.googlesource.com/platform/external/minijail \
- && cd minijail \
- && make -j$(nproc) \
- && cp libminijail.so /usr/lib/x86_64-linux-gnu/
-
# New libepoxy and libdrm-dev requires newer meson than is in Debian stretch.
ARG MESON_COMMIT=master
RUN git clone https://github.com/mesonbuild/meson \
@@ -147,6 +141,14 @@
RUN mkdir -p $THIRD_PARTY_ROOT
ENV PLATFORM_ROOT=$CROS_ROOT/platform
RUN mkdir -p $PLATFORM_ROOT
+ENV AOSP_EXTERNAL_ROOT=$CROS_ROOT/aosp/external
+RUN mkdir -p $AOSP_EXTERNAL_ROOT
+
+# minijail does not exist in upstream linux distros.
+RUN git clone https://android.googlesource.com/platform/external/minijail $AOSP_EXTERNAL_ROOT/minijail \
+ && cd $AOSP_EXTERNAL_ROOT/minijail \
+ && make -j$(nproc) \
+ && cp libminijail.so /usr/lib/x86_64-linux-gnu/
# Pull the cras library for audio access.
ARG ADHD_COMMIT=master