Skip to content

Multiple build systems: second builders do not inherit phase callbacks #36689

@skosukhin

Description

@skosukhin

Steps to reproduce

$ spack install netcdf-c~mpi~zstd build_system=autotools ^hdf5~mpi
$ spack install netcdf-c~mpi~zstd build_system=cmake ^hdf5~mpi

Error message

Both builders (CMakeBuilder and AutotoolsBuilder) of netcdf-c inherit from BackupStep, which implements a run_after("install") method backup_nc_config. However, the method is run only when build_system=cmake. If we swap the declaration of the builders, i.e. instead of

class CMakeBuilder(...):
    ...

class AutotoolsBuilder(...):
    ...

we do

class AutotoolsBuilder(...):
    ...

class CMakeBuilder(...):
    ...

the backup_nc_config will run only when build_system=autotools.

I see a similar pattern in proj (@adamjstewart FYI) where the install_datum_grids method is run when build_system=cmake but is not run when build_system=autotools (given the issue reported in #36688 is resolved).

@alalazo is probably the right person to mention here.

Information on your system

  • Spack: 0.20.0.dev0 (74ad92e)
  • Python: 3.9.2
  • Platform: linux-debian11-skylake
  • Concretizer: clingo

General information

  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have searched the issues of this repo and believe this is not a duplicate
  • I have run the failing commands in debug mode and reported the output

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions