CachedCMakePackage: Add back initconfig as a defined phase (#33575)

Also: add type annotation to indicate that "phases" is always a
tuple of strings.
This commit is contained in:
Chris White 2022-10-27 23:04:18 -07:00 committed by GitHub
parent b81b54a74c
commit d4a0f588e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -32,6 +32,10 @@ def cmake_cache_option(name, boolean_value, comment=""):
class CachedCMakeBuilder(CMakeBuilder):
#: Phases of a Cached CMake package
#: Note: the initconfig phase is used for developer builds as a final phase to stop on
phases = ("initconfig", "cmake", "build", "install") # type: Tuple[str, ...]
#: Names associated with package methods in the old build-system format
legacy_methods = CMakeBuilder.legacy_methods + (
"initconfig_compiler_entries",
@ -224,8 +228,7 @@ def initconfig_package_entries(self):
"""This method is to be overwritten by the package"""
return []
@spack.builder.run_before("cmake")
def initconfig(self):
def initconfig(self, pkg, spec, prefix):
cache_entries = (
self.std_initconfig_entries()
+ self.initconfig_compiler_entries()

View File

@ -155,7 +155,7 @@ class CMakeBuilder(BaseBuilder):
"""
#: Phases of a CMake package
phases = ("cmake", "build", "install")
phases = ("cmake", "build", "install") # type: Tuple[str, ...]
#: Names associated with package methods in the old build-system format
legacy_methods = ("cmake_args", "check") # type: Tuple[str, ...]

View File

@ -469,7 +469,7 @@ class Builder(six.with_metaclass(BuilderMeta, llnl.util.compat.Sequence)):
"""
#: Sequence of phases. Must be defined in derived classes
phases = None # type: Optional[Tuple[str, ...]]
phases = () # type: Tuple[str, ...]
#: Build system name. Must also be defined in derived classes.
build_system = None # type: Optional[str]