diff --git a/CMakeLists.txt b/CMakeLists.txt index 59161d79b6..5666b1f202 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -206,7 +206,7 @@ endif() if (CMAKE_EXPORT_COMPILE_COMMANDS AND WITH_PYTHON) add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json - COMMAND $<TARGET_FILE:Python::Interpreter> ${CMAKE_CURRENT_SOURCE_DIR}/contrib/gen_compile_db.py + COMMAND $<TARGET_FILE:Python3::Interpreter> ${CMAKE_CURRENT_SOURCE_DIR}/contrib/gen_compile_db.py ARGS -b ${CMAKE_CURRENT_BINARY_DIR} -s ${CMAKE_CURRENT_SOURCE_DIR} -o ${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/contrib/gen_compile_db.py ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json COMMENT "Build compile commands for IDE" diff --git a/bindings/c/CMakeLists.txt b/bindings/c/CMakeLists.txt index 8b850248de..9e864aa509 100644 --- a/bindings/c/CMakeLists.txt +++ b/bindings/c/CMakeLists.txt @@ -29,7 +29,7 @@ if(APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64") endif() add_custom_command(OUTPUT ${asm_file} ${CMAKE_CURRENT_BINARY_DIR}/fdb_c_function_pointers.g.h - COMMAND $<TARGET_FILE:Python::Interpreter> ${CMAKE_CURRENT_SOURCE_DIR}/generate_asm.py ${os} ${cpu} + COMMAND $<TARGET_FILE:Python3::Interpreter> ${CMAKE_CURRENT_SOURCE_DIR}/generate_asm.py ${os} ${cpu} ${CMAKE_CURRENT_SOURCE_DIR}/fdb_c.cpp ${asm_file} ${CMAKE_CURRENT_BINARY_DIR}/fdb_c_function_pointers.g.h @@ -65,7 +65,7 @@ endif() if(APPLE) set(symbols ${CMAKE_CURRENT_BINARY_DIR}/fdb_c.symbols) add_custom_command(OUTPUT ${symbols} - COMMAND $<TARGET_FILE:Python::Interpreter> ${CMAKE_CURRENT_SOURCE_DIR}/symbolify.py + COMMAND $<TARGET_FILE:Python3::Interpreter> ${CMAKE_CURRENT_SOURCE_DIR}/symbolify.py ${CMAKE_CURRENT_SOURCE_DIR}/foundationdb/fdb_c.h ${CMAKE_CURRENT_SOURCE_DIR}/foundationdb/fdb_c_internal.h ${symbols} @@ -457,7 +457,7 @@ elseif(NOT WIN32 AND NOT APPLE AND NOT USE_UBSAN) # Linux Only, non-ubsan only ) add_custom_command(OUTPUT ${SHIM_LIB_GEN_SRC} - COMMAND $<TARGET_FILE:Python::Interpreter> ${IMPLIBSO_SRC_DIR}/implib-gen.py + COMMAND $<TARGET_FILE:Python3::Interpreter> ${IMPLIBSO_SRC_DIR}/implib-gen.py --target ${CMAKE_SYSTEM_PROCESSOR} --outdir ${SHIM_LIB_OUTPUT_DIR} --dlopen-callback=fdb_shim_dlopen_callback @@ -484,7 +484,7 @@ elseif(NOT WIN32 AND NOT APPLE AND NOT USE_UBSAN) # Linux Only, non-ubsan only target_include_directories(fdb_c_shim_lib_tester PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/foundationdb/ ${CMAKE_SOURCE_DIR}/flow/include) add_test(NAME fdb_c_shim_library_tests - COMMAND $<TARGET_FILE:Python::Interpreter> ${CMAKE_CURRENT_SOURCE_DIR}/test/fdb_c_shim_tests.py + COMMAND $<TARGET_FILE:Python3::Interpreter> ${CMAKE_CURRENT_SOURCE_DIR}/test/fdb_c_shim_tests.py --build-dir ${CMAKE_BINARY_DIR} --unit-tests-bin $<TARGET_FILE:fdb_c_shim_unit_tests> --api-tester-bin $<TARGET_FILE:fdb_c_shim_api_tester> diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt index 0f871d8c87..4f5022aa4e 100644 --- a/bindings/python/CMakeLists.txt +++ b/bindings/python/CMakeLists.txt @@ -68,7 +68,7 @@ endif() set(setup_file_name foundationdb-${FDB_VERSION}.tar.gz) set(package_file ${CMAKE_BINARY_DIR}/packages/foundationdb-${FDB_VERSION}${not_fdb_release_string}.tar.gz) add_custom_command(OUTPUT ${package_file} - COMMAND $<TARGET_FILE:Python::Interpreter> setup.py sdist --formats=gztar && + COMMAND $<TARGET_FILE:Python3::Interpreter> setup.py sdist --formats=gztar && ${CMAKE_COMMAND} -E copy dist/${setup_file_name} ${package_file} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Create Python sdist package") diff --git a/cmake/AddFdbTest.cmake b/cmake/AddFdbTest.cmake index c0440df5ef..066baf7100 100644 --- a/cmake/AddFdbTest.cmake +++ b/cmake/AddFdbTest.cmake @@ -125,7 +125,7 @@ function(add_fdb_test) list(TRANSFORM ADD_FDB_TEST_TEST_FILES PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/") if (ENABLE_SIMULATION_TESTS) add_test(NAME ${test_name} - COMMAND $<TARGET_FILE:Python::Interpreter> ${TestRunner} + COMMAND $<TARGET_FILE:Python3::Interpreter> ${TestRunner} -n ${test_name} -b ${PROJECT_BINARY_DIR} -t ${test_type} @@ -440,7 +440,7 @@ function(add_fdbclient_test) message(STATUS "Adding Client test ${T_NAME}") add_test(NAME "${T_NAME}" WORKING_DIRECTORY ${T_WORKING_DIRECTORY} - COMMAND ${Python_EXECUTABLE} ${TMP_CLUSTER_CMD} + COMMAND ${Python3_EXECUTABLE} ${TMP_CLUSTER_CMD} -- ${T_COMMAND}) if (T_TEST_TIMEOUT) @@ -473,7 +473,7 @@ function(add_unavailable_fdbclient_test) endif() message(STATUS "Adding unavailable client test ${T_NAME}") add_test(NAME "${T_NAME}" - COMMAND ${Python_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tests/TestRunner/fake_cluster.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tests/TestRunner/fake_cluster.py --output-dir ${CMAKE_BINARY_DIR} -- ${T_COMMAND}) @@ -508,7 +508,7 @@ function(add_multi_fdbclient_test) endif() message(STATUS "Adding Client test ${T_NAME}") add_test(NAME "${T_NAME}" - COMMAND ${Python_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tests/TestRunner/tmp_multi_cluster.py + COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tests/TestRunner/tmp_multi_cluster.py --build-dir ${CMAKE_BINARY_DIR} --clusters 3 -- diff --git a/cmake/FDBComponents.cmake b/cmake/FDBComponents.cmake index 13e3f790a8..02f0aa2a16 100644 --- a/cmake/FDBComponents.cmake +++ b/cmake/FDBComponents.cmake @@ -56,8 +56,8 @@ endif() # Python Bindings ################################################################################ -find_package(Python COMPONENTS Interpreter) -if(Python_Interpreter_FOUND) +find_package(Python3 COMPONENTS Interpreter) +if(Python3_Interpreter_FOUND) set(WITH_PYTHON ON) else() message(WARNING "Could not found a suitable python interpreter") diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d7a21990de..bc70079e3b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -375,7 +375,7 @@ if(WITH_PYTHON) if(NOT OPEN_FOR_IDE) add_test( NAME command_line_argument_test - COMMAND ${Python_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tests/argument_parsing/test_argument_parsing.py ${CMAKE_BINARY_DIR} + COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tests/argument_parsing/test_argument_parsing.py ${CMAKE_BINARY_DIR} ) endif() diff --git a/tests/CTestCustom.ctest.cmake b/tests/CTestCustom.ctest.cmake index 484bc07c71..b29793158d 100644 --- a/tests/CTestCustom.ctest.cmake +++ b/tests/CTestCustom.ctest.cmake @@ -1 +1 @@ -set(CTEST_CUSTOM_PRE_TEST ${CTEST_CUSTOM_PRE_TEST} "@Python_EXECUTABLE@ @PROJECT_SOURCE_DIR@/tests/TestRunner/TestDirectory.py @PROJECT_BINARY_DIR@") +set(CTEST_CUSTOM_PRE_TEST ${CTEST_CUSTOM_PRE_TEST} "@Python3_EXECUTABLE@ @PROJECT_SOURCE_DIR@/tests/TestRunner/TestDirectory.py @PROJECT_BINARY_DIR@") diff --git a/tests/TestRunner/tmp_multi_cluster.py b/tests/TestRunner/tmp_multi_cluster.py old mode 100644 new mode 100755