-
-
Notifications
You must be signed in to change notification settings - Fork 644
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix setting of PEX_PATH in ./pants run (v2 backend) (#4969)
Problem App servers that need to re-execute (apps watching for file systems changes, jupyter notebooks, etc.) throw an ImportError when being ran with ./pants run because the pants runner pex is losing context of where to find the requirements pex, the sources pex, and any other pexes to merge into the runtime environment. This context is encapsulated in a search path called PEX_PATH, which is being loaded into the PEX_PATH environment variable and is consequently scrubbed out of the environment upon re-exec by pex internal logic. Solution Completely remove any setting of PEX_PATH in the environment upon construction of the pants runner pex and instead pass this extra pex path information to the pex_info metadata that is used by the PEXBuilder object to construct the pants runner pex. Result Applications that need to re-execute will now be able to locate the sources module and entry point because the search path to resolve them (PEX_PATH) will be persisted in the pants runner pex's PEX-INFO metadata.
- Loading branch information
1 parent
0d01035
commit 2180a3d
Showing
3 changed files
with
22 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters