From patchwork Mon Dec 16 17:28:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 22367 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 07CE9C32F6 for ; Mon, 16 Dec 2024 17:28:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 242E767F8E; Mon, 16 Dec 2024 18:28:32 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="qkJd/fJR"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 44AA067F7D for ; Mon, 16 Dec 2024 18:28:31 +0100 (CET) Received: from pb-laptop.local (185.221.140.157.nat.pool.zt.hu [185.221.140.157]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 75DC9675; Mon, 16 Dec 2024 18:27:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1734370074; bh=xvs8tRgIUlKtM8w4KWlWl3txd5DLK4YPHmsjgQl+i58=; h=From:To:Cc:Subject:Date:From; b=qkJd/fJRHklJ3SVAzxcPjKLiriBWgteMLOaMF8NDstgKI6Ngno43WFzQODwVEQHbn Adz9aqPrtw57gwv3SJmzvma4j9KtYBogsXEoCcasJ65E9wslJ4+EecCMLtkUvPqBTM 3P5N+YfIGa89eCbJl53nhKgNvMTWPT0wvSqzzIq4= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Laurent Pinchart Subject: [libcamera-ci] [RFC PATCH v2 1/4] Enable `UDMABUF` in the kernel Date: Mon, 16 Dec 2024 18:28:24 +0100 Message-ID: <20241216172827.1055088-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This is necessary to test `DmaBufAllocator`, as well as the "virtual" pipeline handler since it uses the former to allocate buffers in `PipelineHandler::exportFrameBuffers()`. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart --- .gitlab-ci/build-kernel.sh | 1 + gitlab-ci.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) -- 2.47.1 diff --git a/.gitlab-ci/build-kernel.sh b/.gitlab-ci/build-kernel.sh index f413693..569f3db 100755 --- a/.gitlab-ci/build-kernel.sh +++ b/.gitlab-ci/build-kernel.sh @@ -51,6 +51,7 @@ kernel_config() { VIDEO_VIM2M VIDEO_VIMC VIDEO_VIVID + UDMABUF ) ./scripts/config ${disable[@]/#/--disable } diff --git a/gitlab-ci.yml b/gitlab-ci.yml index 601759c..6d26680 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -65,7 +65,7 @@ include: .libcamera-ci.debian:12: variables: FDO_DISTRIBUTION_VERSION: 'bookworm' - FDO_DISTRIBUTION_TAG: '2024-11-05.1' + FDO_DISTRIBUTION_TAG: '2024-12-12.1' .libcamera-ci.debian:13: variables: From patchwork Mon Dec 16 17:28:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 22368 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 93C70C32F6 for ; Mon, 16 Dec 2024 17:28:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4391C67F95; Mon, 16 Dec 2024 18:28:35 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="NIu74Zmh"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7310D67F7F for ; Mon, 16 Dec 2024 18:28:31 +0100 (CET) Received: from pb-laptop.local (185.221.140.157.nat.pool.zt.hu [185.221.140.157]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BDF4F82A for ; Mon, 16 Dec 2024 18:27:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1734370074; bh=K5jzOiQ0mOX27CPVBBwEqYSAJTJ9U9L6SiGcjNk13/Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NIu74ZmhTtLAWkBVTyDUMTqDGGrMFAJWm7x42m+A+m0+QDPuRBSlnBIrU0RceoG+/ mFl+5H31Dm7kCJPfnUK0Runm1399yJuyanfa7hiavqCzbEmfgpmY2ohtOxX0Lw4Tmr sMC3kdo8tC5/MfvF51+jkAH1UDqYQUrRJ9YgJ2lA= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [libcamera-ci] [RFC PATCH v2 2/4] Add `libevent` runtime libraries to the container Date: Mon, 16 Dec 2024 18:28:25 +0100 Message-ID: <20241216172827.1055088-2-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241216172827.1055088-1-barnabas.pocze@ideasonboard.com> References: <20241216172827.1055088-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" `libevent` is needed for some components, specifically `cam` and `lc-compliance`. Installing `libevent-dev` would be more convenient, but it is not doable at the moment because that package is not multiarch compatible. So only install the necessary runtime libraries. Build jobs already install `libevent-dev` when necessary before building libcamera, but this change enables the aforementioned components to be usable in different jobs as well. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart --- .gitlab-ci/setup-container.sh | 3 +++ gitlab-ci.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) -- 2.47.1 diff --git a/.gitlab-ci/setup-container.sh b/.gitlab-ci/setup-container.sh index d2909c7..0658368 100755 --- a/.gitlab-ci/setup-container.sh +++ b/.gitlab-ci/setup-container.sh @@ -103,6 +103,9 @@ case $FDO_DISTRIBUTION_VERSION in 'bookworm') # libclang-rt-dev for the clang ASan runtime. PKGS_LIBCAMERA_RUNTIME_MULTIARCH+=( libclang-rt-dev ) + # For cam and lc-compliance + # libevent-dev cannot be used here, see build-libcamera-common.sh + PKGS_LIBCAMERA_RUNTIME_MULTIARCH+=( libevent-2.1-7 libevent-pthreads-2.1-7 ) ;; 'trixie') # gcc 13 to expand compilation testing coverage. diff --git a/gitlab-ci.yml b/gitlab-ci.yml index 6d26680..f679d6e 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -65,7 +65,7 @@ include: .libcamera-ci.debian:12: variables: FDO_DISTRIBUTION_VERSION: 'bookworm' - FDO_DISTRIBUTION_TAG: '2024-12-12.1' + FDO_DISTRIBUTION_TAG: '2024-12-16.1' .libcamera-ci.debian:13: variables: From patchwork Mon Dec 16 17:28:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 22369 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 98093C32F6 for ; Mon, 16 Dec 2024 17:28:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C6F5B67F98; Mon, 16 Dec 2024 18:28:36 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Li+SfXog"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A252367F86 for ; Mon, 16 Dec 2024 18:28:31 +0100 (CET) Received: from pb-laptop.local (185.221.140.157.nat.pool.zt.hu [185.221.140.157]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 04440A30 for ; Mon, 16 Dec 2024 18:27:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1734370075; bh=qjcZZsQRKwIh8STQQCRKNhHCE4RM9YDkzGUVtjEtpuM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Li+SfXogrWERDxXgYg2+DrB9G97vOreALrM/ohbqu4ZZ394vIo9T/0PZHQ5SN8Rtr +kbm/d5dernpFEGJ7Edz3Xi37at76RGK9j9UTZ2SzubzCMZXvKkXpRh26FeAKbZBhZ dmY43IocjBRqrl92Y1RqoN8BENpfD1/C3PtvgnzY= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [libcamera-ci] [RFC PATCH v2 3/4] Add `build-package:debug` job Date: Mon, 16 Dec 2024 18:28:26 +0100 Message-ID: <20241216172827.1055088-3-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241216172827.1055088-1-barnabas.pocze@ideasonboard.com> References: <20241216172827.1055088-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a new job named `build-package:debug`, whose purpose is to create a build of libcamera with debugging additions (ASAN, UBSAN, STL checks), and then to publish the resulting package as an artifact for other jobs to use. Signed-off-by: Barnabás Pőcze --- gitlab-ci.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) -- 2.47.1 diff --git a/gitlab-ci.yml b/gitlab-ci.yml index f679d6e..0a3eab3 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -305,6 +305,39 @@ build-package:cros: reports: dotenv: env +build-package:debug: + extends: + - .fdo.distribution-image@debian + - .libcamera-ci.debian:12 + - .libcamera-ci.scripts + stage: build + needs: + - job: container-debian:12 + artifacts: false + script: + - $CI_PROJECT_DIR/.gitlab-ci/build-libcamera.sh + - $CI_PROJECT_DIR/.gitlab-ci/package-libcamera.sh + artifacts: + name: libcamera-debug-${ARCH}-${CI_COMMIT_SHA} + when: always + expire_in: 1 week + paths: + - build/meson-logs/ + - libcamera-${CI_COMMIT_SHA}.tar.xz + variables: + BUILD_TYPE: debug + MESON_OPTIONS: >- + -D auto_features=disabled + -D test=false + -D v4l2=false + -D b_sanitize=address,undefined + -D cpp_debugstl=true + -D pipelines=[] + parallel: + matrix: + - ARCH: amd64 + + # ------------------------------------------------------------------------------ # Lint stage - Run checkstyle.py and check merge suitability # ------------------------------------------------------------------------------ From patchwork Mon Dec 16 17:28:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 22370 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id CF614C32FB for ; Mon, 16 Dec 2024 17:28:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C3D4A67F92; Mon, 16 Dec 2024 18:28:37 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="SktQxWMt"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D388267F7D for ; Mon, 16 Dec 2024 18:28:31 +0100 (CET) Received: from pb-laptop.local (185.221.140.157.nat.pool.zt.hu [185.221.140.157]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 401B0675 for ; Mon, 16 Dec 2024 18:27:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1734370075; bh=P3YUOcPU7wQ3BmBT8SXodHqOLy92Olu6970g9utG01Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SktQxWMtxsx+SaSwHyKnQjFVQ5alsnUU+CxU3R9Tu8Z3eyPLRgJi8L1BALRrE9ue8 YG5HGpDIlwyITppkMKRrOdVkQofkjbC7VFDbGuS/6zxVeELLJQsiCIPNdsrLFZWsY6 Vg3xCDsqhDEN0H8DDbRRxokyuvJdZ4xSZ84BrDk0= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [libcamera-ci] [RFC PATCH v2 4/4] Add job to run lc-compliance on the virtual pipeline handler Date: Mon, 16 Dec 2024 18:28:27 +0100 Message-ID: <20241216172827.1055088-4-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241216172827.1055088-1-barnabas.pocze@ideasonboard.com> References: <20241216172827.1055088-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a new job named `lc-compliance:virtual` that uses the build artifacts created by the `build-package:debug` job on amd64 to run `lc-compliance` on the "Virtual0" camera in a virtual machine. The `force_fallback_for=gtest` option is needed because `cpp_debustl` makes ABI incompatible changes in the STL containers, so googletest also needs to be compiled with these changes. Signed-off-by: Barnabás Pőcze --- Changes in v2: * publish lc-compliance results to gitlab * add and use script to install libcamera binary package --- .gitlab-ci/test-lc-compliance.sh | 37 +++++++++++++++++++++++++++++++ .gitlab-ci/unpackage-libcamera.sh | 17 ++++++++++++++ gitlab-ci.yml | 24 +++++++++++++++++++- 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100755 .gitlab-ci/test-lc-compliance.sh create mode 100755 .gitlab-ci/unpackage-libcamera.sh -- 2.47.1 diff --git a/.gitlab-ci/test-lc-compliance.sh b/.gitlab-ci/test-lc-compliance.sh new file mode 100755 index 0000000..a927f1d --- /dev/null +++ b/.gitlab-ci/test-lc-compliance.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# SPDX-License-Identifier: GPL-2.0-or-later +# SPDX-FileCopyrightText: © 2024 Google Inc. + +set -e + +source "$(dirname "$0")/lib.sh" + +libcamera_compliance() { + echo "Running libcamera compliance tests in a qemu VM" + + virtme-ng \ + --verbose \ + --skip-modules \ + --force-9p \ + --rwdir "$PWD/build" \ + --run /opt/linux/bzImage \ + --exec "\ + LIBCAMERA_LOG_LEVELS=*:DEBUG \ + ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 \ + UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 \ + GTEST_OUTPUT=xml:./build/lc-compliance-report.xml \ + lc-compliance -c Virtual0; \ + echo \\\$? > ./build/.test-status \ + " + + local status=$(cat build/.test-status) + echo "Test result exit state: $status" + rm build/.test-status + + if [[ $status != 0 ]] ; then + exit $status + fi +} + +run libcamera_compliance diff --git a/.gitlab-ci/unpackage-libcamera.sh b/.gitlab-ci/unpackage-libcamera.sh new file mode 100755 index 0000000..9eb3192 --- /dev/null +++ b/.gitlab-ci/unpackage-libcamera.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# SPDX-License-Identifier: GPL-2.0-or-later +# SPDX-FileCopyrightText: © 2024 Google Inc. + +set -e + +source "$(dirname "$0")/lib.sh" + +libcamera_unpackage() { + echo "Unpackage libcamera binaries" + + tar -xvf libcamera-${CI_COMMIT_SHA}.tar.xz -C / + ldconfig -v +} + +run libcamera_unpackage diff --git a/gitlab-ci.yml b/gitlab-ci.yml index 0a3eab3..8ea1d12 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -328,11 +328,13 @@ build-package:debug: BUILD_TYPE: debug MESON_OPTIONS: >- -D auto_features=disabled + -D lc-compliance=enabled -D test=false -D v4l2=false -D b_sanitize=address,undefined -D cpp_debugstl=true - -D pipelines=[] + -D pipelines=['virtual'] + -D force_fallback_for=['gtest'] parallel: matrix: - ARCH: amd64 @@ -440,3 +442,23 @@ test-unit: # artifacts: # reports: # junit: build/meson-logs/testlog.junit.xml + +lc-compliance:virtual: + extends: + - .fdo.distribution-image@debian + - .libcamera-ci.debian:12 + - .libcamera-ci.scripts + stage: test + needs: + - job: build-package:debug + parallel: + matrix: + - ARCH: amd64 + tags: + - kvm + script: + - $CI_PROJECT_DIR/.gitlab-ci/unpackage-libcamera.sh + - $CI_PROJECT_DIR/.gitlab-ci/test-lc-compliance.sh + artifacts: + reports: + junit: build/lc-compliance-report.xml