From patchwork Sun Apr 5 19:22:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 26432 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 BAADCBDCBD for ; Sun, 5 Apr 2026 19:22:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 672C462D95; Sun, 5 Apr 2026 21:22:21 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="gLKN3PYM"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id EDA3D62D79 for ; Sun, 5 Apr 2026 21:22:17 +0200 (CEST) Received: from killaraus.ideasonboard.com (2001-14ba-703d-e500--2a1.rev.dnainternet.fi [IPv6:2001:14ba:703d:e500::2a1]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id C26CE144E for ; Sun, 5 Apr 2026 21:20:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1775416851; bh=MIADzk8QKh9Z9dKulSHBn+rUc0k1quqkdSIMEo1Lw08=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gLKN3PYM9LuPLWMKjFsOnxABJFz+ldBbP3BvjEZ8PxDt4u8VlMVGjTP13UCNCz5vb VwkUXdAPOz450ch6+2Nt1bUnDfl+iiioisy7sWX/j50HmHecfUcbb5cLmMl/TjHJbv qoy3E40ZE+X1OTiF8wgYzp+tg2MA2cB5Dxae16NY= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [libcamera-ci] [PATCH 4/4] Add lint job to check licenses Date: Sun, 5 Apr 2026 22:22:08 +0300 Message-ID: <20260405192211.1210985-5-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260405192211.1210985-1-laurent.pinchart@ideasonboard.com> References: <20260405192211.1210985-1-laurent.pinchart@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" libcamera uses REUSE to hhelp with license compliance. Every file in the source tree is required to have an SPDX license identifier, directly within the file or through REUSE.toml. Add a lint job that verifies this using the reuse lint tool. We need to add SPDX license identifiers to the meson native files as they are being copied to the source tree and the reuse tool doesn't have an option to specify files to ignore. For the same reason, remove the .work/ci-config/ directory after setting up the build environment. Signed-off-by: Laurent Pinchart --- .gitlab-ci/lint-reuse.sh | 26 ++++++++++++++++++++++++++ .gitlab-ci/meson/libc++.native | 2 ++ .gitlab-ci/meson/libstdc++.native | 2 ++ .gitlab-ci/setup-container.sh | 2 +- gitlab-ci.yml | 15 ++++++++++++++- 5 files changed, 45 insertions(+), 2 deletions(-) create mode 100755 .gitlab-ci/lint-reuse.sh diff --git a/.gitlab-ci/lint-reuse.sh b/.gitlab-ci/lint-reuse.sh new file mode 100755 index 000000000000..2439d47d2c78 --- /dev/null +++ b/.gitlab-ci/lint-reuse.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# SPDX-License-Identifier: GPL-2.0-or-later +# SPDX-FileCopyrightText: © 2026 Laurent Pinchart +# +# Verify that every file contains a valid license + +set -e + +source "$(dirname "$0")/lib.sh" + +libcamera_reuse() { + echo "Running reuse for $CI_COMMIT_REF_NAME ($CI_COMMIT_SHA)" + + local files=$(reuse lint -j | jq -r '.non_compliant.missing_licensing_info[]') + + if [ -n "$files" ] ; then + echo "The following files are missing license information:" + echo "$files" + exit 1 + fi + + echo "All files contain license information" +} + +run libcamera_reuse diff --git a/.gitlab-ci/meson/libc++.native b/.gitlab-ci/meson/libc++.native index 9c99d5a7f8b2..c850a20b6903 100644 --- a/.gitlab-ci/meson/libc++.native +++ b/.gitlab-ci/meson/libc++.native @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: CC0-1.0 + [built-in options] cpp_args = ['-stdlib=libc++'] cpp_link_args = ['-stdlib=libc++'] diff --git a/.gitlab-ci/meson/libstdc++.native b/.gitlab-ci/meson/libstdc++.native index 3116043fc116..e7b596e76089 100644 --- a/.gitlab-ci/meson/libstdc++.native +++ b/.gitlab-ci/meson/libstdc++.native @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: CC0-1.0 + [built-in options] cpp_args = ['-stdlib=libstdc++'] cpp_link_args = ['-stdlib=libstdc++'] diff --git a/.gitlab-ci/setup-container.sh b/.gitlab-ci/setup-container.sh index 103cc61169c3..64cb7f2b9abe 100755 --- a/.gitlab-ci/setup-container.sh +++ b/.gitlab-ci/setup-container.sh @@ -133,7 +133,7 @@ case $FDO_DISTRIBUTION_VERSION in texlive-latex-extra ) # Tools requires by the lint jobs. - PKGS_LIBCAMERA_RUNTIME+=( clang-format python3-autopep8 shellcheck ) + PKGS_LIBCAMERA_RUNTIME+=( clang-format jq python3-autopep8 reuse shellcheck ) # libclang-rt-dev for the clang ASan runtime. PKGS_LIBCAMERA_RUNTIME_MULTIARCH+=( libclang-rt-19-dev ) # For the Android camera HAL and the virtual pipeline handler. diff --git a/gitlab-ci.yml b/gitlab-ci.yml index 6679cf853c7a..96dc7600c9b1 100644 --- a/gitlab-ci.yml +++ b/gitlab-ci.yml @@ -74,7 +74,7 @@ include: .libcamera-ci.debian:13: variables: FDO_DISTRIBUTION_VERSION: 'trixie' - FDO_DISTRIBUTION_TAG: '2026-04-05.0' + FDO_DISTRIBUTION_TAG: '2026-04-05.1' .container-debian: extends: @@ -122,6 +122,7 @@ container-debian:13: - LIBCAMERA_CI_URL="${CI_SERVER_URL}/${CI_CONFIG_PATH/*@/}" - git clone --depth 1 --single-branch $LIBCAMERA_CI_URL .work/ci-config - mv .work/ci-config/.gitlab-ci/ $CI_PROJECT_DIR + - rm -rf .work/ci-config/ # # Build libcamera with a different compilers, using stock Debian images to @@ -305,6 +306,18 @@ build-package:debug: # Lint stage - Run checkstyle.py and check merge suitability # ------------------------------------------------------------------------------ +license: + extends: + - .fdo.distribution-image@debian + - .libcamera-ci.debian:13 + - .libcamera-ci.scripts + stage: lint + needs: + - job: container-debian:13 + artifacts: false + script: + - $CI_PROJECT_DIR/.gitlab-ci/lint-reuse.sh + lint: extends: - .fdo.distribution-image@debian