diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1b160d9ef5ea45f8d075c93ab5853e58fc13e150..bbc5cedd72e5e422f3685dabc9ed8448919a37f3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -208,7 +208,7 @@ macos-x86_64:build: - .macos_x86_64 - .cmake_build_macos - .cmake_build_artifacts - - .macos_builder_tags + - .macos_x86_64_builder_tags - .run_automatically macos-x86_64:test: @@ -216,7 +216,7 @@ macos-x86_64:test: - .macos_x86_64 - .cmake_test_macos - .cmake_test_artifacts - - .macos_builder_tags + - .macos_x86_64_builder_tags - .run_dependent needs: - macos-x86_64:build diff --git a/.gitlab/ci/configure_fedora33_paraview.cmake b/.gitlab/ci/configure_fedora33_paraview.cmake index a09043cadf834a2e636c3896b50f6431cfe4774a..1f88dbd07d1110c55ce430faf69a46dbad12013d 100644 --- a/.gitlab/ci/configure_fedora33_paraview.cmake +++ b/.gitlab/ci/configure_fedora33_paraview.cmake @@ -3,9 +3,11 @@ set(SMTK_PLUGIN_CONTRACT_FILE_URLS "https://gitlab.kitware.com/cmb/plugins/opencascade-session/-/raw/master/cmake/opencascade-smtk-contract.cmake" "https://gitlab.kitware.com/cmb/plugins/adh-extensions/-/raw/master/CMake/adh-extensions.cmake" "https://gitlab.kitware.com/cmb/plugins/rgg-session/-/raw/master/CMake/rgg-session.cmake" - "https://gitlab.kitware.com/cmb/plugins/truchas-extensions/-/raw/master/CMake/truchas-extensions.cmake" + # https://gitlab.kitware.com/cmb/smtk/-/issues/543 + # "https://gitlab.kitware.com/cmb/plugins/truchas-extensions/-/raw/master/CMake/truchas-extensions.cmake" "https://gitlab.kitware.com/cmb/cmb/-/raw/master/cmake/cmb.cmake" - "https://gitlab.kitware.com/cmb/plugins/ace3p-extensions/-/raw/master/CMake/ace3p-extensions.cmake" + # https://gitlab.kitware.com/cmb/smtk/-/issues/543 + # "https://gitlab.kitware.com/cmb/plugins/ace3p-extensions/-/raw/master/CMake/ace3p-extensions.cmake" "https://gitlab.kitware.com/cmb/plugins/xmsmeshoperation/-/raw/master/CMake/xms-mesh-operation.cmake" "https://gitlab.kitware.com/cmb/plugins/cmb-2d/-/raw/master/cmake/cmb-2d.cmake" CACHE STRING "") diff --git a/.gitlab/ci/ctest_exclusions.cmake b/.gitlab/ci/ctest_exclusions.cmake index 1e99b2e5f6bc82f9f36fefaa0f7aec71eadd23b0..e17fa8bfbe006f12f8157c07853e1d72123313d4 100644 --- a/.gitlab/ci/ctest_exclusions.cmake +++ b/.gitlab/ci/ctest_exclusions.cmake @@ -18,6 +18,10 @@ if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "fedora") "^RenderMesh$" # QTest::qWaitForWindowActive fails on CI machines but works locally "^UnitTestDoubleClickButton$" + # Segfault; global dtor order where `H5P_close` tries to allocate memory after `malloc` + # machinery has been torn down + # https://gitlab.kitware.com/cmb/smtk/-/issues/544 + "^TestMutexedOperation$" ) endif () diff --git a/.gitlab/ci/download_superbuild.cmake b/.gitlab/ci/download_superbuild.cmake index 743465dfa4f3f4424ec87276b43c1bd265e2d1e7..ee5e245c2b0a1d83d05c3c61f9e6e24b87ea25bf 100644 --- a/.gitlab/ci/download_superbuild.cmake +++ b/.gitlab/ci/download_superbuild.cmake @@ -8,16 +8,16 @@ cmake_minimum_required(VERSION 3.12) set(data_host "https://data.kitware.com") # Determine the tarball to download. ci-smtk-ci-developer-{date}-{git-sha}.tar.gz -# 20241101 - Update to use ParaView 5.13.1 and to fix Python Artifacts +# 20250105 - Update to use Xcode 16.1 if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "vs2022") - set(file_id "18XQy5PT34mDndeb_4KxiWB1Vfpa74w0F") - set(file_hash "76141151c2d9faa7df1321b24afc7b572212ee639ffb5564ccfadc99577c280427f7444c2ca998f06c0d131f0e1272aa061f7ee2bb5923f91cde18e94792020b") + set(file_id "1fv29BZW5MedtbwV_-XuvGFNYHNFLdVxm") + set(file_hash "7d0919c3217e143c4be6f4e7c4e47e5b9831858efc0a406f7531d09d091243fb5be44bc7ed7e26a4c61d81a5e57f38a453c253dcc8037d3ffe0fb7c9b09ba77f") elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "macos_x86_64") - set(file_id "1T3IdfGuYvRcrH3mK1c7fzIJbsc_u7Wp7") - set(file_hash "c9c0b1c65ec8c83620181f5a5ba54e6ed6e2d76a8ea08b800ee69c39033d4a36ca312b691eaaf86c20f3713d2a250451c231e7f6820d20bcea5d8d74235f02fc") + set(file_id "1q_yl0ZXBzXZu27CqH0RJIggUO0dcdzxz") + set(file_hash "a8cd9a32216b5c1153b1a37ff672941302004a64e066192288727c4b6be5c2fd6c57a818b9254c0d7aed5e8ed26bdd357d54224ce503468ed34b8352315f6138") elseif ("$ENV{CMAKE_CONFIGURATION}" MATCHES "macos_arm64") - set(file_id "1L9yqQMJDw_peBTDcI6AbX4s8iLiQ8XWY") - set(file_hash "a87b1f079b8a4191d81a9b0726342714dd8ea8a60f2bc8fe9c6081fa30e2a9afaf70d3b6b821948033e01dceb7aca927b4635a69afee92f245e1f18a41c558e2") + set(file_id "1BluXPsmfRNqAqSpYahyvC6iWAVlJ0vzy") + set(file_hash "8e8a2f8492cc383658028184a25cd555f85697e2a0075c0792321de7980eda58e7b60c0ef5be743f253d44f5abaebf89852a606a90078214bb9eed885428ce73") else () message(FATAL_ERROR "Unknown build to use for the superbuild") diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index bd1c788902a018cf880452cfbb56bfdf67b84c48..2a163dc9bd62990a6bbf9f8827d4988bc637768f 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -6,8 +6,8 @@ ### Fedora .fedora33: - # Update to use ParaView 5.13.1 and to fix Python Artifacts - image: "kitware/cmb:ci-smtk-fedora33-20241101" + # Xcode 16.1 update; synchronize with other platforms + image: "kitware/cmb:ci-smtk-fedora33-20250105" variables: GIT_SUBMODULE_STRATEGY: recursive @@ -67,14 +67,14 @@ .fedora33_vtk_python3: extends: .fedora33 - image: "kitware/cmb:ci-smtk-fedora33-vtk-20240724" + image: "kitware/cmb:ci-smtk-fedora33-vtk-20250105" variables: CMAKE_CONFIGURATION: fedora33_vtk_python3 .fedora33_paraview: extends: .fedora33 - image: "kitware/cmb:ci-smtk-fedora33-paraview-20241101" + image: "kitware/cmb:ci-smtk-fedora33-paraview-20250105" variables: CMAKE_CONFIGURATION: fedora33_paraview diff --git a/.gitlab/os-macos.yml b/.gitlab/os-macos.yml index fb7968f45904393a0fabe3c533300db465b2fe91..f49c4c2c6b61829790d5cf4833ed98afbcd7e646 100644 --- a/.gitlab/os-macos.yml +++ b/.gitlab/os-macos.yml @@ -8,7 +8,7 @@ GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmb-ci-ext/$CI_CONCURRENT_ID" # TODO: Factor this out so that each job selects the Xcode version to # use so that different versions can be tested in a single pipeline. - DEVELOPER_DIR: "/Applications/Xcode-14.2.app/Contents/Developer" + DEVELOPER_DIR: "/Applications/Xcode-16.1.app/Contents/Developer" # Avoid conflicting with other projects running on the same machine. SCCACHE_SERVER_PORT: 4228 @@ -41,12 +41,12 @@ ## Tags -.macos_builder_tags: +.macos_x86_64_builder_tags: tags: - cmb - macos-x86_64 - shell - - xcode-14.2 + - xcode-16.1 - nonconcurrent .macos_arm64_builder_tags: @@ -54,7 +54,7 @@ - cmb - macos-arm64 - shell - - xcode-14.2 + - xcode-16.1 - nonconcurrent ## macOS-specific scripts diff --git a/smtk/common/PythonInterpreter.cxx b/smtk/common/PythonInterpreter.cxx index 2ad95d934a19fa8fc3fc8b74bde0450f4f22996d..6b058566b8850d814598f8fca69b6075e63dbec9 100644 --- a/smtk/common/PythonInterpreter.cxx +++ b/smtk/common/PythonInterpreter.cxx @@ -105,19 +105,28 @@ void PythonInterpreter::initialize() // Locate the directory containing the python library in use, and set // PYTHONHOME to this path. static std::string pythonLibraryLocation = Paths::pathToLibraryContainingFunction(Py_Initialize); -#if (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3) || PY_MAJOR_VERSION > 3 - // Python 3.3 switched to wchar_t. + size_t needed = mbstowcs(nullptr, pythonLibraryLocation.c_str(), 0); + +#if PY_VERSION_HEX >= 0x03080000 + PyConfig config; + PyConfig_InitPythonConfig(&config); + wchar_t* wcs_pn = (wchar_t*)PyMem_RawMalloc(sizeof(wchar_t) * (needed + 1)); + mbstowcs(wcs_pn, pythonLibraryLocation.c_str(), needed + 1); + config.program_name = wcs_pn; + config.site_import = 0; + + pybind11::initialize_interpreter(&config); + PyConfig_Clear(&config); +#else static std::vector loc; - loc.resize(pythonLibraryLocation.size() + 1); + loc.resize(needed + 1); mbstowcs(loc.data(), pythonLibraryLocation.c_str(), static_cast(loc.size())); Py_SetProgramName(loc.data()); -#else - Py_SetProgramName(const_cast(pythonLibraryLocation.c_str())); -#endif // Initialize the embedded interpreter. Py_NoSiteFlag = 1; pybind11::initialize_interpreter(); +#endif // Locate the directory containing the library that describes this // class. @@ -378,21 +387,12 @@ bool PythonInterpreter::loadPythonSourceFile( testCmd << "loaded = True\n" << "try:\n" -#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 5 << " import sys, types, importlib.machinery\n" << " loader = importlib.machinery.SourceFileLoader('" << moduleName << "', '" << fileName << "')\n" << " mod = types.ModuleType(loader.name)\n" << " loader.exec_module(mod)\n" << " sys.modules['" << moduleName << "'] = mod\n" -#elif PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3 && PY_MINOR_VERSION <= 4 - << " from importlib.machinery import SourceFileLoader\n" - << " tmp = SourceFileLoader('" << moduleName << "', '" << fileName - << "').load_module()\n" -#else /* PY_MAJOR_VERSION == 2 */ - << " import imp\n" - << " tmp = imp.load_source('" << moduleName << "', '" << fileName << "')\n" -#endif << "except Exception as e:\n" << " print(e)\n" << " loaded = False"; diff --git a/smtk/common/pybind11/PybindUUIDTypeCaster.h b/smtk/common/pybind11/PybindUUIDTypeCaster.h index 64b9c897f62324f0d4fc43a5d1fe00bdf5b0f09d..21a94cebc86e17eb01b8e5503a34577514f025eb 100644 --- a/smtk/common/pybind11/PybindUUIDTypeCaster.h +++ b/smtk/common/pybind11/PybindUUIDTypeCaster.h @@ -41,11 +41,7 @@ public: throw reference_cast_error(); } -#if (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3) || PY_MAJOR_VERSION > 3 char* ustr = uuidBytes ? PyBytes_AS_STRING(uuidBytes) : nullptr; -#else - char* ustr = uuidBytes ? PyString_AsString(uuidBytes) : nullptr; -#endif if (ustr) { for (int i = 0; i < 16; ++i) diff --git a/smtk/extension/qt/qtReferenceItem.cxx b/smtk/extension/qt/qtReferenceItem.cxx index c069901d5e948ba06e34642ecba9123923844d3c..086a06c8a713662c25afd7d0ff9a207fbc1b7add 100644 --- a/smtk/extension/qt/qtReferenceItem.cxx +++ b/smtk/extension/qt/qtReferenceItem.cxx @@ -758,6 +758,15 @@ void qtReferenceItem::updateSynopsisLabels() const bool qtReferenceItem::eventFilter(QObject* src, QEvent* event) { + // Filter events up front. UBSan is noticing that, during destruction of the widget tree, + // `m_popup` is transmogrified from a `QDialog` into a `QWidget` (this is called from the + // `QWidget` destructor). Do nothing for certain events to avoid looking at `m_popup` during + // this state. + if (event->type() == QEvent::ChildRemoved || event->type() == QEvent::Destroy) + { + return false; + } + // We serve as an event filter on 2 widgets: // 1. the inherited frame holding the item (m_widget), // which we monitor for the enter/exit events that enable hovering