1.cross_system_build_job:
2  extends: .base_job_template
3  stage: build
4  image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
5  cache:
6    paths:
7      - ccache
8    key: "$CI_JOB_NAME"
9    when: always
10  timeout: 80m
11  before_script:
12    - source scripts/ci/gitlab-ci-section
13    - section_start setup "Pre-script setup"
14    - JOBS=$(expr $(nproc) + 1)
15    - cat /packages.txt
16    - section_end setup
17  script:
18    - export CCACHE_BASEDIR="$(pwd)"
19    - export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
20    - export CCACHE_MAXSIZE="500M"
21    - export PATH="$CCACHE_WRAPPERSDIR:$PATH"
22    - mkdir build
23    - cd build
24    - ccache --zero-stats
25    - section_start configure "Running configure"
26    - ../configure --enable-werror --disable-docs --enable-fdt=system
27        --disable-user $QEMU_CONFIGURE_OPTS $EXTRA_CONFIGURE_OPTS
28        --target-list-exclude="arm-softmmu
29          i386-softmmu microblaze-softmmu mips-softmmu mipsel-softmmu
30          mips64-softmmu ppc-softmmu riscv32-softmmu sh4-softmmu
31          sparc-softmmu xtensa-softmmu $CROSS_SKIP_TARGETS"
32    - section_end configure
33    - section_start build "Building QEMU"
34    - make -j"$JOBS" all check-build
35    - section_end build
36    - section_start test "Running tests"
37    - if test -n "$MAKE_CHECK_ARGS";
38      then
39        $MAKE -j"$JOBS" $MAKE_CHECK_ARGS ;
40      fi
41    - section_end test
42    - section_start installer "Building the installer"
43    - if grep -q "EXESUF=.exe" config-host.mak;
44      then make installer;
45      version="$(git describe --match v[0-9]* 2>/dev/null || git rev-parse --short HEAD)";
46      mv -v qemu-setup*.exe qemu-setup-${version}.exe;
47      fi
48    - section_end installer
49    - ccache --show-stats
50
51# Job to cross-build specific accelerators.
52#
53# Set the $ACCEL variable to select the specific accelerator (default to
54# KVM), and set extra options (such disabling other accelerators) via the
55# $EXTRA_CONFIGURE_OPTS variable.
56.cross_accel_build_job:
57  extends: .base_job_template
58  stage: build
59  image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
60  timeout: 30m
61  cache:
62    paths:
63      - ccache/
64    key: "$CI_JOB_NAME"
65  before_script:
66    - source scripts/ci/gitlab-ci-section
67    - JOBS=$(expr $(nproc) + 1)
68  script:
69    - export CCACHE_BASEDIR="$(pwd)"
70    - export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
71    - export CCACHE_MAXSIZE="500M"
72    - export PATH="$CCACHE_WRAPPERSDIR:$PATH"
73    - mkdir build
74    - cd build
75    - section_start configure "Running configure"
76    - ../configure --enable-werror --disable-docs $QEMU_CONFIGURE_OPTS
77        --disable-tools --enable-${ACCEL:-kvm} $EXTRA_CONFIGURE_OPTS
78    - section_end configure
79    - section_start build "Building QEMU"
80    - make -j"$JOBS" all check-build
81    - section_end build
82    - section_start test "Running tests"
83    - if test -n "$MAKE_CHECK_ARGS";
84      then
85        $MAKE -j"$JOBS" $MAKE_CHECK_ARGS ;
86      fi
87    - section_end test
88
89.cross_user_build_job:
90  extends: .base_job_template
91  stage: build
92  image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
93  cache:
94    paths:
95      - ccache/
96    key: "$CI_JOB_NAME"
97  before_script:
98    - source scripts/ci/gitlab-ci-section
99    - JOBS=$(expr $(nproc) + 1)
100  script:
101    - export CCACHE_BASEDIR="$(pwd)"
102    - export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
103    - export CCACHE_MAXSIZE="500M"
104    - mkdir build
105    - cd build
106    - section_start configure "Running configure"
107    - ../configure --enable-werror --disable-docs $QEMU_CONFIGURE_OPTS
108        --disable-system --target-list-exclude="aarch64_be-linux-user
109          alpha-linux-user m68k-linux-user microblazeel-linux-user
110          or1k-linux-user ppc-linux-user sparc-linux-user
111          xtensa-linux-user $CROSS_SKIP_TARGETS"
112    - section_end configure
113    - section_start build "Building QEMU"
114    - make -j"$JOBS" all check-build
115    - section_end build
116    - section_start test "Running tests"
117    - if test -n "$MAKE_CHECK_ARGS";
118      then
119        $MAKE -j"$JOBS" $MAKE_CHECK_ARGS ;
120      fi
121    - section_end test
122
123# We can still run some tests on some of our cross build jobs. They can add this
124# template to their extends to save the build logs and test results
125.cross_test_artifacts:
126  artifacts:
127    name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
128    when: always
129    expire_in: 7 days
130    paths:
131      - build/meson-logs/testlog.txt
132    reports:
133      junit: build/meson-logs/testlog.junit.xml
134