From patchwork Fri Dec 27 11:22:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4022 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:998b:b0:5e7:b9eb:58e8 with SMTP id d11csp6149680mav; Fri, 27 Dec 2024 03:23:14 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXkHImlH/T+lvsTbK4ROaPNcJc4soUNvSKe6U2vxvpRyka4zLQlyKwbUh9PY0DgPmMoCD8s0XRDrkk=@openvpn.net X-Google-Smtp-Source: AGHT+IFWmKEUUeiUnEU1UpojKsLEc4IPuRKO1tKdDV+ZfOT01cPysky61TaWvfJJ8gxBZhI1YwvF X-Received: by 2002:a05:6830:4122:b0:71d:4bf0:aafb with SMTP id 46e09a7af769-720ff806350mr14147674a34.15.1735298593975; Fri, 27 Dec 2024 03:23:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735298593; cv=none; d=google.com; s=arc-20240605; b=fs2HSUvj1PbuEIMW6OV5PltinKW1z4vgTHfp2PahTVMFfb5LFxjr78xDuL0wj5Ok4H Yvozbim3wax/qi9tUTo1Ko60SLHzoN7MeJcREUgbAMx8ON97Af844Ba9tBRaMmBvla58 7mrKhND5zF9vJWSyeLecCOcLg6jkQhKKgqVbAg28vTvBxfhAfmwALgji9wEkX1aAeoO6 DBSWcr16p497sdzVdszm1nyq+XapnOe1cytqKuBpz4cFzmehLtkqIZON78lHgeIULVW1 RWCtezz+ThTgi4s5cM9zFhmB3/zKqvGvDjQtV+6WQrW6YK91QRUw6mhIRFXEWqv++WmP J3Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature; bh=nDIpa+yqx+v6ygjy+NJEye2mzhId0LvXys/B2+3xKi4=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=YWq35oATMExvSscD+nfzb5h7PSOPbW+9Bd4AOwMvEsxBmJrAWedzrwTn9RZ1S3XdL1 ronNjCp307ZGs3SazQ9VeIBvVxYHqbKTRewpN5GFQOkUypXCQa7D1yBlIDZYYkq6ijKJ u2BOYHmGida8X42dBbaMFJvivhxlEh/fChZnsiBT8cAF5fh/KQ6roKT6xIAE5AJuTzeu /4IPXbI0nB4PBiQpYq0x7D+bOqvLjwraofjEpofqL5B/ILxv0NaVAQIWDLI+gJvYdGU2 5YtVnyR2klTDecRlxTuJsSbj7mYN3mAZYmceIqzNtcEFgqWP/qUHBt4YccfzvzjLDd37 PFKw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=eqkzw+Df; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=XMllsL6W; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 46e09a7af769-71fc9a0fd6bsi10390360a34.200.2024.12.27.03.23.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Dec 2024 03:23:13 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=eqkzw+Df; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=XMllsL6W; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tR8Qx-00018B-SZ; Fri, 27 Dec 2024 11:23:11 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tR8Qp-00017y-R4 for openvpn-devel@lists.sourceforge.net; Fri, 27 Dec 2024 11:23:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=8Wb2LI3kMgnxWeW6SxOhgnpezLcbZVcxrZ3kBZrRA+s=; b=eqkzw+Df8AakPp5WXLZ2awFK0+ pMRLE/5xg7Uj/AaYz6UwUAgiOUVfqvVP8FWilBWuvHnibB1iVg1aif3hgE0euWuTkE/oE1X2xqBlK gmA8xn2g6DYoLdI87lR7LXeddRtB7a39SAnrzsueWTkH2C4xJNx5Y1g2cEU/SDJbVxKs=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=8Wb2LI3kMgnxWeW6SxOhgnpezLcbZVcxrZ3kBZrRA+s=; b=XMllsL6WKZwJqWaaEjHOcanvci ydxBSGeUconsA3WdtV458p3NiJLKErAchF3VAqjnfaTzcmhyDFXw95YYJnSOwHRo7VSymKujvT2kV teKeGVQVo10N9kX34gOdwU/nKz6+kl6ei6xZrBJB8xpXnLezYoAHmPat1hJXt91miBIY=; Received: from dhcp-174.greenie.muc.de ([193.149.48.174] helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tR8Qo-0008Lh-7F for openvpn-devel@lists.sourceforge.net; Fri, 27 Dec 2024 11:23:03 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.17.1.9/8.17.1.9) with ESMTP id 4BRBMtUd012002 for ; Fri, 27 Dec 2024 12:22:55 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 4BRBMtSe012001 for openvpn-devel@lists.sourceforge.net; Fri, 27 Dec 2024 12:22:55 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Fri, 27 Dec 2024 12:22:55 +0100 Message-ID: <20241227112255.11992-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Arne Schwabe Use the more standard cmake find_package to search for Python3 and make it required. This also provides a better error message than "version.cmake" not found when python3 is missing. Content analysis details: (0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [193.149.48.174 listed in sa-trusted.bondedsender.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [193.149.48.174 listed in bl.score.senderscore.com] X-Headers-End: 1tR8Qo-0008Lh-7F Subject: [Openvpn-devel] [PATCH v2] Ensure that Python3 is available X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1819592458650037889?= X-GMAIL-MSGID: =?utf-8?q?1819592458650037889?= From: Arne Schwabe Use the more standard cmake find_package to search for Python3 and make it required. This also provides a better error message than "version.cmake" not found when python3 is missing. Change-Id: I350fd615ed8474d34392a057a5f8bded78173949 Signed-off-by: Arne Schwabe Acked-by: Lev Stipakov --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/846 This mail reflects revision 2 of this Change. Signed-off-by line for the author was added as per our policy. Acked-by according to Gerrit (reflected above): Lev Stipakov diff --git a/CMakeLists.txt b/CMakeLists.txt index 61f0cc5..fc94a10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,9 +107,9 @@ endif () endif () -find_program(PYTHON NAMES python3 python) +find_package(Python3 REQUIRED COMPONENTS Interpreter) execute_process( - COMMAND ${PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake/parse-version.m4.py ${CMAKE_CURRENT_SOURCE_DIR}/version.m4 + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake/parse-version.m4.py ${CMAKE_CURRENT_SOURCE_DIR}/version.m4 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) include(${CMAKE_CURRENT_BINARY_DIR}/version.cmake) @@ -339,7 +339,7 @@ add_custom_command( OUTPUT always_rebuild config-version.h - COMMAND ${PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake/git-version.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake/git-version.py ) set(HAVE_CONFIG_VERSION_H YES)