diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml.disabled similarity index 100% rename from .github/workflows/build_wheels.yml rename to .github/workflows/build_wheels.yml.disabled diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 278a9b354..5f126d00e 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -13,15 +13,12 @@ on: - main - develop -#env: -# BUILD_TYPE: Release jobs: build: strategy: matrix: -# os: [ubuntu-22.04, windows-latest, macos-latest] - os: [ubuntu-22.04, macos-latest] + os: [ubuntu-latest, windows-latest, macos-latest] release: [Release] ssl: [ON, OFF] client-only: [ON, OFF] @@ -29,7 +26,7 @@ jobs: exclude: - os: windows-latest client-only: OFF - - os: ubuntu-22.04 + - os: ubuntu-latest client-only: ON - os: macos-latest client-only: ON @@ -50,7 +47,7 @@ jobs: core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Install linux dependencies - if: matrix.os == 'ubuntu-22.04' + if: matrix.os == 'ubuntu-latest' run: > sudo apt update && sudo apt install -y git @@ -59,6 +56,7 @@ jobs: libssl-dev cmake build-essential + libtirpc-dev pkg-config libxml2-dev libspdlog-dev @@ -69,8 +67,15 @@ jobs: python3-pip python3-venv + # Capnproto package on Ubuntu 24.04 has broken CMake file + - name: Fix Capnproto on Ubuntu + if: matrix.os == 'ubuntu-latest' + run: > + sudo sed -i 's/if (yes) # WITH_LIBATOMIC/if (no) # WITH_LIBATOMIC/' \ + /usr/lib/x86_64-linux-gnu/cmake/CapnProto/CapnProtoConfig.cmake + - name: Install Intel compiler - if: matrix.os == 'ubuntu-22.04' + if: matrix.os == 'ubuntu-latest' run: > sudo apt install -y wget && wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && @@ -116,9 +121,10 @@ jobs: openssl dlfcn-win32 spdlog + liblzma - name: Configure CMake (linux) - if: matrix.os == 'ubuntu-22.04' + if: matrix.os == 'ubuntu-latest' run: > cmake -G Ninja -B build -DBUILD_SHARED_LIBS=ON @@ -128,7 +134,7 @@ jobs: -DENABLE_CAPNP=${{ matrix.capnp }} - name: Configure CMake (linux Intel) - if: matrix.os == 'ubuntu-22.04' + if: matrix.os == 'ubuntu-latest' run: > source /opt/intel/oneapi/setvars.sh && CXX=icpx CC=icx cmake -G Ninja -B build-intel @@ -179,7 +185,7 @@ jobs: run: cmake --build build --config ${{ matrix.release }} - name: Build Intel - if: matrix.os == 'ubuntu-22.04' + if: matrix.os == 'ubuntu-latest' run: cmake --build build-intel --config ${{ matrix.release }} - name: Install @@ -191,7 +197,7 @@ jobs: run: cmake --install build --config ${{ matrix.release }} - name: Install pyuda - if: matrix.os == 'ubuntu-22.04' + if: matrix.os == 'ubuntu-latest' run: > cp -r /usr/local/python_installer ${{github.workspace}}/python_installer && python3 -m venv ${{github.workspace}}/venv && @@ -201,13 +207,13 @@ jobs: pip3 install ${{github.workspace}}/python_installer - name: Test pyuda import - if: matrix.os == 'ubuntu-22.04' + if: matrix.os == 'ubuntu-latest' run: > source ${{github.workspace}}/venv/bin/activate && python3 -c 'import pyuda; client=pyuda.Client()' - name: Run non-SSL system tests - if: matrix.os == 'ubuntu-22.04' && matrix.ssl == 'OFF' + if: matrix.os == 'ubuntu-latest' && matrix.ssl == 'OFF' run: > sudo cp /usr/local/etc/uda.socket /usr/local/etc/uda@.service /etc/systemd/system && sudo chown -R $USER:$USER /usr/local/etc && diff --git a/extlib/portablexdr-4.9.1/CMakeLists.txt b/extlib/portablexdr-4.9.1/CMakeLists.txt index 2e7603672..862108788 100644 --- a/extlib/portablexdr-4.9.1/CMakeLists.txt +++ b/extlib/portablexdr-4.9.1/CMakeLists.txt @@ -37,6 +37,10 @@ else() add_library( ${PROJECT_NAME} STATIC ${SOURCES} ) endif() +if( CMAKE_C_COMPILER_ID MATCHES "GNU|Clang" ) + target_compile_options( ${PROJECT_NAME} PRIVATE -Wno-incompatible-pointer-types ) +endif() + install( FILES rpc/rpc.h rpc/types.h rpc/xdr.h ${CMAKE_BINARY_DIR}/config.h DESTINATION include/rpc diff --git a/source/plugins/bytes/bytesPlugin.cpp b/source/plugins/bytes/bytesPlugin.cpp index 989909b1f..618be3d23 100644 --- a/source/plugins/bytes/bytesPlugin.cpp +++ b/source/plugins/bytes/bytesPlugin.cpp @@ -28,6 +28,19 @@ namespace filesystem = std::filesystem; #define BYTEFILEOPENERROR 100004 #define BYTEFILEHEAPERROR 100005 +namespace { +class FileDeleter +{ +public: + void operator()(FILE* file) const + { + if (file) { + fclose(file); + } + } +}; +} // anon namespace + class BytesPlugin { public: @@ -61,7 +74,7 @@ class BytesPlugin int size(IDAM_PLUGIN_INTERFACE* plugin_interface); private: - using file_ptr = std::unique_ptr; + using file_ptr = std::unique_ptr; bool init_ = false; std::unordered_map file_map_ = {}; @@ -245,7 +258,7 @@ int BytesPlugin::read(IDAM_PLUGIN_INTERFACE* plugin_interface) FILE* file = nullptr; if (file_map_.count(tmp_path) == 0) { - file_ptr ptr = {fopen(tmp_path, "rb"), fclose}; + file_ptr ptr(fopen(tmp_path, "rb")); file = ptr.get(); file_map_.emplace(tmp_path, std::move(ptr)); } else {