Skip to content

Don't delete "spack develop" build artifacts after install#43424

Merged
tgamblin merged 9 commits intospack:developfrom
scheibelp:bugfix/install-dont-del-dev-stage
Mar 29, 2024
Merged

Don't delete "spack develop" build artifacts after install#43424
tgamblin merged 9 commits intospack:developfrom
scheibelp:bugfix/install-dont-del-dev-stage

Conversation

@scheibelp
Copy link
Copy Markdown
Member

@scheibelp scheibelp commented Mar 28, 2024

Fixes #43393.

After #41373, where we stopped considering the source directory to be the stage for develop builds, we resumed deleting the stage even after a successful build.

We don't want this for develop builds because developers need to iterate; we should keep the artifacts unless they explicitly run spack clean.

Now:

  • Build artifacts for develop packages are not removed after a successful install
  • They are also not removed before an install starts, i.e. develop packages always reuse prior artifacts, if available.
  • They can be deleted in any other context, e.g. by running spack clean --stage

@spackbot-app spackbot-app bot added commands core PR affects Spack core functionality tests General test capability(ies) labels Mar 28, 2024
@scheibelp scheibelp requested a review from tgamblin March 28, 2024 19:01
Copy link
Copy Markdown
Member

@tgamblin tgamblin left a comment

Choose a reason for hiding this comment

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

I tested this and it looks mostly good. Two requests:

  1. docstring request below.
  2. I see a working symlink after I install a package successfully. When I run spack clean, the stage is removed but the broken symlink remains. Can we remove that on destroy, as well?

return bool(self.external_path) or bool(self.external_modules)

@property
def is_develop(self):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

docstring would be good here.

@spackbot-app spackbot-app bot added the stage label Mar 28, 2024
@scheibelp
Copy link
Copy Markdown
Member Author

@tgamblin

docstring request below.

done

I see a working symlink after I install a package successfully. When I run spack clean, the stage is removed but the broken symlink remains. Can we remove that on destroy, as well?

done and test updated

@tgamblin tgamblin merged commit 179e4f3 into spack:develop Mar 29, 2024
G-Ragghianti pushed a commit to G-Ragghianti/spack that referenced this pull request Apr 2, 2024
After spack#41373, where we stopped considering the source directory to be the stage for develop builds,
we resumed *deleting* the stage even after a successful build.

We don't want this for develop builds because developers need to iterate; we should keep the artifacts
unless they explicitly run `spack clean`.  

Now:
- [x] Build artifacts for develop packages are not removed after a successful install
- [x] They are also not removed before an install starts, i.e. develop packages always 
      reuse prior artifacts, if available.
- [x] They can be deleted in any other context, e.g. by running  `spack clean --stage`
tldahlgren pushed a commit to tldahlgren/spack that referenced this pull request Apr 23, 2024
After spack#41373, where we stopped considering the source directory to be the stage for develop builds,
we resumed *deleting* the stage even after a successful build.

We don't want this for develop builds because developers need to iterate; we should keep the artifacts
unless they explicitly run `spack clean`.  

Now:
- [x] Build artifacts for develop packages are not removed after a successful install
- [x] They are also not removed before an install starts, i.e. develop packages always 
      reuse prior artifacts, if available.
- [x] They can be deleted in any other context, e.g. by running  `spack clean --stage`
teaguesterling pushed a commit to teaguesterling/spack that referenced this pull request Jun 15, 2024
After spack#41373, where we stopped considering the source directory to be the stage for develop builds,
we resumed *deleting* the stage even after a successful build.

We don't want this for develop builds because developers need to iterate; we should keep the artifacts
unless they explicitly run `spack clean`.  

Now:
- [x] Build artifacts for develop packages are not removed after a successful install
- [x] They are also not removed before an install starts, i.e. develop packages always 
      reuse prior artifacts, if available.
- [x] They can be deleted in any other context, e.g. by running  `spack clean --stage`
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 stage tests General test capability(ies)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

spack develop build_stage directory

2 participants