diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1c1e302741..b40cc4efb4 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -172,7 +172,7 @@ clone_docker:
else
source gitlab-ci/setup_ccache.sh;
fi
- - rpmbuild --rebuild --with server --with eos_grpc_gateway --define "_rpmdir build/RPMS/" --define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" build/SRPMS/* | (ts 2> dev/null || true; tee)
+ - rpmbuild --rebuild --with server --with eos_grpc_gateway --define "_rpmdir build/RPMS/" --define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" build/SRPMS/* | (ts 2> /dev/null || true; tee)
- ccache -s
- if [[ -n "$CI_COMMIT_TAG" ]]; then gpg2 --batch --import $STCI_REPO_KEY; printf "" | setsid rpmsign --define='%_gpg_name stci@cern.ch' --define='%_signature gpg' --addsign build/RPMS/*.rpm; fi
- mkdir ${BUILD_NAME}_artifacts; cp -rv build/*RPMS/ build/eos-*.tar.gz ${BUILD_NAME}_artifacts
@@ -767,6 +767,7 @@ el9_asan_docker_image:
- exec_cmd eos-mgm1 "eos vid add gateway \"127.0.0.1\" https"
- exec_cmd eos-mgm1 "eos vid add gateway \"[:1]\" https"
- exec_cmd eos-mgm1 "eos vid add gateway \"[::1]\" https"
+ - exec_cmd eos-mgm1 "for ip in \$(hostname -i); do eos vid add gateway \$ip https; done"
- exec_cmd eos-mgm1 "eos vid set map -grpc key:auth_key vuid:11 vgid:11"
- exec_cmd eos-mgm1 "eos vid set map -https key:auth_key vuid:11 vgid:11"
- exec_cmd eos-mgm1 "eos vid set membership 11 +sudo"
@@ -776,7 +777,11 @@ el9_asan_docker_image:
- echo ${MGM_POD_HOSTNAME}
# We connect over https, and the certificate is only valid for the hostname, so replace localhost with the MGM's hostname
- - exec_cmd eos-mgm1 'sed -i "s/^\(master_url = \"https:\/\/\)localhost\(:[0-9][0-9]*\"\)/\1$(hostname -f)\2/" reva/tests/integration/reva-cli/config/revad-eos.toml'
+ - |
+ exec_cmd eos-mgm1 'sed -i -e "s/^\(master_url = \"https:\/\/\)localhost\(:[0-9][0-9]*\"\)/\1$(hostname -f)\2/" \
+ -e "s/^\(master_grpc_uri = \"\)localhost\(:[0-9][0-9]*\"\)/\1$(hostname -f)\2/" \
+ -e "s/^\(allow_insecure = \)true/\1false/" \
+ reva/tests/integration/reva-cli/config/revad-eos.toml'
# Start revad
- exec_cmd eos-mgm1 './reva/cmd/revad/revad -c reva/tests/integration/reva-cli/config/revad-eos.toml revad.log 2>&1 & echo $! > revad.pid'
@@ -786,7 +791,6 @@ el9_asan_docker_image:
- exec_cmd eos-mgm1 "eos vid ls"
- exec_cmd eos-mgm1 "eos access ls"
- exec_cmd eos-mgm1 "cat revad.log"
-
artifacts:
when: on_failure
expire_in: 3 days
@@ -893,8 +897,12 @@ publish_koji_al8:
variables:
TARGET: "eos8al"
BUILD_NAME: "el-8"
- dependencies:
- - build_el8
+ only:
+ - schedules
+ - tags
+ needs:
+ - job: build_el8
+ artifacts: true
publish_koji_al9:
@@ -902,8 +910,9 @@ publish_koji_al9:
variables:
TARGET: "eos9al"
BUILD_NAME: "el-9"
- dependencies:
- - build_el9
+ needs:
+ - job: build_el9
+ artifacts: true
publish_koji_al10:
@@ -911,8 +920,12 @@ publish_koji_al10:
variables:
TARGET: "eos10al"
BUILD_NAME: "el-10"
- dependencies:
- - build_el10
+ only:
+ - schedules
+ - tags
+ needs:
+ - job: build_el10
+ artifacts: true
publish_koji_rh-8:
@@ -1044,6 +1057,21 @@ notify_cta_project:
rpm_commit_artifacts:
stage: publish
image: gitlab-registry.cern.ch/linuxsupport/alma9-base
+ needs:
+ - job: build_el8
+ artifacts: true
+ optional: true
+ - job: build_el9
+ artifacts: true
+ - job: build_el10
+ artifacts: true
+ optional: true
+ - job: build_el9_arm64
+ artifacts: true
+ optional: true
+ - job: build_fedora_38
+ artifacts: true
+ optional: true
script:
- dnf install --nogpg -y sudo sssd-client createrepo
- if [[ -n "$CI_COMMIT_TAG" ]]; then echo "This only works for commits"; exit 0; else BUILD_TYPE="commit"; fi
@@ -1162,7 +1190,7 @@ clean_k8s_cluster:
- export KUBECONFIG=$K8S_CONFIG
- set +o pipefail
- kubectl get namespaces --no-headers | grep -v 'default\|kube-node-lease\|kube-public\|kube-system\|magnum-tiller' |
- awk 'match($3,/[3-9][0-9]+h||[[:alnum:]]+d/) {print $1}' | xargs --no-run-if-empty kubectl delete namespaces
+ awk 'match($3,/(([3-9][0-9]|[1-9][0-9][0-9]+)h|[1-9][0-9]*d)/) {print $1}' | xargs --no-run-if-empty kubectl delete namespaces
dependencies: []
allow_failure: true
only:
diff --git a/.gitmodules b/.gitmodules
index 4edeb35b28..c230461d5a 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -35,3 +35,6 @@
[submodule "fst/css_plugin"]
path = fst/css_plugin
url = https://gitlab.cern.ch/eos/css_plugin.git
+[submodule "console/parser"]
+ path = common/parser
+ url = https://github.com/CLIUtils/CLI11.git
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 26cfd7f0cc..8b54186d74 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -94,7 +94,6 @@ endif()
set(CMAKE_INSTALL_SYSCONFDIR /etc)
include(EosFindLibs)
-
include(CTest)
#-------------------------------------------------------------------------------
@@ -142,12 +141,8 @@ add_subdirectory(misc)
add_subdirectory(test)
add_subdirectory(namespace/ns_quarkdb/qclient)
-if (GRPC_FOUND)
- add_subdirectory(client)
-endif()
-
if (NOT CLIENT)
-
+ add_subdirectory(client)
add_subdirectory(mgm)
add_subdirectory(namespace)
add_subdirectory(utils)
@@ -185,6 +180,8 @@ set(CPACK_SOURCE_IGNORE_FILES
;/grpc/eos-grpc.spec;/.deps/;~$;'.'o$;/lib/;/.git/;eos.spec.in;elrepopackage.spec;.tar.gz$;\
.tar.bz2$;${CPACK_SOURCE_IGNORE_FILES};")
+set(EOS_TUI_VERSION "0.2.11")
+
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/config_spec.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake/config_spec.cmake" @ONLY IMMEDIATE)
@@ -245,7 +242,6 @@ if (EOS_GRPC_GW)
LIST(APPEND RPM_OPTIONS --with eos_grpc_gateway)
endif()
-
add_custom_target(
srpm
COMMAND rpmbuild -ts ${EOS_ARCHIVE} --define "_topdir ${CMAKE_BINARY_DIR}" ${SRPM_DEFINE} ${RPM_OPTIONS})
@@ -256,6 +252,7 @@ add_custom_target(
add_dependencies(srpm dist)
add_dependencies(rpm dist)
+include(EosTui)
#-------------------------------------------------------------------------------
# Custom target to build on OSX
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 0000000000..8036dd6072
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,144 @@
+# Security Policy
+
+## Reporting a Vulnerability
+
+We take security issues seriously and appreciate responsible disclosure from the community.
+
+If you believe you have found a security vulnerability in this project, please report it privately. Do **not** open a public GitHub issue for security vulnerabilities.
+
+## How to Report
+
+Please use one of the following private reporting channels:
+
+1. **CERN GitLab — primary and preferred reporting channel**
+
+ Use CERN GitLab for vulnerability reports whenever possible. This is the primary development repository and the preferred place to submit security reports.
+
+ https://gitlab.cern.ch/dss/eos/-/security/vulnerability_report
+
+2. **GitHub — for external collaborators without CERN GitLab access**
+
+ Use GitHub private vulnerability reporting only if you are an external collaborator and do not have access to CERN GitLab.
+
+ https://github.com/cern-eos/eos/security/
+
+Please do not submit the same report through multiple channels unless requested by the maintainers.
+
+When reporting a vulnerability, please include as much detail as possible, including:
+
+- A description of the issue
+- Steps to reproduce the vulnerability
+- Affected versions, branches, or configurations
+- Any proof-of-concept code, logs, screenshots, or error messages
+- The potential impact of the vulnerability
+- Any suggested remediation, if available
+
+## Use of AI Coding Assistants in Vulnerability Research
+
+We welcome thoughtful security reports that are discovered, analyzed, validated, or documented with the help of AI coding assistants, automated scanners, or similar tools. These tools can be useful for reviewing code, identifying suspicious patterns, improving reports, and suggesting possible remediations.
+
+To help maintainers understand and reproduce the finding, please mention any AI coding assistant or automated tool that substantially contributed to the report. Where applicable, include:
+
+- The name of the AI coding assistant or tool used
+- The model, version, or service, if known
+- How the tool was used, such as discovery, code review, exploit analysis, remediation suggestions, or report writing
+- Any relevant prompts, generated output, scanner results, or tool findings needed to understand the issue
+- The steps you took to verify the vulnerability and confirm its security impact
+
+AI-assisted reports are most helpful when they include clear reasoning, reproducible steps, and evidence that the issue is real and exploitable. Reports do not need to be perfect, but they should provide enough information for maintainers to independently assess the finding.
+
+Please avoid submitting private project data, secrets, credentials, personal data, or other sensitive information to AI tools unless you are authorized to do so and the tool is approved for that use.
+
+## Use of AI Agents in Security Reporting
+
+We also welcome reports that are prepared, submitted, triaged, or followed up on with the help of AI agents, automation agents, or other delegated systems. Agent-assisted reporting can be useful when it improves clarity, consistency, and responsiveness.
+
+If an agent was used in preparing or managing a security report, please disclose this so that maintainers understand how the report and any follow-up communication are being handled. Where applicable, include:
+
+- The name or type of agent used
+- The platform, framework, or service provider, if known
+- Whether the agent was used for vulnerability discovery, code analysis, exploit testing, report generation, submission, or follow-up communication
+- Whether the agent acted autonomously or under human supervision
+- The identity or contact details of the human or organization responsible for the report
+- Any relevant limitations of the agent’s findings or communication
+
+If follow-up communication is handled by an agent, please make sure that:
+
+- The agent can provide accurate and relevant responses to maintainer questions
+- A human reviewer can join the conversation when requested
+- Communication remains focused, respectful, and useful
+- Vulnerability details are kept private and shared only with authorized parties
+- Requests for disclosure, credit, or compensation are handled appropriately and respectfully
+
+When agents are used to identify or submit multiple findings, please keep the volume of simultaneous reports to a manageable level. Reports should be prioritized and submitted in order of highest criticality and security impact first. Where several related findings exist, consider grouping them into a single report when this helps maintainers understand the overall issue and reduces duplicate or overlapping communication.
+
+Reports submitted or managed with the help of agents remain welcome under this policy, provided they follow the same responsible disclosure expectations as any other report and are backed by a responsible human contact.
+
+## Supported Versions
+
+Security updates are provided for the following versions:
+
+| Version | Supported |
+|---|---|
+| Latest stable release | Yes |
+| Older releases | No |
+| Development branches | Best effort |
+
+Only the latest stable release is guaranteed to receive security fixes unless otherwise stated.
+
+## Disclosure Process
+
+After a vulnerability is reported, we will make reasonable efforts to:
+
+1. Acknowledge receipt of the report within 5 business days.
+2. Investigate and validate the issue.
+3. Work on a fix or mitigation if the issue is confirmed.
+4. Coordinate disclosure timing with the reporter when appropriate.
+5. Publish a security advisory or release notes after a fix is available, if needed.
+
+We ask reporters to give us a reasonable amount of time to investigate and address the issue before making any information public.
+
+## Responsible Disclosure Guidelines
+
+We ask that security researchers and users:
+
+- Do not publicly disclose the vulnerability until we have had a chance to investigate and address it.
+- Do not access, modify, or delete data that does not belong to you.
+- Do not perform testing that could degrade, disrupt, or damage the project, services, users, or infrastructure.
+- Do not use social engineering, phishing, spam, physical attacks, or denial-of-service attacks.
+- Provide enough information for us to reproduce and understand the issue.
+
+Reports made in good faith under this policy are appreciated.
+
+## Scope
+
+This policy applies to the code and documentation in this repository.
+
+The following are generally out of scope unless they demonstrate a clear security impact:
+
+- Vulnerabilities in unsupported versions
+- Issues requiring physical access to a user’s device
+- Social engineering attacks
+- Denial-of-service attacks
+- Reports from automated scanners without evidence of exploitability
+- Missing security headers without a demonstrated impact
+- Issues in third-party dependencies that are not directly exploitable through this project
+
+## Security Updates
+
+Security fixes may be released as:
+
+- A patch release
+- A commit to the default branch
+- A GitHub Security Advisory
+- Updated documentation or configuration guidance
+
+Users are encouraged to keep their deployments up to date with the latest stable release.
+
+## No Bug Bounty
+
+Unless explicitly stated otherwise, this project does not offer a paid bug bounty program. We are grateful for responsible reports but cannot guarantee monetary rewards.
+
+## Contact
+
+For security-related questions or vulnerability reports, please use the private reporting channels listed above.
\ No newline at end of file
diff --git a/auth_plugin/ProtoUtils.cc b/auth_plugin/ProtoUtils.cc
index dfc6dea7d2..1d447585d7 100644
--- a/auth_plugin/ProtoUtils.cc
+++ b/auth_plugin/ProtoUtils.cc
@@ -347,7 +347,7 @@ utils::ComputeHMAC(RequestProto*& req)
return false;
}
- std::string hmac = eos::common::SymKey::HmacSha1(smsg);
+ std::string hmac = eos::common::SymKey::HmacSha256(smsg);
XrdOucString base64hmac;
bool do_encoding = eos::common::SymKey::Base64Encode((char*)hmac.c_str(),
hmac.length(), base64hmac);
diff --git a/client/grpc/GrpcClient.cc b/client/grpc/GrpcClient.cc
index 7a01cef5b7..688075c62c 100644
--- a/client/grpc/GrpcClient.cc
+++ b/client/grpc/GrpcClient.cc
@@ -21,25 +21,20 @@
* along with this program. If not, see .*
************************************************************************/
-/*----------------------------------------------------------------------------*/
+#ifdef EOS_GRPC
#include "GrpcClient.hh"
#include "proto/Rpc.grpc.pb.h"
#include "common/StringConversion.hh"
#include "common/Timing.hh"
#include "common/Path.hh"
-/*----------------------------------------------------------------------------*/
#include
#include
#include
#include
-/*----------------------------------------------------------------------------*/
#include
-/*----------------------------------------------------------------------------*/
EOSCLIENTNAMESPACE_BEGIN
-//#ifdef EOS_GRPC
-
using grpc::Channel;
using grpc::ClientAsyncResponseReader;
using grpc::ClientAsyncReader;
@@ -689,7 +684,5 @@ GrpcClient::ExportFs(const eos::rpc::MDResponse& response,
return "";
}
-//#endif
-
-
EOSCLIENTNAMESPACE_END
+#endif
diff --git a/client/grpc/GrpcClient.hh b/client/grpc/GrpcClient.hh
index 45f718003f..ad15abfac3 100644
--- a/client/grpc/GrpcClient.hh
+++ b/client/grpc/GrpcClient.hh
@@ -22,19 +22,14 @@
************************************************************************/
#pragma once
-
-/*----------------------------------------------------------------------------*/
#include "client/Namespace.hh"
#include "common/AssistedThread.hh"
#include
-/*----------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------*/
+
#ifdef EOS_GRPC
#include
#include "proto/Rpc.grpc.pb.h"
-/*----------------------------------------------------------------------------*/
-
EOSCLIENTNAMESPACE_BEGIN
/**
@@ -99,6 +94,5 @@ private:
std::map tree;
};
-#endif
-
EOSCLIENTNAMESPACE_END
+#endif
diff --git a/cmake/EosCompileFlags.cmake b/cmake/EosCompileFlags.cmake
index a357f74724..35bbe42bd5 100644
--- a/cmake/EosCompileFlags.cmake
+++ b/cmake/EosCompileFlags.cmake
@@ -67,6 +67,7 @@ endif ()
# Compiler specific flags
#-------------------------------------------------------------------------------
+if (NOT MacOSX)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Clang requires linking with libatomic
find_package(Atomic REQUIRED)
@@ -95,6 +96,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-fclang-abi-compat=17
)
endif()
+endif()
#-------------------------------------------------------------------------------
# Sanitizer flags
diff --git a/cmake/EosFindLibs.cmake b/cmake/EosFindLibs.cmake
index fcc41c254b..751140d5f1 100644
--- a/cmake/EosFindLibs.cmake
+++ b/cmake/EosFindLibs.cmake
@@ -51,9 +51,9 @@ if(NOT PACKAGEONLY)
find_package(SparseHash REQUIRED)
find_package(jsoncpp REQUIRED)
find_package(Libevent REQUIRED)
+ find_package(fmt REQUIRED)
find_package(bz2 REQUIRED)
find_package(absl REQUIRED)
- find_package(fmt REQUIRED)
find_package(RocksDB REQUIRED)
find_package(jemalloc)
find_package(EosGrpcGateway)
@@ -65,39 +65,39 @@ if(NOT PACKAGEONLY)
find_package(libbfd)
find_package(davix)
find_package(nfs)
- find_package(procps)
- find_package(libproc2)
- find_package(Scitokens REQUIRED)
+ find_package(Scitokens)
+ find_package(GRPC REQUIRED)
find_package(Protobuf3 REQUIRED)
- if(NOT (PROCPS_FOUND OR LIBPROC2_FOUND))
- message(FATAL_ERROR "Could not find either procps 3.x or libproc2 (procps 4.x). "
- "At least one of them is required.")
+ if (GRPC_FOUND AND XROOTD_FOUND)
+ # Library paths for Protobuf, grpc and xrootd need to be added to the
+ # RPATH of the libraries and binaries built since they are not installed
+ # in the usual system location.
+ set(CMAKE_SKIP_RPATH FALSE)
+ set(CMAKE_SKIP_BUILD_RPATH FALSE)
+ # TODO: To be removed in the future when CMAKE properly handles RPATH.
+ # Currently without this option the koji builds fail with error:
+ # file RPATH_CHANGE could not write new RPATH
+ set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+ get_filename_component(EOS_XROOTD_RPATH ${XROOTD_UTILS_LIBRARY} DIRECTORY)
+ get_filename_component(EOS_GRPC_RPATH ${GRPC_GRPC++_LIBRARY} DIRECTORY)
+ list(APPEND CMAKE_INSTALL_RPATH "${EOS_GRPC_RPATH};${EOS_XROOTD_RPATH}")
+ message(STATUS "Info CMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH}")
+ else()
+ message(FATAL_ERROR "One of the mandatory dependecies: GPRC(Protobuf) or XRootD not found")
endif()
if (Linux)
find_package(help2man)
find_package(glibc REQUIRED)
find_package(xfs REQUIRED)
- find_package(GRPC REQUIRED)
+ find_package(procps)
+ find_package(libproc2)
- if (GRPC_FOUND AND XROOTD_FOUND)
- # Library paths for Protobuf, grpc and xrootd needs to be added to the
- # RPATH of the libraries and binaries built since they are not installed
- # in the usual system location.
- set(CMAKE_SKIP_RPATH FALSE)
- set(CMAKE_SKIP_BUILD_RPATH FALSE)
- # TODO: To be removed in the future when CMAKE properly handles RPATH.
- # Currently without this option the koji builds fail with error:
- # file RPATH_CHANGE could not write new RPATH
- set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
- set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
- get_filename_component(EOS_XROOTD_RPATH ${XROOTD_UTILS_LIBRARY} DIRECTORY)
- get_filename_component(EOS_GRPC_RPATH ${GRPC_GRPC++_LIBRARY} DIRECTORY)
- set(CMAKE_INSTALL_RPATH "${EOS_GRPC_RPATH};${EOS_XROOTD_RPATH}")
- message(STATUS "Info CMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH}")
- else()
- message(FATAL_ERROR "One of the mandatory dependecies: GPRC(Protobuf) or XRootD not found")
+ if(NOT (PROCPS_FOUND OR LIBPROC2_FOUND))
+ message(FATAL_ERROR "Could not find either procps 3.x or libproc2 (procps 4.x). "
+ "At least one of them is required.")
endif()
else ()
# Add dummy targets for APPLE to simplify the cmake file using these targets
@@ -124,6 +124,15 @@ else()
return()
endfunction()
+ function(GRPC_GENERATE_CPP SRCS HDRS)
+ # This is just a hack to be able to run cmake >= 3.11 with -DPACKAGEONLY
+ # enabled. Otherwise the protobuf libraries built using add_library will
+ # complain as they have no SOURCE files.
+ set(${SRCS} "${CMAKE_SOURCE_DIR}/common/Logging.cc" PARENT_SCOPE)
+ set(${HDRS} "${CMAKE_SOURCE_DIR}/common/Logging.hh" PARENT_SCOPE)
+ return()
+ endfunction()
+
# Fake targets
add_library(ZLIB::ZLIB INTERFACE IMPORTED)
add_library(UUID::UUID INTERFACE IMPORTED)
diff --git a/cmake/EosOSDefaults.cmake b/cmake/EosOSDefaults.cmake
index d4749eb720..f6657bb731 100644
--- a/cmake/EosOSDefaults.cmake
+++ b/cmake/EosOSDefaults.cmake
@@ -38,22 +38,23 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
endif()
# Check if we are on MacOSX
-if(APPLE)
+if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" )
include(GNUInstallDirs)
set(MacOSX TRUE )
set(CLIENT TRUE )
set(OSDEFINE "-D__APPLE__=1")
- # On MAC we don't link static objects at all
- set(FUSE_LIBRARY /usr/local/lib/libosxfuse_i64.dylib)
- set(CMAKE_MACOSX_RPATH ON)
+ # On MAC we don't link static objects at all. The FUSE library path is
+ # discovered by Findfuse.cmake (libfuse on macFUSE 4.x, libosxfuse on
+ # older installs); do not hardcode it here.
+ set(CMAKE_MACOSX_RPATH TRUE)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+ list(APPEND CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
if("${isSystemDir}" STREQUAL "-1")
- set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+ list(APPEND CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif()
endif()
@@ -62,3 +63,5 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
set(Windows TRUE )
set(OSDEFINE "-D__WINDOWS__=1")
endif()
+
+add_compile_definitions(${OSDEFINE})
diff --git a/cmake/EosTui.cmake b/cmake/EosTui.cmake
new file mode 100644
index 0000000000..e5421adbfc
--- /dev/null
+++ b/cmake/EosTui.cmake
@@ -0,0 +1,43 @@
+# ----------------------------------------------------------------------
+# EOS TUI packaging helpers
+# ----------------------------------------------------------------------
+
+# Mirrored from the eos-tui GitHub release by the eos-tui GitLab CI.
+set(EOS_TUI_RELEASE_BASE_URL "https://storage-ci.web.cern.ch/storage-ci/eos-tui/releases/v${EOS_TUI_VERSION}")
+set(EOS_TUI_LICENSE_URL "${EOS_TUI_RELEASE_BASE_URL}/LICENSE")
+set(EOS_TUI_README_URL "${EOS_TUI_RELEASE_BASE_URL}/README.md")
+
+if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64)$")
+ set(EOS_TUI_BINARY_NAME "eos-tui_v${EOS_TUI_VERSION}_linux_amd64")
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)$")
+ set(EOS_TUI_BINARY_NAME "eos-tui_v${EOS_TUI_VERSION}_linux_arm64")
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm64|aarch64)$")
+ set(EOS_TUI_BINARY_NAME "eos-tui_v${EOS_TUI_VERSION}_macos_arm64")
+endif()
+
+if(EOS_TUI_BINARY_NAME)
+ set(EOS_TUI_BINARY_URL "${EOS_TUI_RELEASE_BASE_URL}/${EOS_TUI_BINARY_NAME}")
+endif()
+
+set(EOS_TUI_INSTALL_STAGING_DIR "${CMAKE_BINARY_DIR}/eos-tui/v${EOS_TUI_VERSION}")
+set(EOS_TUI_LICENSE_STAGED "${EOS_TUI_INSTALL_STAGING_DIR}/LICENSE")
+set(EOS_TUI_README_STAGED "${EOS_TUI_INSTALL_STAGING_DIR}/README.md")
+
+if(EOS_TUI_BINARY_NAME)
+ set(EOS_TUI_BINARY_STAGED "${EOS_TUI_INSTALL_STAGING_DIR}/${EOS_TUI_BINARY_NAME}")
+ configure_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake/EosTuiInstall.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/cmake/EosTuiInstall.cmake"
+ @ONLY)
+
+ install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/cmake/EosTuiInstall.cmake")
+ install(PROGRAMS "${EOS_TUI_BINARY_STAGED}"
+ DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
+ RENAME eos-tui)
+ install(FILES "${EOS_TUI_LICENSE_STAGED}"
+ DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/eos-tui")
+ install(FILES "${EOS_TUI_README_STAGED}"
+ DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/doc/eos-tui")
+else()
+ message(WARNING "EOS TUI install is only configured for Linux x86_64/aarch64 and macOS arm64 builds.")
+endif()
diff --git a/cmake/EosTuiInstall.cmake.in b/cmake/EosTuiInstall.cmake.in
new file mode 100644
index 0000000000..efbb2ab869
--- /dev/null
+++ b/cmake/EosTuiInstall.cmake.in
@@ -0,0 +1,23 @@
+# ----------------------------------------------------------------------
+# EOS TUI install helpers
+# ----------------------------------------------------------------------
+
+function(eos_tui_download url destination)
+ if(EXISTS "${destination}")
+ return()
+ endif()
+
+ file(DOWNLOAD "${url}" "${destination}" STATUS download_status TLS_VERIFY ON)
+ list(GET download_status 0 download_code)
+ list(GET download_status 1 download_message)
+
+ if(NOT download_code EQUAL 0)
+ file(REMOVE "${destination}")
+ message(FATAL_ERROR "Failed to download ${url}: ${download_message}")
+ endif()
+endfunction()
+
+file(MAKE_DIRECTORY "@EOS_TUI_INSTALL_STAGING_DIR@")
+eos_tui_download("@EOS_TUI_BINARY_URL@" "@EOS_TUI_BINARY_STAGED@")
+eos_tui_download("@EOS_TUI_LICENSE_URL@" "@EOS_TUI_LICENSE_STAGED@")
+eos_tui_download("@EOS_TUI_README_URL@" "@EOS_TUI_README_STAGED@")
diff --git a/cmake/FindGRPC.cmake b/cmake/FindGRPC.cmake
index 8ab20c2744..09bd441b8a 100644
--- a/cmake/FindGRPC.cmake
+++ b/cmake/FindGRPC.cmake
@@ -134,7 +134,7 @@ find_program(GRPC_CPP_PLUGIN
# Find libabsl_synchronization
find_library(ABSL_SYNCHRONIZATION_LIBRARY
NAMES absl_synchronization
- HINTS ${GRPC_ROOT}
+ HINTS ${GRPC_ROOT} ${ABSL_ROOT}
PATHS /opt/eos/grpc /usr/local /usr
PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR}
NO_DEFAULT_PATH)
@@ -142,7 +142,7 @@ find_library(ABSL_SYNCHRONIZATION_LIBRARY
# Find libabsl_base
find_library(ABSL_BASE_LIBRARY
NAMES absl_base
- HINTS ${GRPC_ROOT}
+ HINTS ${GRPC_ROOT} ${ABSL_ROOT}
PATHS /opt/eos/grpc /usr/local /usr
PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR}
NO_DEFAULT_PATH)
diff --git a/cmake/FindProtobuf3.cmake b/cmake/FindProtobuf3.cmake
index a12b976c61..27272e4f98 100644
--- a/cmake/FindProtobuf3.cmake
+++ b/cmake/FindProtobuf3.cmake
@@ -51,9 +51,16 @@ if (PROTOBUF3_FOUND AND NOT TARGET PROTOBUF::PROTOBUF)
set(Protobuf_PROTOC_EXECUTABLE ${PROTOBUF3_PROTOC_EXECUTABLE})
add_library(PROTOBUF::PROTOBUF UNKNOWN IMPORTED)
+ # Modern protobuf (>= 22) pulls in absl headers transitively, so we expose
+ # ABSL_INCLUDE_DIR (set by Findabsl.cmake) on the protobuf interface when
+ # available.
+ set(_protobuf_iface_includes "${PROTOBUF3_INCLUDE_DIR}")
+ if(ABSL_INCLUDE_DIR)
+ list(APPEND _protobuf_iface_includes "${ABSL_INCLUDE_DIR}")
+ endif()
set_target_properties(PROTOBUF::PROTOBUF PROPERTIES
IMPORTED_LOCATION "${PROTOBUF3_LIBRARY}"
- INTERFACE_INCLUDE_DIRECTORIES "${PROTOBUF3_INCLUDE_DIR}")
+ INTERFACE_INCLUDE_DIRECTORIES "${_protobuf_iface_includes}")
target_compile_definitions(PROTOBUF::PROTOBUF INTERFACE PROTOBUF_USE_DLLS=1)
# Overwrite these since they are used in generating the Protobuf files
diff --git a/cmake/FindScitokens.cmake b/cmake/FindScitokens.cmake
index 54c91f8374..f7dd108249 100644
--- a/cmake/FindScitokens.cmake
+++ b/cmake/FindScitokens.cmake
@@ -1,8 +1,8 @@
# Try to find scitokens
# Once done, this will define
#
-# SCITOKENS_FOUND - system has zlib
-# SCITOKENS_INCLUDE_DIRS - zlib include directories
+# SCITOKENS_FOUND - system has scitokens
+# SCITOKENS_INCLUDE_DIRS - scitokens include directories
#
# and the following imported targets
#
@@ -26,7 +26,11 @@ if (SCITOKENS_FOUND AND NOT TARGET SCITOKENS::SCITOKENS)
add_library(SCITOKENS::SCITOKENS UNKNOWN IMPORTED)
set_target_properties(SCITOKENS::SCITOKENS PROPERTIES
IMPORTED_LOCATION "${SCITOKENS_LIBRARY}"
- INTERFACE_INCLUDE_DIRECTORIES "${SCITOKENS_INCLUDE_DIR}")
+ INTERFACE_INCLUDE_DIRECTORIES "${SCITOKENS_INCLUDE_DIR}"
+ INTERFACE_COMPILE_DEFINITIONS HAVE_SCITOKENS)
+else()
+ message(WARNING "Notice: scitokens not found, no scitokens support")
+ add_library(SCITOKENS::SCITOKENS INTERFACE IMPORTED)
endif()
unset(SCITOKENS_LIBRARY)
diff --git a/cmake/Findabsl.cmake b/cmake/Findabsl.cmake
index 5a7eff8fb4..8a380dd349 100644
--- a/cmake/Findabsl.cmake
+++ b/cmake/Findabsl.cmake
@@ -21,7 +21,7 @@ foreach( lib ${libraries})
NAMES ${lib}
HINTS /opt/eos/grpc ${ABSL_ROOT}
PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR})
-
+
if(ABSL_${lib}_LIBRARY)
set(ABSL_${lib}_FOUND 1)
list(APPEND ABSL_LIBRARIES ${ABSL_${lib}_LIBRARY})
@@ -45,6 +45,17 @@ if (ABSL_FOUND AND NOT TARGET ABSL::ABSL)
IMPORTED_LOCATION "${ABSL_absl_base_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${ABSL_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${ABSL_LIBRARIES}")
+
+ include(CheckSymbolExists)
+ # Check grpc logging function
+ check_symbol_exists(gpr_set_log_function "${ABLS_INCLUDE_DIR}" HAVE_GRPC_LOGGING)
+
+ if (HAVE_GRPC_LOGGING)
+ message(STATUS "Grpc internal logging!")
+ targe_compile_definitions(ABLS::ABLS PUBLIC HAVE_GRPC_LOGGING)
+ else()
+ message(STATUS "Grpc uses abseil logging!")
+ endif()
endif ()
unset(ABSL_INCLUDE_DIR)
diff --git a/cmake/Findfuse.cmake b/cmake/Findfuse.cmake
index 68c10d790b..41a5bbcc7e 100644
--- a/cmake/Findfuse.cmake
+++ b/cmake/Findfuse.cmake
@@ -4,7 +4,7 @@
# FUSE_FOUND - system has fuse
# FUSE_INCLUDE_DIRS - fuse include directories
# FUSE_LIBRARIES - libraries need to use fuse
-# FUSE_MOUNT_VERSION - major version reported by fusermount
+# FUSE_MOUNT_VERSION - major version reported by fusermount
#
# and the following imported target
# FUSE::FUSE
@@ -19,8 +19,10 @@ find_path(FUSE_INCLUDE_DIR
PATH_SUFFIXES include include/osxfuse)
if(MacOSX)
+ # macFUSE 4.x renamed the library from libosxfuse to libfuse, keep both for
+ # compatibility with older installs.
find_library(FUSE_LIBRARY
- NAMES osxfuse
+ NAMES fuse osxfuse
HINTS ${FUSE_ROOT} ${PC_fuse_LIBDIR} ${PC_fuse_LIBRARY_DIRS}
PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR})
else()
@@ -38,7 +40,7 @@ else()
set(${FUSE_MOUNT_VERSION} "" PARENT_SCOPE)
endif()
- message(STATUS "Setting FUSE_MOUNT_VERSION: ${FUSE_MOUNT_VERSION}")
+ message(STATUS "Setting FUSE_MOUNT_VERSION: ${FUSE_MOUNT_VERSION}")
endif()
include(FindPackageHandleStandardArgs)
diff --git a/cmake/Findlz4.cmake b/cmake/Findlz4.cmake
index d0c6d9d587..0725081ef9 100644
--- a/cmake/Findlz4.cmake
+++ b/cmake/Findlz4.cmake
@@ -10,7 +10,7 @@
# LZ4::LZ4
find_library(LZ4_LIBRARY
- NAMES liblz4.so.1
+ NAMES liblz4.so.1 liblz4.1.dylib
HINTS ${LZ4_ROOT}
PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR})
diff --git a/cmake/Findzstd.cmake b/cmake/Findzstd.cmake
index 3e7de9e191..7ec4ef4777 100644
--- a/cmake/Findzstd.cmake
+++ b/cmake/Findzstd.cmake
@@ -8,19 +8,26 @@
#
# ZSTD::ZSTD
+find_path(ZSTD_INCLUDE_DIR
+ NAMES zstd.h
+ HINTS ${ZSTD_ROOT}
+ PATH_SUFFIXES include)
+
find_library(ZSTD_LIBRARY
NAMES zstd
HINTS ${ZSTD_ROOT}
PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR})
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(zstd DEFAULT_MSG ZSTD_LIBRARY)
+find_package_handle_standard_args(zstd DEFAULT_MSG ZSTD_LIBRARY ZSTD_INCLUDE_DIR)
if (ZSTD_FOUND AND NOT TARGET ZSTD::ZSTD)
- mark_as_advanced(ZSTD_FOUND ZSTD_LIBRARY)
+ mark_as_advanced(ZSTD_FOUND ZSTD_LIBRARY ZSTD_INCLUDE_DIR)
add_library(ZSTD::ZSTD UNKNOWN IMPORTED)
set_target_properties(ZSTD::ZSTD PROPERTIES
- IMPORTED_LOCATION "${ZSTD_LIBRARY}")
+ IMPORTED_LOCATION "${ZSTD_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${ZSTD_INCLUDE_DIR}")
endif()
unset(ZSTD_LIBRARY)
+unset(ZSTD_INCLUDE_DIR)
diff --git a/common/CLI11.hpp b/common/CLI11.hpp
deleted file mode 100644
index f14e4cc423..0000000000
--- a/common/CLI11.hpp
+++ /dev/null
@@ -1,8279 +0,0 @@
-#pragma once
-
-// CLI11: Version 1.8.0
-// Originally designed by Henry Schreiner
-// https://github.com/CLIUtils/CLI11
-//
-// This is a standalone header file generated by MakeSingleHeader.py in CLI11/scripts
-// from: v1.8.0
-//
-// From LICENSE:
-//
-// CLI11 1.8 Copyright (c) 2017-2019 University of Cincinnati, developed by Henry
-// Schreiner under NSF AWARD 1414736. All rights reserved.
-//
-// Redistribution and use in source and binary forms of CLI11, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// 1. Redistributions of source code must retain the above copyright notice, this
-// list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-// 3. Neither the name of the copyright holder nor the names of its contributors
-// may be used to endorse or promote products derived from this software without
-// specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Standard combined includes:
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include