Skip to content

Commit

Permalink
Merge branch 'master' into docs-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
couet authored Dec 13, 2024
2 parents 32873bb + 367a3bb commit 5fb4db7
Show file tree
Hide file tree
Showing 1,546 changed files with 41,386 additions and 26,120 deletions.
2 changes: 1 addition & 1 deletion .ci/format_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -ex

echo "Running clang-format against branch $TRAVIS_BRANCH, with hash $BASE_COMMIT"
COMMIT_FILES=$(git diff --name-status $BASE_COMMIT | grep -i -v LinkDef | grep -v -E '^D +' | sed -E 's,^.[[:space:]]+,,')
COMMIT_FILES=$(git diff --name-status $BASE_COMMIT | grep -i -v '.mjs$' | grep -i -v LinkDef | grep -v -E '^D +' | sed -E 's,^.[[:space:]]+,,')

RESULT_OUTPUT="no modified files to format"
if [ ! -z "$COMMIT_FILES" ]; then
Expand Down
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: true
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/code_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on: pull_request
# pull_request:
# branches: [ $default-branch ]

permissions:
contents: read

jobs:
clang-format:
# For any event that is not a PR, the CI will always run. In PRs, the CI
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/root-634.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

name: 'ROOT 6.34'

on:
schedule:
- cron: '01 1 * * *'

workflow_dispatch:
inputs:
incremental:
description: 'Do incremental build'
type: boolean
required: true
default: true
binaries:
description: Create binary packages and upload them as artifacts
type: boolean
required: true
default: false
buildtype:
description: The CMAKE_BUILD_TYPE to use for non-Windows.
type: choice
options:
- Debug
- RelWithDebInfo
- Release
- MinSizeRel
default: Debug
required: true

jobs:
run_nightlies:
uses: root-project/root/.github/workflows/root-ci.yml@v6-34-00-patches
secrets: inherit
15 changes: 11 additions & 4 deletions .github/workflows/root-ci-config/build_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import subprocess
import sys
import tarfile
import time

import openstack

Expand Down Expand Up @@ -253,10 +254,9 @@ def cleanup_previous_build():
def git_pull(directory: str, repository: str, branch: str):
returncode = 1

for _ in range(5):
if returncode == 0:
break

max_attempts = 6
sleep_time_unit = 3
for attempt in range(1, max_attempts+1):
targetdir = os.path.join(WORKDIR, directory)
if os.path.exists(os.path.join(targetdir, ".git")):
returncode = subprocess_with_log(f"""
Expand All @@ -269,6 +269,13 @@ def git_pull(directory: str, repository: str, branch: str):
returncode = subprocess_with_log(f"""
git clone --branch {branch} --single-branch {repository} "{targetdir}"
""")

if returncode == 0:
return

sleep_time = sleep_time_unit * attempt
build_utils.print_warning(f"""Attempt {attempt}: failed to pull/clone branch. Retrying in {sleep_time} seconds...""")
time.sleep(sleep_time)

if returncode != 0:
die(returncode, f"Failed to pull {branch}")
Expand Down
36 changes: 27 additions & 9 deletions .github/workflows/root-ci-config/build_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,18 +230,36 @@ def upload_file(connection: Connection, container: str, dest_object: str, src_fi
if not os.path.exists(src_file):
raise Exception(f"No such file: {src_file}")

def create_object_local():
connection.create_object(
container=container,
name=dest_object,
filename=src_file,
segment_size=5*gigabyte,
**{
'X-Delete-After': str(2*week_in_seconds)
}
)

gigabyte = 1024**3
week_in_seconds = 60*60*24*7

connection.create_object(
container=container,
name=dest_object,
filename=src_file,
segment_size=5*gigabyte,
**{
'X-Delete-After': str(2*week_in_seconds)
}
)
max_attempts = 5
sleep_time_unit = 4
success = False
for attempt in range(1, max_attempts+1):
try:
create_object_local()
success = True
except:
success = False
sleep_time = sleep_time_unit * attempt
build_utils.print_warning(f"""Attempt {attempt} to upload {src_file} to {dest_object} failed. Retrying in {sleep_time} seconds...""")
time.sleep(sleep_time)
if success: break

# We try one last time
create_object_local()

print(f"Successfully uploaded to {dest_object}")

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/root-ci-config/buildconfig/alma8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ builtin_tbb=ON
builtin_vdt=On
fortran=OFF
tmva-sofie=On
ccache=On
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ builtin_nlohmannjson=ON
builtin_vdt=On
tmva-sofie=On
BLA_VENDOR=OpenBLAS
ccache=On
1 change: 1 addition & 0 deletions .github/workflows/root-ci-config/buildconfig/alma9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ builtin_nlohmannjson=ON
builtin_vdt=On
tmva-sofie=On
BLA_VENDOR=OpenBLAS
ccache=On
3 changes: 2 additions & 1 deletion .github/workflows/root-ci-config/buildconfig/debian125.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pythia8=OFF
mysql=OFF
mysql=OFF
ccache=On
2 changes: 1 addition & 1 deletion .github/workflows/root-ci-config/buildconfig/fedora39.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
builtin_nlohmannjson=On
builtin_vdt=On
pythia8=Off
ccache=On
5 changes: 5 additions & 0 deletions .github/workflows/root-ci-config/buildconfig/fedora40.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
builtin_zstd=ON
builtin_zlib=ON
builtin_nlohmannjson=On
builtin_vdt=On
ccache=On
6 changes: 6 additions & 0 deletions .github/workflows/root-ci-config/buildconfig/fedora41.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
builtin_zstd=ON
builtin_zlib=ON
builtin_nlohmannjson=On
builtin_vdt=On
pythia8=Off
ccache=On
2 changes: 1 addition & 1 deletion .github/workflows/root-ci-config/buildconfig/global.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ clingtest=OFF
cocoa=OFF
coverage=OFF
cuda=OFF
cudnn=OFF
cxxmodules=OFF
daos=OFF
dataframe=ON
Expand Down Expand Up @@ -95,6 +94,7 @@ test_distrdf_pyspark=ON
testing=ON
tmva-cpu=ON
tmva-gpu=OFF
tmva-cudnn=OFF
tmva-pymva=ON
tmva-rmva=OFF
tmva-sofie=OFF
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/root-ci-config/buildconfig/ubuntu20.txt

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/root-ci-config/buildconfig/ubuntu22.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
builtin_vdt=ON
pythia8=OFF
r=ON
tmva-sofie=ON
ccache=On
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ CMAKE_BUILD_TYPE=RelWithDebInfo
pythia8=OFF
cuda=ON
ccache=ON
cudnn=ON
tmva=ON
tmva-cpu=ON
tmva-gpu=ON
tmva-cudnn=ON
tmva-pymva=ON
fortran=OFF
gdml=OFF
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/root-ci-config/buildconfig/ubuntu2404.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pythia8=OFF
tmva-cpu=OFF
tmva-sofie=ON
ccache=On
3 changes: 3 additions & 0 deletions .github/workflows/root-ci-config/buildconfig/ubuntu2410.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pythia8=OFF
tmva-cpu=OFF
ccache=On
31 changes: 21 additions & 10 deletions .github/workflows/root-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -356,18 +356,20 @@ jobs:
# Common configs: {Release,Debug,RelWithDebInfo)
# Build options: https://root.cern/install/build_from_source/#all-build-options
include:
- image: fedora39
- image: fedora40
overrides: ["LLVM_ENABLE_ASSERTIONS=On", "CMAKE_CXX_STANDARD=20"]
- image: fedora41
overrides: ["LLVM_ENABLE_ASSERTIONS=On"]
- image: alma8
overrides: ["LLVM_ENABLE_ASSERTIONS=On"]
- image: alma9
overrides: ["LLVM_ENABLE_ASSERTIONS=On", "CMAKE_BUILD_TYPE=Debug"]
- image: ubuntu20
overrides: ["LLVM_ENABLE_ASSERTIONS=On"]
- image: ubuntu22
overrides: ["imt=Off", "LLVM_ENABLE_ASSERTIONS=On", "CMAKE_BUILD_TYPE=Debug"]
- image: ubuntu2404
overrides: ["LLVM_ENABLE_ASSERTIONS=On", "CMAKE_BUILD_TYPE=Debug"]
- image: ubuntu2410
overrides: ["LLVM_ENABLE_ASSERTIONS=On", "CMAKE_BUILD_TYPE=Debug"]
- image: debian125
overrides: ["LLVM_ENABLE_ASSERTIONS=On", "CMAKE_CXX_STANDARD=20"]
# Special builds
Expand All @@ -382,16 +384,17 @@ jobs:
- image: alma9
is_special: true
property: arm64
overrides: ["CMAKE_BUILD_TYPE=RelWithDebInfo", "ccache=ON"]
overrides: ["CMAKE_BUILD_TYPE=RelWithDebInfo"]
architecture: ARM64
- image: alma9-clang
is_special: true
property: clang
overrides: ["LLVM_ENABLE_ASSERTIONS=On", "CMAKE_C_COMPILER=clang", "CMAKE_CXX_COMPILER=clang++"]
- image: ubuntu2404-cuda
is_special: true
property: gpu
extra-runs-on: gpu
# Disable GPU builds until the DNS problem is solved
# - image: ubuntu2404-cuda
# is_special: true
# property: gpu
# extra-runs-on: gpu

runs-on:
- self-hosted
Expand Down Expand Up @@ -421,8 +424,17 @@ jobs:
CONTAINER_OPTIONS: "--security-opt label=disable --rm ${{ matrix.property == 'gpu' && '--device nvidia.com/gpu=all' || '' }}" #KEEP IN SYNC WITH ABOVE

steps:
- name: ccache info
- name: Configure large ccache
if: ${{ matrix.is_special }}
run: |
ccache -o max_size=5G
ccache -p || true
ccache -s || true
- name: Configure small ccache
if: ${{ !matrix.is_special }}
run: |
ccache -o max_size=1.5G
ccache -p || true
ccache -s || true
Expand Down Expand Up @@ -552,7 +564,6 @@ jobs:

- name: ccache info (post)
run: |
ccache -p || true
ccache -s || true
event_file:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-result-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
do
IFS=$'\t' read name url <<< "$artifact"
gh api $url > "$name.zip"
unzip -d "$name" "$name.zip"
unzip -d "$name" -o "$name.zip"
done
- name: Publish Test Results
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ compile_commands.json
documentation/doxygen/*.eps
documentation/doxygen/*.pcm
documentation/doxygen/*.jpg
documentation/doxygen/*.root
documentation/doxygen/*.csv
documentation/doxygen/*.png
documentation/doxygen/*.pdf
documentation/doxygen/*.dot

# Pycache
__pycache__
17 changes: 12 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ if(WIN32)
# Set CMP0091 (MSVC runtime library flags are selected by an abstraction) to OLD
# to keep the old way of selecting the runtime library with the -MD/-MDd compiler flag
cmake_policy(SET CMP0091 OLD)
set(CMAKE_SKIP_TEST_ALL_DEPENDENCY TRUE)
endif()

if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT ALLOW_IN_SOURCE)
Expand Down Expand Up @@ -124,7 +125,7 @@ function(relatedrepo_GetClosestMatch)

# Otherwise, try to use a branch that matches `current_head` in the fork repository
execute_process(COMMAND ${GIT_EXECUTABLE} ls-remote --heads --tags
${__ORIGIN_PREFIX}/${__REPO_NAME} ${current_head} OUTPUT_VARIABLE matching_refs)
${__ORIGIN_PREFIX}/${__REPO_NAME} ${current_head} OUTPUT_VARIABLE matching_refs ERROR_QUIET)
if(NOT "${matching_refs}" STREQUAL "")
set(${__FETCHURL_VARIABLE} ${__ORIGIN_PREFIX}/${__REPO_NAME} PARENT_SCOPE)
return()
Expand Down Expand Up @@ -361,7 +362,9 @@ add_subdirectory (montecarlo)
if(geom)
add_subdirectory (geom)
endif()
add_subdirectory (rootx)
if(NOT WIN32)
add_subdirectory (rootx)
endif()
add_subdirectory (misc)
add_subdirectory (main)
add_subdirectory (bindings)
Expand Down Expand Up @@ -643,8 +646,12 @@ if(testing)
endif()
if(DEFINED repo_dir)
execute_process(COMMAND ${GIT_EXECUTABLE} --git-dir=${repo_dir}/.git
remote get-url origin OUTPUT_VARIABLE originurl OUTPUT_STRIP_TRAILING_WHITESPACE)

remote get-url origin OUTPUT_VARIABLE originurl OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE query_result
ERROR_VARIABLE query_error)
if(NOT query_result EQUAL 0)
message(STATUS "Searching for \"origin\" repo of roottest: ${query_error}")
endif()
else()
# The fetch URL of the 'origin' remote is used to determine the prefix for other repositories by
# removing the `/root(\.git)?` part. If `GITHUB_PR_ORIGIN` is defined in the environment, its
Expand All @@ -656,7 +663,7 @@ if(testing)
remote get-url origin OUTPUT_VARIABLE originurl OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
endif()
string(REGEX REPLACE "/root(test)?(\.git)?$" "" originprefix ${originurl})
string(REGEX REPLACE "/root(test)?(\.git)?$" "" originprefix "${originurl}")
relatedrepo_GetClosestMatch(REPO_NAME roottest
ORIGIN_PREFIX ${originprefix} UPSTREAM_PREFIX ${upstreamprefix}
FETCHURL_VARIABLE roottest_url FETCHREF_VARIABLE roottest_ref)
Expand Down
Loading

0 comments on commit 5fb4db7

Please sign in to comment.