build-unit-test-docker: Build third-party packages early
Otherwise we have to rebuild them for each change we make to any of the
openbmc libraries we build. This is unnecessary since they don't depend
on our libraries. It also fixes any ordering issues when our libraries
depend on the third-party packages.
Change-Id: I7cd136013c65405f3add1190feb6903584f5a210
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/build-unit-test-docker.sh b/build-unit-test-docker.sh
index 28b8c23..8051f80 100755
--- a/build-unit-test-docker.sh
+++ b/build-unit-test-docker.sh
@@ -172,6 +172,27 @@
RUN tar --bzip2 -xf boost_1_66_0.tar.bz2
RUN cp -a -r boost_1_66_0/boost /usr/include
+# version from meta-openembedded/meta-oe/recipes-support/libtinyxml2/libtinyxml2_5.0.1.bb
+RUN curl -L -o tinyxml2.tar.gz https://github.com/leethomason/tinyxml2/archive/37bc3aca429f0164adf68c23444540b4a24b5778.tar.gz && \
+tar -xzf tinyxml2.tar.gz && \
+cd tinyxml2-3* && \
+mkdir build && \
+cd build && \
+cmake .. && \
+make -j$(nproc) && \
+make install
+
+# Fetch, build, and install latest libvncserver because obmc-ikvm requires a recent commit
+# (libvncserver commit dd873fce451e4b7d7cc69056a62e107aae7c8e7a). This won't be included in any
+# respository packages for some time.
+RUN git clone https://github.com/LibVNC/libvncserver && \
+cd libvncserver && \
+mkdir build && \
+cd build && \
+cmake -DWITH_PNG=OFF .. && \
+make -j$(nproc) && \
+make install
+
RUN grep -q ${GROUPS} /etc/group || groupadd -g ${GROUPS} ${USER}
RUN mkdir -p $(dirname ${HOME})
RUN grep -q ${UID} /etc/passwd || useradd -d ${HOME} -m -u ${UID} -g ${GROUPS} ${USER}
@@ -227,16 +248,6 @@
make -j$(nproc) && \
make install
-# version from meta-openembedded/meta-oe/recipes-support/libtinyxml2/libtinyxml2_5.0.1.bb
-RUN curl -L -o tinyxml2.tar.gz https://github.com/leethomason/tinyxml2/archive/37bc3aca429f0164adf68c23444540b4a24b5778.tar.gz && \
-tar -xzf tinyxml2.tar.gz && \
-cd tinyxml2-3* && \
-mkdir build && \
-cd build && \
-cmake .. && \
-make -j$(nproc) && \
-make install
-
RUN git clone https://github.com/openbmc/phosphor-objmgr && \
cd phosphor-objmgr && \
./bootstrap.sh && \
@@ -244,17 +255,6 @@
make -j$(nproc) && \
make install
-# Fetch, build, and install latest libvncserver because obmc-ikvm requires a recent commit
-# (libvncserver commit dd873fce451e4b7d7cc69056a62e107aae7c8e7a). This won't be included in any
-# respository packages for some time.
-RUN git clone https://github.com/LibVNC/libvncserver && \
-cd libvncserver && \
-mkdir build && \
-cd build && \
-cmake -DWITH_PNG=OFF .. && \
-make -j$(nproc) && \
-make install
-
RUN /bin/bash
EOF
)