diff --git a/.github/workflows/root-ci-config/build_root.py b/.github/workflows/root-ci-config/build_root.py index ed9303effd695..ca8069a20dbd0 100755 --- a/.github/workflows/root-ci-config/build_root.py +++ b/.github/workflows/root-ci-config/build_root.py @@ -46,12 +46,16 @@ CONNECTION = None WINDOWS = (os.name == 'nt') -WORKDIR = (os.environ['HOME'] + '/ROOT-CI') if not WINDOWS else 'C:/ROOT-CI' +try: + WORKDIR = (os.environ['GITHUB_WORKSPACE']) +except: + WORKDIR = (os.environ['HOME'] + '/ROOT-CI') if not WINDOWS else 'C:/ROOT-CI' COMPRESSIONLEVEL = 6 if not WINDOWS else 1 def main(): # openstack.enable_logging(debug=True) + print("WORKDIR=" + WORKDIR) # used when uploading artifacts, calculate early since build times are inconsistent yyyy_mm_dd = datetime.datetime.today().strftime('%Y-%m-%d') @@ -65,7 +69,8 @@ def main(): if not pull_request: build_utils.print_info("head_ref same as base_ref, assuming non-PR build") - cleanup_previous_build() + if WINDOWS: + cleanup_previous_build() # Load CMake options from .github/workflows/root-ci-config/buildconfig/[platform].txt this_script_dir = os.path.dirname(os.path.abspath(__file__)) @@ -73,7 +78,8 @@ def main(): options_dict = { **load_config(f'{this_script_dir}/buildconfig/global.txt'), # file below overwrites values from above - **load_config(f'{this_script_dir}/buildconfig/{args.platform}.txt') + **load_config(f'{this_script_dir}/buildconfig/{args.platform}.txt'), + **load_config(f'buildconfig_overrides.txt') } options = build_utils.cmake_options_from_dict(options_dict) @@ -113,7 +119,8 @@ def main(): build_utils.print_warning(f'Failed to download: {err}') args.incremental = False - git_pull("src", args.repository, args.base_ref) + if WINDOWS: + git_pull("src", args.repository, args.base_ref) if pull_request: base_head_sha = get_base_head_sha("src", args.repository, args.sha, args.head_sha) @@ -121,7 +128,7 @@ def main(): head_ref_src, _, head_ref_dst = args.head_ref.partition(":") head_ref_dst = head_ref_dst or "__tmp" - rebase("src", "origin", base_head_sha, head_ref_dst, args.head_sha) + #rebase("src", "origin", base_head_sha, head_ref_dst, args.head_sha) testing: bool = options_dict['testing'].lower() == "on" @@ -226,11 +233,6 @@ def cleanup_previous_build(): }} New-Item -Force -Type directory -Path {WORKDIR} """) - else: - # mac/linux/POSIX - result = subprocess_with_log(f""" - rm -rf {WORKDIR}/* - """) if result != 0: die(result, "Failed to clean up previous artifacts") @@ -278,9 +280,9 @@ def download_artifacts(obj_prefix: str): # TODO: Simplify after ROOT is Python 3.12+ only # c.f. https://docs.python.org/3.12/library/tarfile.html#extraction-filters if hasattr(tarfile, "data_filter"): - tar.extractall(WORKDIR, filter="data") + tar.extract("build", WORKDIR, filter="data") else: - tar.extractall(WORKDIR) + tar.extract("build", WORKDIR) build_utils.log.add(f'\ncd {WORKDIR} && tar -xf {tar_path}\n') diff --git a/.github/workflows/root-ci.yml b/.github/workflows/root-ci.yml index c7b7a82168116..378b47ba458f4 100644 --- a/.github/workflows/root-ci.yml +++ b/.github/workflows/root-ci.yml @@ -93,7 +93,7 @@ jobs: contents: read strategy: - fail-fast: false + fail-fast: true matrix: # Specify platform + arch + (optional) build option overrides # @@ -119,14 +119,17 @@ jobs: - ${{ matrix.platform }} name: | - ${{ matrix.platform }} ${{ matrix.arch }} + ${{ matrix.platform }} ${{ matrix.arch }} ${{ (github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' && join( matrix.overrides, ', ' )) || '' }} steps: + - name: Cleanup workdir + run: rm -rf ${{ github.workspace }}/* + - name: Checkout uses: actions/checkout@v4 with: - ref: ${{ inputs.ref_name }} + path: "src" - name: Apply option overrides from matrix for this job for non-release builds if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' && matrix.overrides != NaN }} @@ -159,7 +162,7 @@ jobs: - name: Set up curl CA bundle for Davix to work with https run: 'echo SSL_CERT_FILE=/opt/local/share/curl/curl-ca-bundle.crt >> $GITHUB_ENV' - + - name: Pull Request Build shell: bash -leo pipefail {0} if: github.event_name == 'pull_request' @@ -231,13 +234,7 @@ jobs: build-windows: # For any event that is not a PR, the CI will always run. In PRs, the CI # can be skipped if the tag [skip-ci] or [skip ci] is written in the title. - if: | - (github.repository_owner == 'root-project' && github.event_name != 'pull_request') || - (github.event_name == 'pull_request' && !( - contains(github.event.pull_request.title, '[skip-ci]') || - contains(github.event.pull_request.title, '[skip ci]') || - contains(github.event.pull_request.labels.*.name, 'skip ci') - )) + if: false permissions: contents: read @@ -276,7 +273,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - ref: ${{ inputs.ref_name }} + path: "src" - name: Pull Request Build if: github.event_name == 'pull_request' @@ -378,50 +375,50 @@ jobs: include: - image: fedora42 overrides: ["CMAKE_CXX_STANDARD=23"] - - image: fedora43 - overrides: ["CMAKE_CXX_STANDARD=23"] - is_special: true - - image: alma8 - - image: alma9 - overrides: ["CMAKE_BUILD_TYPE=Debug"] - - image: alma10 - - image: ubuntu22 - overrides: ["imt=Off", "CMAKE_BUILD_TYPE=Debug"] - - image: ubuntu2404 - overrides: ["CMAKE_BUILD_TYPE=Debug"] - - image: ubuntu2504 - overrides: ["CMAKE_CXX_STANDARD=23"] - - image: ubuntu2510 - is_special: true - overrides: ["CMAKE_CXX_STANDARD=23"] - - image: debian125 - overrides: ["CMAKE_CXX_STANDARD=20", "dev=ON", "CMAKE_CXX_FLAGS=-Wsuggest-override"] - - image: debian13 - overrides: ["dev=ON", "CMAKE_CXX_FLAGS=-Wsuggest-override"] - # Special builds - - image: alma9 - is_special: true - property: modules_off - overrides: ["runtime_cxxmodules=Off"] - - image: alma9 - is_special: true - property: march_native - overrides: ["CMAKE_BUILD_TYPE=RelWithDebInfo", "CMAKE_CXX_FLAGS=-march=native", "CMAKE_C_FLAGS=-march=native", "builtin_zlib=ON", "builtin_zstd=ON"] - - image: alma9 - is_special: true - property: arm64 - overrides: ["CMAKE_BUILD_TYPE=RelWithDebInfo", "builtin_zlib=ON", "builtin_zstd=ON"] - architecture: ARM64 - - image: alma10 - is_special: true - property: "clang Ninja" - overrides: ["CMAKE_C_COMPILER=clang", "CMAKE_CXX_COMPILER=clang++"] - cmake_generator: Ninja - # Fedora Rawhide with Python debug build - - image: rawhide - is_special: true - property: "Fedora pydebug" - overrides: ["CMAKE_CXX_STANDARD=23"] +# - image: fedora43 +# overrides: ["CMAKE_CXX_STANDARD=23"] +# is_special: true +# - image: alma8 +# - image: alma9 +# overrides: ["CMAKE_BUILD_TYPE=Debug"] +# - image: alma10 +# - image: ubuntu22 +# overrides: ["imt=Off", "CMAKE_BUILD_TYPE=Debug"] +# - image: ubuntu2404 +# overrides: ["CMAKE_BUILD_TYPE=Debug"] +# - image: ubuntu2504 +# overrides: ["CMAKE_CXX_STANDARD=23"] +# - image: ubuntu2510 +# is_special: true +# overrides: ["CMAKE_CXX_STANDARD=23"] +# - image: debian125 +# overrides: ["CMAKE_CXX_STANDARD=20", "dev=ON", "CMAKE_CXX_FLAGS=-Wsuggest-override"] +# - image: debian13 +# overrides: ["dev=ON", "CMAKE_CXX_FLAGS=-Wsuggest-override"] +# # Special builds +# - image: alma9 +# is_special: true +# property: modules_off +# overrides: ["runtime_cxxmodules=Off"] +# - image: alma9 +# is_special: true +# property: march_native +# overrides: ["CMAKE_BUILD_TYPE=RelWithDebInfo", "CMAKE_CXX_FLAGS=-march=native", "CMAKE_C_FLAGS=-march=native", "builtin_zlib=ON", "builtin_zstd=ON"] +# - image: alma9 +# is_special: true +# property: arm64 +# overrides: ["CMAKE_BUILD_TYPE=RelWithDebInfo", "builtin_zlib=ON", "builtin_zstd=ON"] +# architecture: ARM64 +# - image: alma10 +# is_special: true +# property: "clang Ninja" +# overrides: ["CMAKE_C_COMPILER=clang", "CMAKE_CXX_COMPILER=clang++"] +# cmake_generator: Ninja +# # Fedora Rawhide with Python debug build +# - image: rawhide +# is_special: true +# property: "Fedora pydebug" +# overrides: ["CMAKE_CXX_STANDARD=23"] # Disable GPU builds until the DNS problem is solved # - image: ubuntu2404-cuda # is_special: true @@ -447,23 +444,39 @@ jobs: CONTAINER_IMAGE: "registry.cern.ch/root-ci/${{ matrix.image }}:buildready" #KEEP IN SYNC WITH ABOVE CONTAINER_OPTIONS: "--security-opt label=disable --rm ${{ matrix.property == 'gpu' && '--device nvidia.com/gpu=all' || '' }}" #KEEP IN SYNC WITH ABOVE - env: - BUILD_DIR: /github/home/ROOT-CI/build - INSTALL_DIR: /github/home/ROOT-CI/install - POST_INSTALL_DIR: /github/home/ROOT-CI/PostInstall - steps: - - name: Configure large ccache - if: ${{ matrix.is_special }} + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJSON(github) }} + JOB_CONTEXT: ${{ toJSON(job) }} + ENV_CONTEXT: ${{ toJSON(env) }} run: | - ccache -o max_size=5G - ccache -p || true - ccache -s || true + echo "$GITHUB_CONTEXT" + echo "--------------------------" + echo "$JOB_CONTEXT" + echo "--------------------------" + echo "$ENV_CONTEXT" - - name: Configure small ccache - if: ${{ !matrix.is_special }} + # The github.workspace context variable returns the path *outside* of the container. + # Therefore, we need to define environment variables inside the container + - name: Define environment run: | - ccache -o max_size=1.5G + echo "SRC_DIR=${GITHUB_WORKSPACE}/src" >> "$GITHUB_ENV" + echo "BUILD_DIR=${GITHUB_WORKSPACE}/build" >> "$GITHUB_ENV" + echo "INSTALL_DIR=${GITHUB_WORKSPACE}/install" >> "$GITHUB_ENV" + echo "POST_INSTALL_DIR=${GITHUB_WORKSPACE}/postInstall" >> "$GITHUB_ENV" + + - name: Cleanup home + run: rm -rf ${GITHUB_WORKSPACE}/* ${GITHUB_WORKSPACE}/.github + + - name: Directory tree + run: ls -la + + - name: Configure ccache + env: + CCACHE_SIZE: ${{ matrix.is_special && '5G' || '1.5G' }} + run: | + ccache -o max_size=${CCACHE_SIZE} ccache -p || true ccache -s || true @@ -476,19 +489,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - ref: ${{ inputs.ref_name }} - - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJSON(github) }} - JOB_CONTEXT: ${{ toJSON(job) }} - ENV_CONTEXT: ${{ toJSON(env) }} - run: | - echo "$GITHUB_CONTEXT" - echo "--------------------------" - echo "$JOB_CONTEXT" - echo "--------------------------" - echo "$ENV_CONTEXT" + path: "src" - name: Print debug info run: 'printf "%s@%s\\n" "$(whoami)" "$(hostname)"; @@ -499,7 +500,7 @@ jobs: if: ${{ ( github.event_name != 'schedule' || matrix.is_special) && github.event_name != 'workflow_dispatch' && matrix.overrides != NaN }} env: OVERRIDES: ${{ join( matrix.overrides, ' ') }} - CONFIGFILE: '.github/workflows/root-ci-config/buildconfig/${{ matrix.image }}.txt' + CONFIGFILE: 'buildconfig_overrides.txt' shell: bash run: | set -x @@ -530,7 +531,7 @@ jobs: INCREMENTAL: ${{ !contains(github.event.pull_request.labels.*.name, 'clean build') }} GITHUB_PR_ORIGIN: ${{ github.event.pull_request.head.repo.clone_url }} CMAKE_GENERATOR: ${{ matrix.cmake_generator }} - run: ".github/workflows/root-ci-config/build_root.py + run: "${SRC_DIR}/.github/workflows/root-ci-config/build_root.py --buildtype RelWithDebInfo --platform ${{ matrix.image }} --dockeropts \"$CONTAINER_OPTIONS\" @@ -597,16 +598,17 @@ jobs: ccache -s || true - name: Install - run: "cmake --install ${{ env.BUILD_DIR }} --prefix ${{ env.INSTALL_DIR }}" + run: "cmake --install ${BUILD_DIR} --prefix ${INSTALL_DIR}" - name: Build post-install test project run: | - cmake -S test/PostInstall/ -B ${{ env.POST_INSTALL_DIR }} -DCMAKE_PREFIX_PATH=${{ env.INSTALL_DIR }}; - cmake --build ${{ env.POST_INSTALL_DIR }}; + cmake -S test/PostInstall/ -B ${POST_INSTALL_DIR} -DCMAKE_PREFIX_PATH=${INSTALL_DIR}; + cmake --build ${POST_INSTALL_DIR}; - name: CTest in post-install test project - working-directory: ${{ env.POST_INSTALL_DIR }} - run: ctest -j $(nproc) + run: | + cd ${POST_INSTALL_DIR} + test -j $(nproc) event_file: # For any event that is not a PR, the CI will always run. In PRs, the CI diff --git a/roofit/roofit/src/RooGaussian.cxx b/roofit/roofit/src/RooGaussian.cxx index f9741f66c3ffb..da1194c4b3302 100644 --- a/roofit/roofit/src/RooGaussian.cxx +++ b/roofit/roofit/src/RooGaussian.cxx @@ -55,6 +55,7 @@ RooGaussian::RooGaussian(const RooGaussian& other, const char* name) : double RooGaussian::evaluate() const { + return RooFit::Detail::MathFuncs::gaussian(x, mean, sigma); }