Skip to content

Better control of how package and dependencies are installed #29695

@scottwittenburg

Description

@scottwittenburg

Summary

Currently spack install only has the following options for deciding when to use buildcache for package installation: --cache-only and --no-cache apply both to installation of the package and its dependencies. It would be nice to have finer control over when buildcache is used during package installation, i.e. to allow specification of whether buildcache should be used for package and/or dependencies, and whether it should be considered an error if that cannot be accomplished.

Rationale

Some use cases for this functionality include:

  1. Fail gitlab pipelines when a job ends up having to build dependencies from source
  2. Signal to gitlab pipeline that entire stack should be rebuilt, regardless of whether pkgs are up to date or not (to test core spack changes that don't change spec hashes). Even when entire stack should be rebuilt from source, each gitlab job should still install its dependencies from the buildcache, as those should have been built in previous jobs of the pipeline.

Description

In order to support this idea, options for the UI were discussed on slack awhile ago, but that discussion has since expired from the history. This is an attempt to re-capture that discussion from notes, so the ideas are preserved until they can be implemented.

The slack discussion resulted in somewhat of a consensus around the name a new spack install option: --use-buildcache. The values that option could accept were:

only|never|auto|package:only|never|auto,dependencies:only|never|auto

The default value would be simply auto, which would apply to both package and dependencies, and would mean allowing installation from buildcache but not insisting on it. Supplying simply only|never|auto would similarly apply to both package and dependencies.

The option values also allow for specifying different behavior for packages vs dependencies. For example to tell spack to install the package from source only, but install dependencies from buildcache only, and fail if not able to do those things, we could say:

spack install --use-buildcache=package:never,dependencies:only

Additional information

This isn't specific to any version of spack or any os/arch, but rather a new command line option available everywhere.

General information

  • I have run spack --version and reported the version of Spack
  • I have searched the issues of this repo and believe this is not a duplicate

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildcachefeatureA feature is missing in SpackpipelinesIssues related to spack's pipeline features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions