This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch tlater/freedesktop
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit d7e7e668968cabba91feb086173ee783b4717d72
Author: Tristan Maat <[email protected]>
AuthorDate: Fri Jun 21 13:54:41 2019 +0100

    integration/base: Create freedesktop-sdk based base image
---
 tests/integration/base/elements/base.bst           |  5 ++
 .../integration/base/elements/freedesktop-sdk.bst  |  9 +++
 tests/integration/base/generate-base.sh            | 68 +++-------------------
 tests/integration/base/project.conf                | 13 +++++
 4 files changed, 35 insertions(+), 60 deletions(-)

diff --git a/tests/integration/base/elements/base.bst 
b/tests/integration/base/elements/base.bst
new file mode 100644
index 0000000..697bf6b
--- /dev/null
+++ b/tests/integration/base/elements/base.bst
@@ -0,0 +1,5 @@
+kind: stack
+description: |
+  The provided base system
+depends:
+  - freedesktop-sdk.bst:public-stacks/buildsystems.bst
diff --git a/tests/integration/base/elements/freedesktop-sdk.bst 
b/tests/integration/base/elements/freedesktop-sdk.bst
new file mode 100644
index 0000000..f42306c
--- /dev/null
+++ b/tests/integration/base/elements/freedesktop-sdk.bst
@@ -0,0 +1,9 @@
+kind: junction
+sources:
+- kind: git
+  url: https://gitlab.com/freedesktop-sdk/freedesktop-sdk/
+  track: freedesktop-sdk-18.08.31.1-bst2
+  ref: 5c639b8d553016ea6c28ea160a572da2e189745e
+config:
+  options:
+    target_arch: '%{arch}'
diff --git a/tests/integration/base/generate-base.sh 
b/tests/integration/base/generate-base.sh
index 338c6d9..b3e4dbf 100755
--- a/tests/integration/base/generate-base.sh
+++ b/tests/integration/base/generate-base.sh
@@ -2,66 +2,14 @@
 
 # Generate a base sysroot for running the BuildStream integration tests.
 #
-# The sysroot is based off the Alpine Linux distribution. The script downloads
-# a release of Alpine, sets up a cheap container using `bwrap` and installs the
-# packages that are needed by the integration tests, then outputs a .tar.xz
-# file.
+# The sysroot is based on freedesktop-sdk; See the project for
+# details, this script only runs BuildStream and compresses the
+# output.
 
 set -eux
 
-ALPINE_ARCH=${ARCH:-x86-64}
-ALPINE_BASE=http://dl-cdn.alpinelinux.org/alpine/v3.7/releases/${ALPINE_ARCH}/alpine-minirootfs-3.7.0-${ALPINE_ARCH}.tar.gz
-
-mkdir root
-
-wget ${ALPINE_BASE} -O alpine-base.tar.gz
-
-tar -x -f ./alpine-base.tar.gz -C ./root --exclude dev/\*
-
-run() {
-    # This turns the unpacked rootfs into a container using Bubblewrap.
-    # The Alpine package manager (apk) calls `chroot` when running package
-    # triggers so we need to enable CAP_SYS_CHROOT. We also have to fake
-    # UID 0 (root) inside the container to avoid permissions errors.
-    bwrap --bind ./root / --dev /dev --proc /proc --tmpfs /tmp \
-          --ro-bind /etc/resolv.conf /etc/resolv.conf \
-          --setenv PATH "/usr/bin:/usr/sbin:/bin:/sbin" \
-          --unshare-user --uid 0 --gid 0 \
-          --cap-add CAP_SYS_CHROOT \
-          /bin/sh -c "$@"
-}
-
-# Enable testing repo for Tiny C Compiler package
-run "echo http://dl-cdn.alpinelinux.org/alpine/edge/testing >> 
/etc/apk/repositories"
-
-# Fetch the list of Alpine packages.
-run "apk update"
-
-# There are various random errors from `apk add` to do with ownership, probably
-# because of our hacked up `bwrap` container. The errors seem harmless so I am
-# just ignoring them.
-set +e
-
-# Install stuff needed by all integration tests that compile C code.
-#
-# Note that we use Tiny C Compiler in preference to GCC. There is a huge
-# size difference -- 600KB for TinyCC vs. 50MB to 100MB for GCC. TinyCC
-# supports most of the ISO C99 standard, but has no C++ support at all.
-run "apk add binutils libc-dev make tcc"
-run "ln -s /usr/bin/tcc /usr/bin/cc"
-
-# Install stuff for tests/integration/autotools
-run "apk add autoconf automake"
-
-# Install stuff for tests/integration/cmake
-run "apk add cmake"
-
-# Install stuff for tests/integration/pip
-run "apk add python3"
-
-set -e
-
-# Cleanup the package cache
-run "rm -R /var/cache/apk"
-
-tar -c -v -J -f integration-tests-base.tar.xz -C root .
+bst -o arch "${ARCH:-x86_64}" build base.bst
+# FIXME: This should be replaced with the nice implicit compression
+# resolution that will be introduced with !1451
+bst -o arch "${ARCH:-x86_64}" artifact checkout base.bst --tar 
integration-tests-base.tar
+xz integration-tests-base.tar
diff --git a/tests/integration/base/project.conf 
b/tests/integration/base/project.conf
new file mode 100644
index 0000000..9efcdd4
--- /dev/null
+++ b/tests/integration/base/project.conf
@@ -0,0 +1,13 @@
+name: test-base
+element-path: elements
+
+options:
+  arch:
+    type: arch
+    description: Target architecture
+    variable: arch
+    values:
+      - arm
+      - aarch64
+      - i686
+      - x86_64

Reply via email to