[Chapel Merge] Replace symbolic link python3 in venv with wrapper

Branch: refs/heads/master
Revision: 5b68005
Author: mppf
Log Message:

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

Modified Files:
A third-party/chpl-venv/python3-wrapper
R third-party/chpl-venv/venv-use-sys-python.py
M Makefile.devel
M third-party/chpl-venv/Makefile

Compare: https://github.com/chapel-lang/chapel/compare/3f39199b4d8c...5b68005b8d4a