-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16663 from mppf/fix-venv
Replace symbolic link python3 in venv with wrapper Follow-up to PRs #16644 and #16560. This PR is intended to solve problems where this warning is reported in some nightly testing configurations: ``` [Warning: could not import filelock] ``` The venv normally includes in some-venv/bin/python3 a symbolic link to the real python3 interpreter used. This has the drawback that when distributing the venv, the relevant python executable might be in a different place. So, this commit adds a bash script that runs python while telling it to think it is being launched from that location (that is what the exec -a here does). The wrapper uses whichever python3 is available in the system. This allows the python3 being run to change (e.g. if the venv is used on a system with a different path to the python3). This approach replaces the approach from PR #3571. Reviewed by @ronawho - thanks! - [x] checked basic module build on an XC - [x] full local testing
- Loading branch information
Showing
4 changed files
with
16 additions
and
117 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Remove the directory containing this script from the path | ||
# (here we just replace chpl-venv with missing since we know | ||
# chpl-venv is always part of the PATH component to this script) | ||
|
||
# This is to avoid an infinite loop running this script over and over. | ||
export PATH=${PATH//chpl-venv/missing} | ||
|
||
# Now run the real python3 interpreter but tell it that it | ||
# is being launched at the current path, so it can | ||
# correctly find dependencies in the venv | ||
exec -a "$0" python3 "$@" |
This file was deleted.
Oops, something went wrong.