diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index ebaf90f17..8a902214e 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -10,7 +10,7 @@ env: jobs: build: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 diff --git a/CMakeLists.txt b/CMakeLists.txt index 89e912580..1602b57cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,7 +59,7 @@ endif() # Patch libzmq to set minimum cmake version to 3.15 to avoid warnings # with newer cmake versions # Patch is applied in the FetchContent_Declare -set(SLS_LIBZMQ_VERSION "4.3.4") +set(SLS_LIBZMQ_VERSION "4.3.5") find_program(PATCH_EXECUTABLE patch) if(NOT PATCH_EXECUTABLE) @@ -141,7 +141,7 @@ else() FetchContent_Declare( libzmq URL ${CMAKE_CURRENT_SOURCE_DIR}/libs/libzmq/libzmq-${SLS_LIBZMQ_VERSION}.tar.gz - URL_HASH MD5=cc20b769ac10afa352e5ed2769bb23b3 + URL_HASH MD5=cfb80c6ad694cacc2f7c99bf44e8b686 PATCH_COMMAND ${CMAKE_COMMAND} -E chdir patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/libs/libzmq/libzmq_cmake_version.patch UPDATE_DISCONNECTED 1 ) diff --git a/README.md b/README.md index d8d26f2d4..e913dd2ef 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ To use the basic building blocks, meaning sls_detector_get/put and the shared li Additionally the core requires the following dependencies: * fmt 12.1.0 (packaged in libs) (since version 11.0.0) - * ZeroMQ 4.3.4 (packaged in libs) + * ZeroMQ 4.3.5 (packaged in libs) * rapidjson (packaged in libs) > **Note:** Both fmt, ZeroMQ and rapidjson are bundled in libs. One does not need to pre-install them on the system. Alternatively, one can fetch fmt and ZeroMQ from GitHub by passing the cmake options ``-DSLS_FETCH_FMT_FROM_GITHUB=ON`` and ``-DSLS_FETCH_ZEROMQ_FROM_GITHUB=ON`` respectively. @@ -351,8 +351,8 @@ git submodule update --init ### Zeromq **v8.0.0+**: -zeromq (v4.3.4) is built -* by default from tar file in repo (libs/libzmq/libzmq-4.3.4.tar.gz) +zeromq (v4.3.5) is built +* by default from tar file in repo (libs/libzmq/libzmq-4.3.5.tar.gz) * or use advanced option SLS_FETCH_ZMQ_FROM_GITHUB [link]. **v7.x.x and older**: diff --git a/conda-recipes/python-client/meta.yaml b/conda-recipes/python-client/meta.yaml index d7411571e..aed1f4c21 100644 --- a/conda-recipes/python-client/meta.yaml +++ b/conda-recipes/python-client/meta.yaml @@ -9,6 +9,10 @@ package: build: number: 0 script: + # gcc_linux-64 16.2.0 build 3 passes bare tool names in CMAKE_ARGS + # (-DCMAKE_AR=x86_64-conda-linux-gnu-ar), which CMake resolves relative to + # SRC_DIR. Restore the full paths; no-op when they are already absolute. + - 'export CMAKE_ARGS="${CMAKE_ARGS//=${HOST}-/=${BUILD_PREFIX}/bin/${HOST}-}"' # [not win] - unset CMAKE_GENERATOR && {{ PYTHON }} -m pip install . -vv --config-settings=cmake.define.SLS_USE_SYSTEM_ZMQ=ON # [not win] requirements: diff --git a/docs/src/dependencies.rst b/docs/src/dependencies.rst index 14e866eb3..f43c4c4e0 100644 --- a/docs/src/dependencies.rst +++ b/docs/src/dependencies.rst @@ -24,7 +24,7 @@ the shared libraries these are needed: Additionally the core requires the following dependencies: * fmt 12.1.0 (packaged in libs) - * ZeroMQ 4.3.4 (packaged in libs) + * ZeroMQ 4.3.5 (packaged in libs) * rapidjson 1.1.0 (packaged in libs) .. note:: diff --git a/docs/src/installation.rst b/docs/src/installation.rst index 0dfb85a36..347173cc9 100644 --- a/docs/src/installation.rst +++ b/docs/src/installation.rst @@ -425,8 +425,8 @@ is to use conda | **Zeromq** | v8.0.0+: -| zeromq (v4.3.4) is built -| * by default from tar file in repo (libs/libzmq/libzmq-4.3.4.tar.gz) +| zeromq (v4.3.5) is built +| * by default from tar file in repo (libs/libzmq/libzmq-4.3.5.tar.gz) | * or use advanced option SLS_FETCH_ZMQ_FROM_GITHUB [`link `__]. | | v7.x.x and older: diff --git a/libs/libzmq/libzmq-4.3.4.tar.gz b/libs/libzmq/libzmq-4.3.4.tar.gz deleted file mode 100644 index 537b380f1..000000000 Binary files a/libs/libzmq/libzmq-4.3.4.tar.gz and /dev/null differ diff --git a/libs/libzmq/libzmq-4.3.5.tar.gz b/libs/libzmq/libzmq-4.3.5.tar.gz new file mode 100644 index 000000000..40623d750 Binary files /dev/null and b/libs/libzmq/libzmq-4.3.5.tar.gz differ diff --git a/pyproject.toml b/pyproject.toml index dfe4e31cc..2ae1af893 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,12 @@ -[tool.scikit-build.metadata.version] +[[tool.dynamic-metadata]] provider = "scikit_build_core.metadata.regex" +field = "version" input = "VERSION" regex = '^(?P\d+(?:\.\d+)*(?:[\.\+\w]+)?)$' result = "{version}" [build-system] -requires = [ "scikit-build-core>=0.10", "pybind11", "numpy",] +requires = [ "scikit-build-core>=1.1", "pybind11", "numpy",] build-backend = "scikit_build_core.build" [project] diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 581de9337..e17c703a8 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -834,13 +834,13 @@ class Detector(CppDetectorApi): ---- Sets up the following for every module: - [Eiger] txdelay_left to (2 \* mod_index \* n_delay), + [Eiger] txdelay_left to (2 * mod_index * n_delay), - [Eiger] txdelay_right to ((2 \* mod_index + 1) \* n_delay) and + [Eiger] txdelay_right to ((2 * mod_index + 1) * n_delay) and - [Eiger] txdelay_frame to (2 \* num_modules \* n_delay) + [Eiger] txdelay_frame to (2 * num_modules * n_delay) - [Jungfrau][Moench][Mythen3] txdelay_frame to (num_modules \* n_delay) + [Jungfrau][Moench][Mythen3] txdelay_frame to (num_modules * n_delay) Please refer txdelay_left, txdelay_right and txdelay_frame for details. """ diff --git a/python/src/detector.cpp b/python/src/detector.cpp index a17590818..1d000ba25 100644 --- a/python/src/detector.cpp +++ b/python/src/detector.cpp @@ -960,6 +960,8 @@ void init_det(py::module &m) { py::arg()); CppDetectorApi.def("clearRxROI", (void(Detector::*)()) & Detector::clearRxROI); + CppDetectorApi.def("isCompleteRxRoi", (bool (Detector::*)() const) & + Detector::isCompleteRxRoi); CppDetectorApi.def( "getFileFormat", (Result(Detector::*)(sls::Positions) const) & diff --git a/slsDetectorSoftware/tests/Caller/test-Caller-acquire.cpp b/slsDetectorSoftware/tests/Caller/test-Caller-acquire.cpp index 8084efd84..86e0a2e0b 100644 --- a/slsDetectorSoftware/tests/Caller/test-Caller-acquire.cpp +++ b/slsDetectorSoftware/tests/Caller/test-Caller-acquire.cpp @@ -8,11 +8,14 @@ #include "acquire/ExpectedState.h" #include "acquire/FileState.h" #include "checks/MasterFileChecks.h" +#include "tests/globals.h" namespace sls { namespace acq = sls::test::acquire; namespace checks = sls::test::checks; +using test::GET; +using test::PUT; void acquire_and_check_file_size( Detector &det, std::optional ctb_state = std::nullopt) { @@ -270,4 +273,29 @@ TEST_CASE("acquire_check_binary_file_size", REQUIRE_NOTHROW(acquire_and_check_file_size(det)); } +TEST_CASE("rx_start_fails_fpath_permissions", "[.detectorintegration]") { + Detector det; + Caller caller(&det); + auto det_type = + det.getDetectorType().tsquash("Inconsistent detector types to test"); + + // not needed to test for every detector type, just one is enough + if (det_type == defs::JUNGFRAU) { + std::vector formats{defs::BINARY}; +#ifdef HDF5C + formats.push_back(defs::HDF5); +#endif + for (auto format : formats) { + INFO("File format: " << ToString(format)); + auto file_state = acq::default_file_state(); + file_state.file_format = format; + file_state.file_write = true; + // no write permission, rx_start fails later + file_state.file_path = "/"; + acq::FileStateGuard file_guard(det, file_state); + REQUIRE_THROWS(caller.call("rx_start", {}, -1, PUT)); + } + } +} + } // namespace sls diff --git a/slsReceiverSoftware/src/HDF5DataFile.cpp b/slsReceiverSoftware/src/HDF5DataFile.cpp index 8dc2f4598..1e8381c1d 100644 --- a/slsReceiverSoftware/src/HDF5DataFile.cpp +++ b/slsReceiverSoftware/src/HDF5DataFile.cpp @@ -136,7 +136,7 @@ void HDF5DataFile::CreateFile() { '_' + std::to_string(fileIndex) + ".h5"); fileName = p.string(); - std::lock_guard lock(*hdf5Lib); + std::unique_lock lock(*hdf5Lib); uint64_t framestosave = ((maxFramesPerFile == 0) ? numImages : // infinite images @@ -207,8 +207,11 @@ void HDF5DataFile::CreateFile() { } } catch (const H5::Exception &error) { error.printErrorStack(); + lock.unlock(); // CloseFile() also wants the mutex --> need to unlock + // here CloseFile(); - throw RuntimeError("Could not create HDF5 handles in object " + index); + throw RuntimeError("Could not create HDF5 handles in object " + + std::to_string(index)); } if (!silentMode) { LOG(logINFO) << "[" << udpPortNumber