2021-05-19 21:55:01 +03:00
|
|
|
.native_build_job_template:
|
2022-05-27 18:36:01 +03:00
|
|
|
extends: .base_job_template
|
2021-05-19 21:55:01 +03:00
|
|
|
stage: build
|
2023-06-08 19:40:14 +03:00
|
|
|
image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
|
2023-08-29 19:15:17 +03:00
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- ccache
|
|
|
|
key: "$CI_JOB_NAME"
|
|
|
|
when: always
|
2021-05-19 21:55:01 +03:00
|
|
|
before_script:
|
2024-09-18 15:54:49 +03:00
|
|
|
- source scripts/ci/gitlab-ci-section
|
|
|
|
- section_start setup "Pre-script setup"
|
2021-05-19 21:55:01 +03:00
|
|
|
- JOBS=$(expr $(nproc) + 1)
|
2024-07-29 17:44:02 +03:00
|
|
|
- cat /packages.txt
|
2024-09-18 15:54:49 +03:00
|
|
|
- section_end setup
|
2021-05-19 21:55:01 +03:00
|
|
|
script:
|
2023-08-29 19:15:17 +03:00
|
|
|
- export CCACHE_BASEDIR="$(pwd)"
|
|
|
|
- export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
|
|
|
|
- export CCACHE_MAXSIZE="500M"
|
|
|
|
- export PATH="$CCACHE_WRAPPERSDIR:$PATH"
|
2024-03-12 20:00:11 +03:00
|
|
|
- du -sh .git
|
2021-05-19 21:55:01 +03:00
|
|
|
- mkdir build
|
|
|
|
- cd build
|
2023-08-29 19:15:17 +03:00
|
|
|
- ccache --zero-stats
|
2024-09-18 15:54:49 +03:00
|
|
|
- section_start configure "Running configure"
|
2023-02-07 23:14:47 +03:00
|
|
|
- ../configure --enable-werror --disable-docs --enable-fdt=system
|
configure: use 'mkvenv ensure meson' to bootstrap meson
This commit changes how we detect and install meson. It notably removes
'--meson='.
Currently, configure creates a lightweight Python virtual environment
unconditionally using the user's configured $python that inherits system
packages. Temporarily, we forced the use of meson source present via git
submodule or in the release tarball.
With this patch, we restore the ability to use a system-provided meson:
If Meson is installed in the build venv and meets our minimum version
requirements, we will use that Meson. This includes a system provided
meson, which would be visible via system-site packages inside the venv.
In the event that Meson is installed but *not for the chosen Python
interpreter*, not found, or of insufficient version, we will attempt to
install Meson from vendored source into the newly created Python virtual
environment. This vendored installation replaces both the git submodule
and tarball source mechanisms for sourcing meson.
As a result of this patch, the Python interpreter we use for both our
own build scripts *and* Meson extensions are always known to be the
exact same Python. As a further benefit, there will also be a symlink
available in the build directory that points to the correct, configured
python and can be used by e.g. manual tests to invoke the correct,
configured Python unambiguously.
Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20230511035435.734312-18-jsnow@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2023-05-11 06:54:25 +03:00
|
|
|
${TARGETS:+--target-list="$TARGETS"}
|
2023-02-07 23:14:46 +03:00
|
|
|
$CONFIGURE_ARGS ||
|
|
|
|
{ cat config.log meson-logs/meson-log.txt && exit 1; }
|
2021-05-19 21:55:01 +03:00
|
|
|
- if test -n "$LD_JOBS";
|
|
|
|
then
|
configure: use 'mkvenv ensure meson' to bootstrap meson
This commit changes how we detect and install meson. It notably removes
'--meson='.
Currently, configure creates a lightweight Python virtual environment
unconditionally using the user's configured $python that inherits system
packages. Temporarily, we forced the use of meson source present via git
submodule or in the release tarball.
With this patch, we restore the ability to use a system-provided meson:
If Meson is installed in the build venv and meets our minimum version
requirements, we will use that Meson. This includes a system provided
meson, which would be visible via system-site packages inside the venv.
In the event that Meson is installed but *not for the chosen Python
interpreter*, not found, or of insufficient version, we will attempt to
install Meson from vendored source into the newly created Python virtual
environment. This vendored installation replaces both the git submodule
and tarball source mechanisms for sourcing meson.
As a result of this patch, the Python interpreter we use for both our
own build scripts *and* Meson extensions are always known to be the
exact same Python. As a further benefit, there will also be a symlink
available in the build directory that points to the correct, configured
python and can be used by e.g. manual tests to invoke the correct,
configured Python unambiguously.
Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20230511035435.734312-18-jsnow@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2023-05-11 06:54:25 +03:00
|
|
|
pyvenv/bin/meson configure . -Dbackend_max_links="$LD_JOBS" ;
|
2021-05-19 21:55:01 +03:00
|
|
|
fi || exit 1;
|
2024-09-18 15:54:49 +03:00
|
|
|
- section_end configure
|
|
|
|
- section_start build "Building QEMU"
|
2024-05-13 14:15:50 +03:00
|
|
|
- $MAKE -j"$JOBS"
|
2024-09-18 15:54:49 +03:00
|
|
|
- section_end build
|
|
|
|
- section_start test "Running tests"
|
2021-05-19 21:55:01 +03:00
|
|
|
- if test -n "$MAKE_CHECK_ARGS";
|
|
|
|
then
|
2024-05-13 14:15:50 +03:00
|
|
|
$MAKE -j"$JOBS" $MAKE_CHECK_ARGS ;
|
2021-05-19 21:55:01 +03:00
|
|
|
fi
|
2024-09-18 15:54:49 +03:00
|
|
|
- section_end test
|
2023-08-29 19:15:17 +03:00
|
|
|
- ccache --show-stats
|
2021-05-19 21:55:01 +03:00
|
|
|
|
2023-02-28 22:06:51 +03:00
|
|
|
# We jump some hoops in common_test_job_template to avoid
|
|
|
|
# rebuilding all the object files we skip in the artifacts
|
|
|
|
.native_build_artifact_template:
|
|
|
|
artifacts:
|
2023-06-30 21:03:46 +03:00
|
|
|
when: on_success
|
2023-02-28 22:06:51 +03:00
|
|
|
expire_in: 2 days
|
|
|
|
paths:
|
|
|
|
- build
|
|
|
|
- .git-submodule-status
|
|
|
|
exclude:
|
|
|
|
- build/**/*.p
|
|
|
|
- build/**/*.a.p
|
|
|
|
- build/**/*.c.o
|
|
|
|
- build/**/*.c.o.d
|
|
|
|
|
2022-05-09 15:41:34 +03:00
|
|
|
.common_test_job_template:
|
2022-05-27 18:36:01 +03:00
|
|
|
extends: .base_job_template
|
2021-05-19 21:55:01 +03:00
|
|
|
stage: test
|
2023-06-08 19:40:14 +03:00
|
|
|
image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
|
2021-05-19 21:55:01 +03:00
|
|
|
script:
|
2024-09-18 15:54:49 +03:00
|
|
|
- source scripts/ci/gitlab-ci-section
|
|
|
|
- section_start buildenv "Setting up to run tests"
|
2023-05-19 14:27:10 +03:00
|
|
|
- scripts/git-submodule.sh update roms/SLOF
|
2024-10-31 17:09:52 +03:00
|
|
|
- build/pyvenv/bin/meson subprojects download $(cd build/subprojects && echo *)
|
2021-05-19 21:55:01 +03:00
|
|
|
- cd build
|
|
|
|
- find . -type f -exec touch {} +
|
|
|
|
# Avoid recompiling by hiding ninja with NINJA=":"
|
2024-08-30 16:38:34 +03:00
|
|
|
# We also have to pre-cache the functional tests manually in this case
|
|
|
|
- if [ "x${QEMU_TEST_CACHE_DIR}" != "x" ]; then
|
|
|
|
$MAKE precache-functional ;
|
|
|
|
fi
|
2024-09-18 15:54:49 +03:00
|
|
|
- section_end buildenv
|
|
|
|
- section_start test "Running tests"
|
2024-05-13 14:15:50 +03:00
|
|
|
- $MAKE NINJA=":" $MAKE_CHECK_ARGS
|
2024-09-18 15:54:49 +03:00
|
|
|
- section_end test
|
2021-05-19 21:55:01 +03:00
|
|
|
|
2022-05-09 15:41:34 +03:00
|
|
|
.native_test_job_template:
|
|
|
|
extends: .common_test_job_template
|
|
|
|
artifacts:
|
|
|
|
name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
|
2023-06-30 21:03:46 +03:00
|
|
|
when: always
|
2022-05-09 15:41:34 +03:00
|
|
|
expire_in: 7 days
|
|
|
|
paths:
|
|
|
|
- build/meson-logs/testlog.txt
|
2022-05-27 18:35:33 +03:00
|
|
|
reports:
|
|
|
|
junit: build/meson-logs/testlog.junit.xml
|
2022-05-09 15:41:34 +03:00
|
|
|
|
2024-08-30 16:38:34 +03:00
|
|
|
.functional_test_job_template:
|
2022-05-09 15:41:34 +03:00
|
|
|
extends: .common_test_job_template
|
2021-05-19 21:55:01 +03:00
|
|
|
cache:
|
|
|
|
key: "${CI_JOB_NAME}-cache"
|
|
|
|
paths:
|
|
|
|
- ${CI_PROJECT_DIR}/avocado-cache
|
2024-08-30 16:38:34 +03:00
|
|
|
- ${CI_PROJECT_DIR}/functional-cache
|
2021-05-19 21:55:01 +03:00
|
|
|
policy: pull-push
|
|
|
|
artifacts:
|
|
|
|
name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
|
2023-06-30 21:03:46 +03:00
|
|
|
when: always
|
2021-05-25 07:46:56 +03:00
|
|
|
expire_in: 7 days
|
2021-05-19 21:55:01 +03:00
|
|
|
paths:
|
|
|
|
- build/tests/results/latest/results.xml
|
|
|
|
- build/tests/results/latest/test-results
|
2024-08-30 16:38:34 +03:00
|
|
|
- build/tests/functional/*/*/*.log
|
2021-05-19 21:55:01 +03:00
|
|
|
reports:
|
|
|
|
junit: build/tests/results/latest/results.xml
|
|
|
|
before_script:
|
|
|
|
- mkdir -p ~/.config/avocado
|
|
|
|
- echo "[datadir.paths]" > ~/.config/avocado/avocado.conf
|
|
|
|
- echo "cache_dirs = ['${CI_PROJECT_DIR}/avocado-cache']"
|
|
|
|
>> ~/.config/avocado/avocado.conf
|
|
|
|
- echo -e '[job.output.testlogs]\nstatuses = ["FAIL", "INTERRUPT"]'
|
|
|
|
>> ~/.config/avocado/avocado.conf
|
|
|
|
- if [ -d ${CI_PROJECT_DIR}/avocado-cache ]; then
|
2024-08-30 16:38:34 +03:00
|
|
|
du -chs ${CI_PROJECT_DIR}/*-cache ;
|
2021-05-19 21:55:01 +03:00
|
|
|
fi
|
|
|
|
- export AVOCADO_ALLOW_UNTRUSTED_CODE=1
|
2024-08-30 16:38:34 +03:00
|
|
|
- export QEMU_TEST_ALLOW_UNTRUSTED_CODE=1
|
|
|
|
- export QEMU_TEST_CACHE_DIR=${CI_PROJECT_DIR}/functional-cache
|
2021-05-19 21:55:01 +03:00
|
|
|
after_script:
|
|
|
|
- cd build
|
2024-08-30 16:38:34 +03:00
|
|
|
- du -chs ${CI_PROJECT_DIR}/*-cache
|
2022-05-27 18:36:01 +03:00
|
|
|
variables:
|
|
|
|
QEMU_JOB_AVOCADO: 1
|