Skip to content

[WIP] Fix "spack install" when using Python 3.8 on macos#14187

Closed
scheibelp wants to merge 46 commits intospack:developfrom
scheibelp:bugfix/fork-function
Closed

[WIP] Fix "spack install" when using Python 3.8 on macos#14187
scheibelp wants to merge 46 commits intospack:developfrom
scheibelp:bugfix/fork-function

Conversation

@scheibelp
Copy link
Copy Markdown
Member

@scheibelp scheibelp commented Dec 16, 2019

See: #14102

pickle may not work on locally-defined functions, including those created when running "spack install". This appears to have worked for versions of python before 3.8.0 but does not appear to work any longer (as shown in #14102).

This PR fixes the initial pickle error observed in #14102 by extracting the locally-defined function into a top-level function def.

(UPDATE 8/14/20) this currently avoids most pickling errors by serializing a Spec and passing it to build_environment.fork rather than passing the Spec object itself. This works for all cases except for spack dev-build which replaces the associated package.stage.

TODOs:

  • (8/14/20) make spack dev-build work with new changes

@cesss
Copy link
Copy Markdown

cesss commented Feb 12, 2020

Just got hit by this bug today... installed Python 3 because I thought I've been using Python 2 for too long, then I was thinking for a second whether to choose 3.7.x or 3.8.1, and I finally went for 3.8.1. Then you run spack, and it gives precedence to Python 3 over the older 2, so bang, I hit the bug hard 🤣 ...if at least there was a way for telling spack to use Python 2...

@scheibelp scheibelp force-pushed the bugfix/fork-function branch from 1d0c44b to 9c45c80 Compare August 18, 2020 07:54
@scheibelp scheibelp force-pushed the bugfix/fork-function branch from 9c45c80 to ea094d5 Compare August 18, 2020 07:57
@tgamblin tgamblin changed the title [WIP] Fix "spack install" when using Python 3.8.0 [WIP] Fix "spack install" when using Python 3.8 Aug 19, 2020
@tgamblin tgamblin changed the title [WIP] Fix "spack install" when using Python 3.8 [WIP] Fix "spack install" when using Python 3.8 on macos Aug 19, 2020
…thout changing the config, so logic has been added to properly reconstruct the RepoPath after forking the build process (before deserializing the package)
@scheibelp
Copy link
Copy Markdown
Member Author

Closing this for now to avoid confusion with #18205 (a more up-to-date version of this).

@scheibelp scheibelp closed this Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants