Skip to content
Open
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
13 changes: 9 additions & 4 deletions .github/workflows/root-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
env:
GITHUB_PR_ORIGIN: ${{ github.event.pull_request.head.repo.clone_url }}
OVERRIDES: ${{ join( matrix.overrides, ' ') }}
run: |

Check failure on line 160 in .github/workflows/root-ci.yml

View workflow job for this annotation

GitHub Actions / lint-action-files

"github.event.pull_request.head.ref" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details
[ -d "${VIRTUAL_ENV_DIR}" ] && source ${VIRTUAL_ENV_DIR}/bin/activate
echo "Python is now $(which python3) $(python3 --version)"
src/.github/workflows/root-ci-config/build_root.py \
Expand Down Expand Up @@ -300,7 +300,7 @@
INCREMENTAL: ${{ !contains(github.event.pull_request.labels.*.name, 'clean build') }}
GITHUB_PR_ORIGIN: ${{ github.event.pull_request.head.repo.clone_url }}
shell: cmd
run: "C:\\setenv.bat ${{ matrix.target_arch }} &&

Check failure on line 303 in .github/workflows/root-ci.yml

View workflow job for this annotation

GitHub Actions / lint-action-files

"github.event.pull_request.head.ref" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details
python .github/workflows/root-ci-config/build_root.py
--buildtype ${{ matrix.config }}
--platform windows10
Expand Down Expand Up @@ -467,7 +467,7 @@
- self-hosted
- linux
- ${{ matrix.architecture == null && 'x64' || matrix.architecture }}
- ${{ matrix.extra-runs-on == null && 'cpu' || matrix.extra-runs-on }}

Check failure on line 470 in .github/workflows/root-ci.yml

View workflow job for this annotation

GitHub Actions / lint-action-files

property "extra-runs-on" is not defined in object type {architecture: string; image: string; is_special: bool; overrides: array<string>; platform_config: string; property: string; python_venv: string}

Check failure on line 470 in .github/workflows/root-ci.yml

View workflow job for this annotation

GitHub Actions / lint-action-files

property "extra-runs-on" is not defined in object type {architecture: string; image: string; is_special: bool; overrides: array<string>; platform_config: string; property: string; python_venv: string}

name: |
${{ matrix.image }} ${{ matrix.property }}
Expand Down Expand Up @@ -609,17 +609,22 @@
ccache -s || true

- name: Install
if: ${{ success() && !matrix.is_special }}
run: "cmake --install ${{ env.BUILD_DIR }} --prefix ${{ env.INSTALL_DIR }}"
id: install
run: cmake --install ${{ env.BUILD_DIR }} --prefix ${{ env.INSTALL_DIR }}

- name: Check headers
if: steps.install.outcome == 'success'
run: bash test/PostInstall/check-headers.sh ${{ env.INSTALL_DIR }}/include/

- name: Build post-install test project
if: ${{ success() && !matrix.is_special }}
id: postInstall
if: steps.install.outcome == 'success'
run: |
cmake -S test/PostInstall/ -B ${{ env.POST_INSTALL_DIR }} -DCMAKE_PREFIX_PATH=${{ env.INSTALL_DIR }};
cmake --build ${{ env.POST_INSTALL_DIR }};

- name: CTest in post-install test project
if: ${{ success() && !matrix.is_special }}
if: steps.postInstall.outcome == 'success' && matrix.property != 'asan'
working-directory: ${{ env.POST_INSTALL_DIR }}
run: ctest --output-on-failure -j $(nproc)

Expand Down
92 changes: 53 additions & 39 deletions cmake/modules/RootMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1223,60 +1223,69 @@ function(ROOT_FIND_DIRS_WITH_HEADERS result_dirs)
endfunction()

#---------------------------------------------------------------------------------------------------
#---ROOT_INSTALL_HEADERS([dir1 dir2 ...] [FILTER <regex>])
# Glob for headers in the folder where this target is defined, and install them in
# <buildDir>/include
#---ROOT_INSTALL_HEADERS([dir1 dir2 ...] [FILTER <regex>] [HEADERS <header1> ...])
# Declare the install command for headers and copy them into <binary_dir>/include.
# This function supports two modes to build the list of headers:
# - [New] If headers are passed explicitly using HEADERS ..., install only these
# - [Old] Otherwise, glob in the specified folders or where this target is defined
#---------------------------------------------------------------------------------------------------
function(ROOT_INSTALL_HEADERS)
CMAKE_PARSE_ARGUMENTS(ARG "OPTIONS" "" "FILTER" ${ARGN})
CMAKE_PARSE_ARGUMENTS(ARG "OPTIONS" "" "FILTER;HEADERS" ${ARGN})
if (${ARG_OPTIONS})
message(FATAL_ERROR "ROOT_INSTALL_HEADERS no longer supports the OPTIONS argument. Rewrite using the FILTER argument.")
endif()
ROOT_FIND_DIRS_WITH_HEADERS(dirs ${ARG_UNPARSED_ARGUMENTS})
set (filter "LinkDef")
set (options REGEX "LinkDef" EXCLUDE)
foreach (f ${ARG_FILTER})
set (filter "${filter}|${f}")
set (options ${options} REGEX "${f}" EXCLUDE)
endforeach()
set (filter "(${filter})")
set(include_files "")
foreach(d ${dirs})
install(DIRECTORY ${d} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT headers
${options})
string(REGEX REPLACE "(.*)/$" "\\1" d ${d})
ROOT_GLOB_FILES(globbed_files
RECURSE
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
FILTER ${filter}
${d}/*.h ${d}/*.hxx ${d}/*.icc )
list(APPEND include_files ${globbed_files})
endforeach()

string(REPLACE ${CMAKE_SOURCE_DIR} "" target_name ${CMAKE_CURRENT_SOURCE_DIR})
string(REPLACE / _ target_name "copy_header_${target_name}")
string(REGEX REPLACE "_$" "" target_name ${target_name})
unset(include_files)

if(ARG_HEADERS)
# Headers have been listed explicitly, find them one by one
foreach(regex ${ARG_FILTER} "LinkDef")
list(FILTER ARG_HEADERS EXCLUDE REGEX "${regex}")
endforeach()
foreach(header ${ARG_HEADERS})
file(GLOB globbed_header ${header} */${header})
if(globbed_header STREQUAL "")
message(SEND_ERROR "No header corresponding to ${header} found in ${CMAKE_CURRENT_SOURCE_DIR}")
endif()
list(APPEND include_files ${globbed_header})
endforeach()
else()
# Glob across all include directories
ROOT_FIND_DIRS_WITH_HEADERS(dirs ${ARG_UNPARSED_ARGUMENTS})
set (filter "LinkDef")
foreach (f ${ARG_FILTER})
set (filter "${filter}|${f}")
endforeach()
set (filter "(${filter})")
foreach(d ${dirs})
string(REGEX REPLACE "(.*)/$" "\\1" d ${d})
ROOT_GLOB_FILES(globbed_files
RECURSE
FILTER ${filter}
${d}/*.h ${d}/*.hxx ${d}/*.icc )
list(APPEND include_files ${globbed_files})
endforeach()
endif()

# Register the files to be copied for each target directory (e.g. include/ include/ROOT include/v7/inc/ ...)
list(REMOVE_DUPLICATES include_files)
list(TRANSFORM include_files REPLACE "(.*)/[^/]*" "\\1/" OUTPUT_VARIABLE subdirs)
list(REMOVE_DUPLICATES subdirs)
foreach(subdir ${subdirs})
string(REGEX REPLACE ".*/inc/" "" destination_subdir ${subdir})

set(input_files ${include_files})
list(FILTER input_files INCLUDE REGEX "^${subdir}[^/]*$")
set(output_files ${input_files})

string(REGEX REPLACE ".*/*inc/" "" destination ${subdir})
install(FILES ${input_files} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${destination_subdir} COMPONENT headers)

list(TRANSFORM input_files PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/")
list(TRANSFORM output_files REPLACE ".*/" "${CMAKE_BINARY_DIR}/include/${destination}")

set(destination destination_${destination})
set(output_files ${input_files})
list(TRANSFORM output_files REPLACE ".*/" "${CMAKE_BINARY_DIR}/include/${destination_subdir}")

set_property(GLOBAL APPEND PROPERTY ROOT_HEADER_COPY_LISTS ${destination})
set_property(GLOBAL APPEND PROPERTY ROOT_HEADER_INPUT_${destination} ${input_files})
set_property(GLOBAL APPEND PROPERTY ROOT_HEADER_OUTPUT_${destination} ${output_files})
set(destination_target_name destination_${destination_subdir})
set_property(GLOBAL APPEND PROPERTY ROOT_HEADER_COPY_LISTS ${destination_target_name})
set_property(GLOBAL APPEND PROPERTY ROOT_HEADER_INPUT_${destination_target_name} ${input_files})
set_property(GLOBAL APPEND PROPERTY ROOT_HEADER_OUTPUT_${destination_target_name} ${output_files})
endforeach()
endfunction()

Expand Down Expand Up @@ -1317,6 +1326,7 @@ endmacro()
#---------------------------------------------------------------------------------------------------
#---ROOT_STANDARD_LIBRARY_PACKAGE(libname
# [NO_INSTALL_HEADERS] : don't install headers for this package
# [NO_GLOB_HEADERS] : don't glob for headers, only install listed ones
# [STAGE1] : use rootcling_stage1 for generating
# HEADERS header1 header2 : relative header path as #included; pass -I to find them. If not specified, globbing for *.h is used
# NODEPHEADERS header1 header2 : like HEADERS, but no dependency is generated
Expand All @@ -1335,7 +1345,7 @@ endmacro()
# )
#---------------------------------------------------------------------------------------------------
function(ROOT_STANDARD_LIBRARY_PACKAGE libname)
set(options NO_INSTALL_HEADERS STAGE1 NO_HEADERS NO_SOURCES OBJECT_LIBRARY NO_CXXMODULE)
set(options NO_INSTALL_HEADERS NO_GLOB_HEADERS STAGE1 NO_HEADERS NO_SOURCES OBJECT_LIBRARY NO_CXXMODULE)
set(oneValueArgs LINKDEF)
set(multiValueArgs DEPENDENCIES HEADERS NODEPHEADERS SOURCES BUILTINS LIBRARIES DICTIONARY_OPTIONS INSTALL_OPTIONS)
CMAKE_PARSE_ARGUMENTS(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
Expand Down Expand Up @@ -1441,7 +1451,11 @@ function(ROOT_STANDARD_LIBRARY_PACKAGE libname)
# Install headers if we have any headers and if the user didn't explicitly
# disabled this.
if (NOT ARG_NO_INSTALL_HEADERS OR ARG_NO_HEADERS)
ROOT_INSTALL_HEADERS(${ARG_INSTALL_OPTIONS})
if(ARG_NO_GLOB_HEADERS)
ROOT_INSTALL_HEADERS(${ARG_INSTALL_OPTIONS} HEADERS ${ARG_HEADERS})
else()
ROOT_INSTALL_HEADERS(${ARG_INSTALL_OPTIONS})
endif()
endif()
endfunction()

Expand Down
2 changes: 1 addition & 1 deletion core/imt/inc/ROOT/TThreadExecutor.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#ifndef R__USE_IMT
// No need to error out for dictionaries.
# if !defined(__ROOTCLING__) && !defined(G__DICTIONARY)
# error "Cannot use ROOT::TThreadExecutor without defining R__USE_IMT."
#error "Cannot use ROOT::TThreadExecutor when build option imt=Off."
# endif
#else

Expand Down
8 changes: 8 additions & 0 deletions geom/geom/inc/TGeoTypedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
/// Typedefs used by the geometry group
#include <vector>

namespace ROOT::Geom {
struct Vertex_t;
}

namespace ROOT::Geom {
struct Vertex_t;
}

namespace Tessellated {

using Vertex_t = ROOT::Geom::Vertex_t;
Expand Down
1 change: 1 addition & 0 deletions geom/geom/inc/TGeoVoxelGrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <array>
#include <cmath>
#include <limits>
#include <vector>

// a simple structure to encode voxel indices, to address
// individual voxels in the 3D grid.
Expand Down
47 changes: 47 additions & 0 deletions test/PostInstall/check-headers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

# Adapted from the XRootD project with friendly permission from G. Amadio.
#
# This script checks that each installed ROOT header can be included individually
# without errors. The intention is to identify which headers may have missing
# includes, missing forward declarations, or missing header dependencies, that is,
# headers from ROOT which it includes, but were not installed by the install target.

# We need to split CXXFLAGS
# shellcheck disable=SC2086

: "${INCLUDE_DIR:=${1}}"
: "${CXX:=$(${INCLUDE_DIR}/../bin/root-config --cxx || echo c++)}"
: "${CXXFLAGS:=-Wall -Wextra -Wno-unused-parameter -Wno-unused-const-variable}"
: "${NCPU:=$(getconf _NPROCESSORS_ONLN)}"
: "${CXXSTANDARD:=$(${INCLUDE_DIR}/../bin/root-config --cxxstandard || echo 17)}"

if ! command -v "${CXX}" >/dev/null; then
echo "Please set CXX to a valid compiler"
exit 2
fi
if [ ! -d "${INCLUDE_DIR}" ]; then
echo "Usage: ${0} <ROOT include directory>"
echo "Alternatively, set INCLUDE_DIR in the environment"
exit 2
fi


# Check all installed headers for include errors. Some headers cannot be used standalone:
suppressions="TMVA\|vdt" # External
suppressions+="\|RField[A-Z]\|RtypesImp.h\|TAtomicCount[A-Z]\|CladDerivator.h\|TBranchProxyTemplate" # Not to be used standalone
suppressions+="\|TWin32" # Why are these installed in Linux?
suppressions+="\|xRooHypoSpace.h\|xRooFit" # Uses macros to declare namespaces
suppressions+="\|RDaos.h" # Might not be installed
suppressions+="\|RIoUring.hxx" # Might not be installed
suppressions+="\|CPyCppyy/DispatchPtr.h\|CPyCppyy/API.h" # Would need to include Python.h
suppressions+="\|/bvh" # Includes a non-functioning std::span in c++17
suppressions+="\|cfortran.h" # Seems unable to run with modern compilers
suppressions+="\|hipSYCL.h\|GenVectorX" # Unconditionally installed on Fedora/Ubuntu even if broken
suppressions+="\|TR[A-Z].*__ctors.h" # R interface without any includes, so cannot be parsed as C++
suppressions+="\|RTaskArena.hxx\|TThreadExecutor.hxx\|TTreeProcessorMT.hxx" # Will raise errors if imt=Off

HEADERS=$(find "${INCLUDE_DIR}" -type f -name '*.h*' | grep -v "${suppressions}")

xargs -P ${NCPU:-1} -n 1 "${CXX}" -fsyntax-only -x c++ -std=c++${CXXSTANDARD} ${CXXFLAGS} -I"${INCLUDE_DIR}" <<< "${HEADERS}"

1 change: 1 addition & 0 deletions tree/dataframe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ if (runtime_cxxmodules AND WIN32)
endif()

ROOT_STANDARD_LIBRARY_PACKAGE(ROOTDataFrame
NO_GLOB_HEADERS # Don't install RArrowDS and similar if they are off
HEADERS
ROOT/RCsvDS.hxx
ROOT/RVecDS.hxx
Expand Down
10 changes: 10 additions & 0 deletions tree/ntuple/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ if(daos OR daos_mock)
endif()

ROOT_STANDARD_LIBRARY_PACKAGE(ROOTNTuple
NO_GLOB_HEADERS # Ensure that the optional headers above only get installed when enabled
HEADERS
ROOT/RCluster.hxx
ROOT/RClusterPool.hxx
Expand Down Expand Up @@ -123,6 +124,15 @@ DEPENDENCIES
${ROOTNTuple_OPTIONAL_DEPENDENCIES}
)

# Non-standalone headers must be left out of the dictionary, so a dedicated install command is required.
ROOT_INSTALL_HEADERS(HEADERS
ROOT/RField/RFieldFundamental.hxx
ROOT/RField/RFieldProxiedCollection.hxx
ROOT/RField/RFieldRecord.hxx
ROOT/RField/RFieldSequenceContainer.hxx
ROOT/RField/RFieldSoA.hxx
ROOT/RField/RFieldSTLMisc.hxx)

target_link_libraries(ROOTNTuple PRIVATE xxHash::xxHash)

# Enable RNTuple support for Intel DAOS
Expand Down
Loading