Skip to content

Bug fix : issues in md5 and checksum commands#503

Merged
tgamblin merged 1 commit intospack:developfrom
epfl-scitas:fixes/md5
Mar 8, 2016
Merged

Bug fix : issues in md5 and checksum commands#503
tgamblin merged 1 commit intospack:developfrom
epfl-scitas:fixes/md5

Conversation

@alalazo
Copy link
Copy Markdown
Member

@alalazo alalazo commented Mar 8, 2016

The issues are similar to the ones solved in ad103dc and were introduced by (my) stage refactoring.

@tgamblin : if you think it may be better, I could remove the explicit call to create in _make_stage and use the stage as a context manager in fetch, stage, etc. I'll also try to have a look in another PR how hard it is to write regression tests for these issues.

package.do_stage()
with package.stage as stage:
stage.delete_on_exit = False
package.do_stage()
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.

@tgamblin The three lines here went in accidentally. They are not wrong, but I didn't mean to put them in before we agreed whether or not it is better to remove the explicit call to stage.create() in Package._make_stage(). Just tell me if you want these reverted.

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.

The idea with the original do_* calls on Package was to keep the interface exposed to commands really simple. I think this part, especially since you have to refer to the stage variable explicitly, is kind of a leaky abstraction. I'd rather the package.py encapsulate the hard part... Is there a reason to require everyone who deals with Package to know the details of how staging is implemented? Seems like too much to expect from the caller.

@tgamblin
Copy link
Copy Markdown
Member

tgamblin commented Mar 8, 2016

I fixed a few things and merged -- I changed delete_on_exit to keep in stage, and I added a constructor arg. Also, the sense of keep is different from delete_on_exit. Basically it defaults to None, which means "delete on success", but you can override it to either always keep (True) or always delete (False).

@tgamblin tgamblin merged commit 77ec27c into spack:develop Mar 8, 2016
@alalazo alalazo deleted the fixes/md5 branch March 8, 2016 18:41
matz-e pushed a commit to matz-e/spack that referenced this pull request Apr 27, 2020
climbfuji pushed a commit to climbfuji/spack that referenced this pull request Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants