Skip to content

env depfile: allow deps only install#33245

Merged
trws merged 2 commits intospack:developfrom
haampie:feature/depfile-allow-install-of-deps-only
Oct 12, 2022
Merged

env depfile: allow deps only install#33245
trws merged 2 commits intospack:developfrom
haampie:feature/depfile-allow-install-of-deps-only

Conversation

@haampie
Copy link
Copy Markdown
Member

@haampie haampie commented Oct 12, 2022

  • Refactor spack env depfile to use a Jinja template, making it a bit
    easier to follow as a human being.
  • Add a layer of indirection in the generated Makefile through an
    <prefix>/.install-deps/<hash> target, which allows one to specify
    different options when installing dependencies. For example, only
    verbose/debug mode on when installing some particular spec:
    $ spack -e my_env env depfile -o Makefile --make-target-prefix example
    $ make -j16 example/.install-deps/{hash} SPACK_INSTALL_FLAGS=--please-never-build-from-sources
    $ make -j16 example/.install/{hash} SPACK="spack -d" SPACK_INSTALL_FLAGS=--verbose

This could be used to speed up spack ci rebuild:

  • Parallel install of dependencies from buildcache
  • Better readability of logs, e.g. reducing verbosity when installing
    dependencies, and splitting logs into deps.log and current_spec.log

Given that spack ci rebuild is already unix only and make is a required spack dep... I think it's worth doing this.

- Refactor `spack env depfile` to use a Jinja template, making it a bit
  easier to follow as a human being.
- Add a layer of indirection in the generated Makefile through an
  `<prefix>/.install-deps/<hash>` target, which allows one to specify
  different options when installing dependencies. For example, only
  verbose/debug mode on when installing some particular spec:
  ```
  $ spack -e my_env env depfile -o Makefile --make-target-prefix example
  $ make example/.install-deps/<hash> -j16
  $ make example/.install/<hash> SPACK="spack -d" SPACK_INSTALL_FLAGS=--verbose -j16
  ```

This could be used to speed up `spack ci rebuild`:
- Parallel install of dependencies from buildcache
- Better readability of logs, e.g. reducing verbosity when installing
  dependencies, and splitting logs into deps.log and current_spec.log
@spackbot-app spackbot-app bot added commands core PR affects Spack core functionality labels Oct 12, 2022
import llnl.util.lang

import spack.config
import spack.extensions
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this vestigial?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed it was a missing import -- I can drop it from this PR to keep the squash commit on develop clean if you want

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, if it's missing leave it.

Copy link
Copy Markdown
Contributor

@trws trws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pending whether that import is necessary, I'm happy.

@trws trws merged commit 5009e3d into spack:develop Oct 12, 2022
@haampie haampie deleted the feature/depfile-allow-install-of-deps-only branch October 12, 2022 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands core PR affects Spack core functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants