From: "plaisthos (Code Review)" Date: Fri, 27 Dec 2024 01:10:23 +0000 In-Reply-To: References: Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277... Message-ID: <5fa7e4da0e4c02e1966a48a14bba114aea99ab5a-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="GrP/UlMEXMg="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Ensure that Python3 is available List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , stipa Cc: openvpn-devel --GrP/UlMEXMg= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos, stipa. Hello flichtenheld, stipa, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/846?usp=3Demail to look at the new patch set (#2). The following approvals got outdated and were removed: Code-Review-1 by stipa Change subject: Ensure that Python3 is available ...................................................................... Ensure that Python3 is available 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 missi= ng. Change-Id: I350fd615ed8474d34392a057a5f8bded78173949 --- M CMakeLists.txt 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/46/846/2 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-vers= ion.m4.py ${CMAKE_CURRENT_SOURCE_DIR}/version.m4 + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmak= e/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-versio= n.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmak= e/git-version.py ) set(HAVE_CONFIG_VERSION_H YES) -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/846?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I350fd615ed8474d34392a057a5f8bded78173949 Gerrit-Change-Number: 846 Gerrit-PatchSet: 2 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: stipa Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-Attention: stipa Gerrit-MessageType: newpatchset --GrP/UlMEXMg= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos, stipa. <= /p>

plaisthos uploaded patch set #2 to this change.

<= a href=3D"http://gerrit.openvpn.net/c/openvpn/+/846?usp=3Demail">View Chang= e

The following approvals got outdated and were removed: Code-Review-1 by stipa

Ensure that Python3 is available

Use the more= standard cmake find_package to search for Python3 and make it required. Th= is also provides
a better error message than "version.cmake" n= ot found when python3 is missing.

Change-Id: I350fd615ed8474d34392a0= 57a5f8bded78173949
---
M CMakeLists.txt
1 file changed, 3 insertio= ns(+), 3 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/ope=
nvpn refs/changes/46/846/2
diff --git a/CMakeLists.txt b/CMakeLists=
.txt
index 61f0cc5..fc94a10 100644
--- a/CM= akeLists.txt
+++ b/CMakeLists.txt
@@ -107,9= +107,9 @@
endif ()
endif ()
-find_program= (PYTHON NAMES python3 python)
+find_package(Python3 REQUIRED COMPONENTS Interpreter)
<= span> execute_process(
= - COMMAND ${PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake/parse-vers= ion.m4.py ${CMAKE_CURRENT_SOURCE_DIR}/version.m4
+ COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURR= ENT_SOURCE_DIR}/contrib/cmake/parse-version.m4.py ${CMAKE_CURRENT_SOURCE_DI= R}/version.m4
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY= _DIR}
)
include(${CMAKE_CURRENT_BINAR= Y_DIR}/version.cmake)
@@ -339,7 +339,7 @@
=
add_custom_command(
OUTPUT always_re= build config-version.h
= - COMMAND ${PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake/git-versio= n.py
+ COMMAND ${P= ython3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake/git-version.py=
)
set(HAVE_CONFIG_VERSION_H YES)


To view, visit change 846. = To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I350fd615ed8474d34392a057a5f= 8bded78173949
Gerrit-Change-Number: 846
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: stipa <lstipakov@...277...= >
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Attention: stipa <lstipakov@...1663...= .>
Gerrit-MessageType: newpatchset
--GrP/UlMEXMg=--