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
24 changes: 4 additions & 20 deletions .github/workflows/root-ci-config/build_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def main():
# the target branch in the ROOT repository using base_ref and head_ref:
# - The base_ref is e.g. "master" or "v6-38-00-patches"
# - The head_ref for PRs is formatted as <PR branch>:<Fork branch> e.g. "refs/pull/20742/head:cppyy_fixup"
if not ":" in args.head_ref:
if ":" not in args.head_ref:
build_utils.print_error(f"This has been identified as a PR build. However, the head-ref is {args.head_ref}.")
branch_in_fork = args.head_ref.split(":")[-1]
if branch_in_fork == args.base_ref:
Expand All @@ -85,7 +85,7 @@ def main():

if "minimal" in platform_options and platform_options["minimal"] == "ON":
options_dict = platform_options
print(f"Minimal build detected in the platform options. Ignoring global configuration.")
print("Minimal build detected in the platform options. Ignoring global configuration.")
else:
options_dict.update(platform_options)
print(f"Build option overrides for {args.platform_config}:")
Expand Down Expand Up @@ -413,26 +413,13 @@ def cmake_configure(options, buildtype):
options = f"{options} -DROOT_COMPILEDATA_IGNORE_BUILD_NODE_CHANGES=ON"

result = subprocess_with_log(f"""
cmake -S '{srcdir}' -B '{builddir}' -DCMAKE_BUILD_TYPE={buildtype} {options}
cmake --fresh -S '{srcdir}' -B '{builddir}' -DCMAKE_BUILD_TYPE={buildtype} {options}
""")

if result != 0:
die(result, "Failed cmake generation step")


@github_log_group("Dump existing configuration")
def cmake_dump_config():
# Print CMake cached config
srcdir = os.path.join(WORKDIR, "src")
builddir = os.path.join(WORKDIR, "build")
result = subprocess_with_log(f"""
cmake -S '{srcdir}' -B '{builddir}' -N -L
""")

if result != 0:
die(result, "Failed cmake cache print step")


@github_log_group("Dump requested build configuration")
def dump_requested_config(options):
print(f"\nBUILD OPTIONS: {options}")
Expand Down Expand Up @@ -460,10 +447,7 @@ def build(options, buildtype):
if result != 0:
die(result, "Failed to create build directory")

if not os.path.exists(os.path.join(WORKDIR, "build", "CMakeCache.txt")):
cmake_configure(options, buildtype)
else:
cmake_dump_config()
cmake_configure(options, buildtype)

dump_requested_config(options)

Expand Down
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,15 @@ if(MSVC)
endif()

if(runtime_cxxmodules)
if(NOT ROOT_CONFIGURED_FROM_CACHE)
# When using cmake --fresh (or changing the toolchain), remove possibly stale pcms that are not tracked by CMake
set(ROOT_CONFIGURED_FROM_CACHE True CACHE BOOL "Shows if ROOT is configured from an existing CMake cache")
mark_as_advanced(ROOT_CONFIGURED_FROM_CACHE)
file(GLOB_RECURSE left_over_pcms ${CMAKE_BINARY_DIR}/*.pcm)
if(left_over_pcms)
file(REMOVE ${left_over_pcms})
endif()
endif()
# Dummy target that does nothing, we don't need a PCH for modules.
# Onepcm target has all dependencies needed for allDict.cxx.pch, which allow
# to test hsimple.C after all C++ modules are updated.
Expand Down
Loading