From patchwork Mon Aug 18 12:11:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 24155 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 E8DC2BDCC1 for ; Mon, 18 Aug 2025 12:11:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DE6156925F; Mon, 18 Aug 2025 14:11:28 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="M+zxoGqK"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2342D69257 for ; Mon, 18 Aug 2025 14:11:27 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id CED1D1249 for ; Mon, 18 Aug 2025 14:10:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1755519030; bh=ICIutt3lmEx2ZZ89/ElbzUoR6w+9qQEHPKREIWrBx1Q=; h=From:To:Subject:Date:From; b=M+zxoGqKi6aMDSqVbZCt2Q0pTWOGgd3IAYJc6W6RlxtCaxXVHH8o1QFwA57xQ+LHD yVLb65bZv4srGp5xYf/Me3DyE56y+eMLtFYx1LT/SzNds9AXokPcVWJ23oXKqkXbHU CyX+yEymHwxLq/d8vUANYFvUExXVwHu6TrzdKP3g= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH 1/2] Documentation: Use python3 directly to check for doxylink version Date: Mon, 18 Aug 2025 15:11:02 +0300 Message-ID: <20250818121103.20073-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.49.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" When checking the version of the sphinxcontrib.doxylink module, the Python interpreter used by Sphinx must be used, as that's where the module will be imported from. Using the meson python_installation object for this purpose is incorrect, as it's meant to access the Python installation of the host machine, not the native Python interpreter on the host machine. Fix this by using python3 directly. Signed-off-by: Laurent Pinchart --- Documentation/meson.build | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) base-commit: af43c2f945c42cc7d111de63abed9ca3df830ca4 -- Regards, Laurent Pinchart diff --git a/Documentation/meson.build b/Documentation/meson.build index b898ba3a0b7e..163875014eec 100644 --- a/Documentation/meson.build +++ b/Documentation/meson.build @@ -124,12 +124,9 @@ if sphinx.found() # Many distributions do not provide a recent-enough version of the doxylink # module. This results in a build error with a cryptic message. Check the # version manually and print clear error messages. - py_mod = import('python') - py3 = py_mod.find_installation('python3') - mod = 'sphinxcontrib.doxylink' min_version = '>=1.6.1' - version = run_command(py3, '-c', + version = run_command('python3', '-c', 'import @0@ ; print(@0@.__version__)'.format(mod), check : false).stdout().strip() From patchwork Mon Aug 18 12:11:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 24156 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 7512DBDCC1 for ; Mon, 18 Aug 2025 12:11:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1F27C6925A; Mon, 18 Aug 2025 14:11:32 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="LQZXgEia"; 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 0039C69263 for ; Mon, 18 Aug 2025 14:11:29 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 9F2CB1249 for ; Mon, 18 Aug 2025 14:10:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1755519032; bh=CXmF1R+gh+w+tZyqtht9BK1JPDHkaAw2b4ypkfPxpho=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LQZXgEiaTVffC1MfXchFx8+slgMQ435MJ04aAL13BmRyqlRx2yjwdKsu51r71rsuy NOx7Sc0G3JF8wi3LmO4ra478Lg5kuy5siti3Du/1naXqKFamfTosLPMAp7zWt5Hx0i W0F9E2xPcl9Pcmu/310vZaChZ72LBWtbisU5N3CE= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH 2/2] meson: Check for Python modules manually Date: Mon, 18 Aug 2025 15:11:03 +0300 Message-ID: <20250818121103.20073-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.49.1 In-Reply-To: <20250818121103.20073-1-laurent.pinchart@ideasonboard.com> References: <20250818121103.20073-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" The meson python module's find_installation() method conveniently allows testing if the interpreter provides a set of modules. We use it to check for the presence of the modules required at build time. Unfortunately, the meson python module is not meant to access the native Python interpreter of the build machine, but the Python environment of the host machine. Usage of find_installation() for this purpose is incorrect, it may find modules in a different interpreter than the one used to run the build scripts that use those modules. Replace find_installation() with a manual check using python3 directly. Signed-off-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen --- meson.build | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index d82dbaeb99ce..5e015692a22c 100644 --- a/meson.build +++ b/meson.build @@ -287,9 +287,14 @@ run_command('ln', '-fsT', meson.project_source_root(), meson.project_build_root( configure_file(output : 'config.h', configuration : config_h) -# Check for python installation and modules. -py_mod = import('python') -py_mod.find_installation('python3', modules : py_modules) +# Check for python modules. +foreach module : py_modules + result = run_command('python3', '-c' , 'import @0@'.format(module), + capture : false, check : false) + if result.returncode() != 0 + error('Python module \'@0@\' not found'.format(module)) + endif +endforeach ## Summarise Configurations summary({