Build doesn't fail if nettle is not found but -DENABLE_PYTHON=ON
envgap__openscad__openscad-5896
01 / FAILURE SIGNATURE
As reported upstream
No identifying execution failure has been captured.
Not a benchmark task.
- In a clean container the reported failure did not reproduce, or the known fix did not make the project run.
02 / ENVIRONMENT RECIPE
- Base commit
811ef8cd64ea5ca4e064a7ecb8a65e10f1baf0fd- Manifest
CMakeLists.txt- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
openscad/openscad #5896 · read the original issue
**Describe the bug**
When defining -DENABLE_PYTHON=ON during building but not having the nettle dependency available, the build does not fail.
This is due to this code in [/CMakeLists.txt](https://github.com/openscad/openscad/blob/72c9919d63116f8e711f3566ae34e9eb63a2d6e6/CMakeLists.txt#L468):
```cmake
if(ENABLE_PYTHON)
find_package(Python REQUIRED COMPONENTS Interpreter Development)
find_package(Nettle 3.4)
if(NOT Nettle_FOUND)
message(WARNING "Nettle not found, disabling python support.")
set(ENABLE_PYTHON OFF CACHE BOOL "" FORCE)
else()
message(STATUS "Python ${Python_VERSION} enabled, using Nettle ${Nettle_VERSION}")
target_include_directories(OpenSCAD PRIVATE ${Python_INCLUDE_DIRS})
target_link_libraries(OpenSCAD PRIVATE ${Python_LIBRARIES})
target_include_directories(OpenSCAD PRIVATE ${Nettle_INCLUDE_DIRS})
target_link_libraries(OpenSCAD PRIVATE ${Nettle_LIBRARIES})
add_custom_target(OpenSCADPython ALL COMMAND ${CMAKE_COMMAND} -E create_symlink openscad${SUFFIX_WITH_DASH} "openscad-python")
endif()
endif()
```
IMHO `find_package(Nettle)` should use the `REQUIRED` flag as well. If the packager sets `-DENABLE_PYTHON=ON`, the build should fail if that module could not be built.
And is there a specific reason why there is a hard dependency on version 3.4? In guix we currently have version 3.9.1. I could of course package the older version, but I need to understand first why this is necessary.04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]