| 65 | |
| 66 | === Workaround |
| 67 | The module `virtualenv==20.13.1` works. The issue lies in `virtualenv==20.13.2`, which was released on 24/Feb/22 and is currently the latest version (see [https://pypi.org/project/virtualenv/#history virtualenv/#history]). Commit [26208] added a line of code to upgrade to the latest module. |
| 68 | |
| 69 | |
| 70 | {{{#!diff |
| 71 | Index: ps/trunk/libraries/source/spidermonkey/patch.sh |
| 72 | =================================================================== |
| 73 | --- ps/trunk/libraries/source/spidermonkey/patch.sh |
| 74 | +++ ps/trunk/libraries/source/spidermonkey/patch.sh |
| 75 | @@ -2,6 +2,24 @@ |
| 76 | # Apply patches if needed |
| 77 | # This script gets called from build.sh. |
| 78 | |
| 79 | +# SM78 fails to create virtual envs on macs with python > 3.7 |
| 80 | +# Unfortunately, 3.7 is mostly unavailable on ARM macs. |
| 81 | +# Therefore, replace the custom script with a more up-to-date version from pip |
| 82 | +# if python is detected to be newer than 3.7. |
| 83 | +if [ "$(uname -s)" = "Darwin" ]; |
| 84 | +then |
| 85 | + PYTHON_MINOR_VERSION="$(python3 -c 'import sys; print(sys.version_info.minor)')" |
| 86 | + if [ "$PYTHON_MINOR_VERSION" -gt 7 ]; |
| 87 | + then |
| 88 | + # SM actually uses features from the full-fledged virtualenv package |
| 89 | + # and not just venv, so install it to be safe. |
| 90 | + # Install it locally to not pollute anything. |
| 91 | + pip3 install --upgrade -t virtualenv virtualenv |
| 92 | + export PYTHONPATH="$(pwd)/virtualenv:$PYTHONPATH" |
| 93 | + patch -p1 < ../FixVirtualEnv.diff |
| 94 | + fi |
| 95 | +fi |
| 96 | + |
| 97 | # Mozglue symbols need to be linked against static builds. |
| 98 | # https://bugzilla.mozilla.org/show_bug.cgi?id=1588340 |
| 99 | patch -p1 < ../FixMozglue.diff |
| 100 | }}} |
| 101 | |
| 102 | * I can build Spidermoneky by installing python@3.9 with the specific `virtualenv==20.13.1` module and remove the line of upgrading your virtualenv from the `patch.sh` file. |