Skip to content

Add a __reduce__ method to Environment#25678

Merged
tgamblin merged 3 commits intospack:developfrom
adamjstewart:fixes/environment-pickle
Sep 15, 2021
Merged

Add a __reduce__ method to Environment#25678
tgamblin merged 3 commits intospack:developfrom
adamjstewart:fixes/environment-pickle

Conversation

@adamjstewart
Copy link
Copy Markdown
Member

This PR adds a __reduce__ method to spack.environment.Environment. Without this, we hit the maximum recursion limit when trying to pickle Environment objects.

Fixes #20025. This PR is very similar in spirit to #25658, which fixed #23892.

This PR was just the bare minimum needed to fix the issue. I have no idea if I implemented __reduce__ correctly or not...

Also, I would really like to avoid catching BaseException in spack.install_test.TestSuite.__call__ so that this kind of issue would be easier to diagnose in the future. On develop, spack test run doesn't raise any exception and silently doesn't do anything.

@adamjstewart adamjstewart added environments bugfix Something wasn't working, here's a fix stand-alone-tests Stand-alone (or smoke) tests for installed packages labels Aug 28, 2021
@spackbot-app spackbot-app bot added the tests General test capability(ies) label Aug 28, 2021
@tgamblin tgamblin merged commit 0d0d438 into spack:develop Sep 15, 2021
@adamjstewart adamjstewart deleted the fixes/environment-pickle branch September 15, 2021 13:49
@haampie haampie mentioned this pull request Sep 16, 2021
11 tasks
haampie pushed a commit to haampie/spack that referenced this pull request Sep 17, 2021
* Add a __reduce__ method to Environment
* Add unit test
* Convert Path to str
haampie pushed a commit to haampie/spack that referenced this pull request Sep 17, 2021
* Add a __reduce__ method to Environment
* Add unit test
* Convert Path to str
haampie added a commit to haampie/spack that referenced this pull request Sep 17, 2021
@haampie haampie mentioned this pull request Sep 21, 2021
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Something wasn't working, here's a fix environments macOS stand-alone-tests Stand-alone (or smoke) tests for installed packages tests General test capability(ies)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RecursionError: maximum recursion depth exceeded while pickling an object spack test doesn't support Python 3.8 + macOS

4 participants