Bug 15484 - pam_wrapper-1.1.5 fails to build when setting python paths manually
Summary: pam_wrapper-1.1.5 fails to build when setting python paths manually
Status: NEW
Alias: None
Product: cwrap
Classification: Unclassified
Component: library (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: Andreas Schneider
QA Contact:
Depends on:
Reported: 2023-09-28 13:56 UTC by Timo Gurr
Modified: 2023-09-28 13:56 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Timo Gurr 2023-09-28 13:56:22 UTC
To be able to build pam_wrapper for the selected python version e.g. Python 3.10 despite Python 3.11 also installed on the system we're passing the required Python path variables like:


which results in a CMake failure since 1.1.5:

CMake Error at src/python/python3/CMakeLists.txt:35 (python_add_module):
  Unknown CMake command "python_add_module".

since the python_add_modules relies on find_package(PythonLibs 3) which never gets called when setting the python paths manually, this was probably working for 1.1.4 since it also included python2 checks.

A dirty hack to allow the above to succeed:

diff -Naur pam_wrapper-1.1.5/src/python/python3/CMakeLists.txt pam_wrapper-1.1.5.new/src/python/python3/CMakeLists.txt
--- pam_wrapper-1.1.5/src/python/python3/CMakeLists.txt	2023-08-08 11:14:01.000000000 +0200
+++ pam_wrapper-1.1.5.new/src/python/python3/CMakeLists.txt	2023-09-28 15:26:52.090147304 +0200
@@ -32,6 +32,7 @@
+    find_package(PythonLibs 3)
     python_add_module(python3-pamtest ${pypamtest_SOURCE_DIR}/pypamtest.c)
     target_link_libraries(python3-pamtest pamtest::pamtest ${PYTHON3_LIBRARY})

FindPythonLibs is also deprecated since 3.12 and FindPython3 should be used instead so the proper fix would probably be to rework the checks completely and use FindPython3 instead, I'm no CMake expert though so I'm unable to do this myself to be able to contribute a proper fix.