Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,20 @@ 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]
capnp: [ON, OFF]
exclude:
- os: windows-latest
client-only: OFF
- os: ubuntu-22.04
- os: ubuntu-latest
client-only: ON
- os: macos-latest
client-only: ON
Expand All @@ -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
Expand All @@ -59,6 +56,7 @@ jobs:
libssl-dev
cmake
build-essential
libtirpc-dev
pkg-config
libxml2-dev
libspdlog-dev
Expand All @@ -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 &&
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 &&
Expand All @@ -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/[email protected] /etc/systemd/system &&
sudo chown -R $USER:$USER /usr/local/etc &&
Expand Down
4 changes: 4 additions & 0 deletions extlib/portablexdr-4.9.1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 15 additions & 2 deletions source/plugins/bytes/bytesPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -61,7 +74,7 @@ class BytesPlugin
int size(IDAM_PLUGIN_INTERFACE* plugin_interface);

private:
using file_ptr = std::unique_ptr<FILE, decltype(&fclose)>;
using file_ptr = std::unique_ptr<FILE, FileDeleter>;

bool init_ = false;
std::unordered_map<std::string, file_ptr> file_map_ = {};
Expand Down Expand Up @@ -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 {
Expand Down
Loading