fast-terabyte-66624
04/07/2021, 6:38 PMhundreds-father-404
04/07/2021, 6:50 PMfast-terabyte-66624
04/07/2021, 7:06 PMhundreds-father-404
04/07/2021, 7:13 PM_ctypes
not existing iirc when running Pants with Py37 and Py38. I remember reading that Py39 is the only interpreter to properly work with M1, and indeed running Pants with Py39 fixed it for me. But I think they said they're planning to backport M1 support for Python 3.8. We release 1.30 as Py36, Py37, and Py38 wheels, but not yet Py39.
I'm trying to figure out what your error is and if we can possibly get it working with Py38 or if it will be necessary to start releasing 1.30 with Py39fast-terabyte-66624
04/07/2021, 7:26 PMUsing base prefix '/opt/homebrew/Cellar/python@3.8/3.8.9/Frameworks/Python.framework/Versions/3.8'
New python executable in /Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/pants.6QeG1w/install/bin/python3.8
Also creating executable in /Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/pants.6QeG1w/install/bin/python
ERROR: The executable /Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/pants.6QeG1w/install/bin/python3.8 is not functioning
ERROR: It thinks sys.prefix is '/Users/jozefkoval/Work/Projects/esl' (should be '/Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/pants.6QeG1w/install')
ERROR: virtualenv is not compatible with this system or executable
./pants: line 276: /Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/1.30.3_py38/bin/python: No such file or directory
⢠with python 3.7 (installed via pyenv) I get following:
Using base prefix '/Users/jozefkoval/.pyenv/versions/3.7.10'
New python executable in /Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/pants.WcYtPs/install/bin/python3.7
Also creating executable in /Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/pants.WcYtPs/install/bin/python
Command /Users/jozefkoval/.c...nstall/bin/python3.7 -m pip config list had error code 1
Installing setuptools, pip, wheel...
Complete output from command /Users/jozefkoval/.c...nstall/bin/python3.7 - setuptools pip wheel:
Traceback (most recent call last):
File "<stdin>", line 10, in <module>
File "/Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/virtualenv-16.4.3/virtualenv_support/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/__init__.py", line 40, in <module>
File "/Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/virtualenv-16.4.3/virtualenv_support/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/cli/autocompletion.py", line 8, in <module>
File "/Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/virtualenv-16.4.3/virtualenv_support/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/cli/main_parser.py", line 12, in <module>
File "/Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/virtualenv-16.4.3/virtualenv_support/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/commands/__init__.py", line 6, in <module>
File "/Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/virtualenv-16.4.3/virtualenv_support/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/commands/completion.py", line 6, in <module>
File "/Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/virtualenv-16.4.3/virtualenv_support/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/cli/base_command.py", line 20, in <module>
File "/Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/virtualenv-16.4.3/virtualenv_support/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/download.py", line 37, in <module>
File "/Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/virtualenv-16.4.3/virtualenv_support/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/utils/glibc.py", line 3, in <module>
File "/Users/jozefkoval/.pyenv/versions/3.7.10/lib/python3.7/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 13, in <module>
ImportError: cannot import name 'main' from 'pip' (/Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/virtualenv-16.4.3/virtualenv_support/pip-19.0.3-py2.py3-none-any.whl/pip/__init__.py)
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
File "/Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/virtualenv-16.4.3/virtualenv.py", line 2567, in <module>
main()
File "/Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/virtualenv-16.4.3/virtualenv.py", line 793, in main
symlink=options.symlink,
File "/Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/virtualenv-16.4.3/virtualenv.py", line 1088, in create_environment
install_wheel(to_install, py_executable, search_dirs, download=download)
File "/Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/virtualenv-16.4.3/virtualenv.py", line 935, in install_wheel
_install_wheel_with_search_dir(download, project_names, py_executable, search_dirs)
File "/Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/virtualenv-16.4.3/virtualenv.py", line 1025, in _install_wheel_with_search_dir
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=script)
File "/Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/virtualenv-16.4.3/virtualenv.py", line 886, in call_subprocess
raise OSError("Command {} failed with error code {}".format(cmd_desc, proc.returncode))
OSError: Command /Users/jozefkoval/.c...nstall/bin/python3.7 - setuptools pip wheel failed with error code 1
./pants: line 276: /Users/jozefkoval/.cache/pants/setup/bootstrap-Darwin-arm64/1.30.3_py37/bin/python: No such file or directory
hundreds-father-404
04/07/2021, 7:33 PMPYTHON
to force the ./pants
bash script to use something else, or you can rewrite parts of the Bash script like https://github.com/pantsbuild/setup/blob/cc5094f6546a3045c51b00720348027f5cf1f9f8/pants#L131-L134
3.8 error is surprising to me. Maybe try bumping the VENV_VERSION? https://github.com/pantsbuild/setup/blob/cc5094f6546a3045c51b00720348027f5cf1f9f8/pants#L37. Alternatively you can try using python -m venv
rather than virtualenv.
Although, actually, before doing that all - try doing pip3.8 install pantsbuild.pants==1.30.3
--
It'd be great if we can get this working with Py38, as building wheels with Py39 is non-trivial and would be very difficult to backport to 1.30fast-terabyte-66624
04/07/2021, 7:43 PMERROR: Could not find a version that satisfies the requirement pantsbuild.pants==1.30.3
ERROR: No matching distribution found for pantsbuild.pants==1.30.3
hundreds-father-404
04/07/2021, 7:50 PMx86_64
does work on M1s. I think they patched pip to do that, but I don't know if it made it into Python 3.8's pip. You could try pip3.8 install --upgrade pip
iirc first. Make sure this is pip3.8, as pip3.9 will not have a Py39 wheel
https://pypi.org/project/pantsbuild.pants/1.30.3/#filesfast-terabyte-66624
04/07/2021, 7:53 PM> pip3.8 install --upgrade pip
Requirement already satisfied: pip in /opt/homebrew/lib/python3.8/site-packages (21.0.1)
fast-terabyte-66624
04/07/2021, 7:55 PMhundreds-father-404
04/07/2021, 8:04 PMconfigure: error: Unexpected output of 'arch' on OSX
. That explains why I don't have Py38 installed on my machine, I had forgotten that
So...I fear to get Pants working on your M1 mac, the options would be:
1. Use an alternative environment like a devbox or VM. Wait for the upcoming Java/Scala support so that you can upgrade to Pants 2.x. Ack that that's not satisfying.
2. Contribute a patch to 1.30 to build wheels with Python 3.9. I put some time into trying to do this via Travis with https://github.com/pantsbuild/pants/pull/11462, and the main challenge was a segfault when trying to build in the Docker image š± https://travis-ci.com/github/pantsbuild/pants/jobs/472240196#L2098 I gave up on Travis and finished Pants's migration to GitHub actions, although that is very non-trivial to backport to 1.30's CI. Us maintainers don't have enough time to get Py39 wheels building for 1.30, but we can try to help if you're interested like giving instructions - most of the code is already written, it's mainly figuring out that Docker failure
Wait for the upcoming Java/Scala support so that you can upgrade to Pants 2.x.What language are you primarily working in? If Python, y'all can run Pants in mixed mode where part of the repo is 1.30 and another 2.x. But that only works if you use it primarily for Python and not JVM
fast-terabyte-66624
04/07/2021, 8:10 PMhundreds-father-404
04/07/2021, 8:21 PMRegarding the patch, I am keen to contribute (but have limited knowledge of rust/python)That would be awesome and very much appreciated. Also helpful to future M1 users who can't yet use v2. I'm happy to try my best to help, only don't have the bandwidth to drive it Would you be able to work on the patch in a VM, or you'd want to use your M1? Asking because compiling the Rust engine only works with newer versions of Rust, and I'd need to first upgrade Rust on the 1.30 branch so that you could compile the engine to work in pantsbuild/pants repo. But if you can use VM, you save that work
fast-terabyte-66624
04/07/2021, 8:35 PMhundreds-father-404
04/07/2021, 8:52 PMhappy-kitchen-89482
04/07/2021, 9:57 PMhappy-kitchen-89482
04/07/2021, 9:57 PMhundreds-father-404
04/07/2021, 10:14 PMhappy-kitchen-89482
04/07/2021, 11:18 PMfast-terabyte-66624
04/08/2021, 9:07 AMfast-terabyte-66624
04/08/2021, 10:11 AMhappy-kitchen-89482
04/08/2021, 1:26 PMhappy-kitchen-89482
04/08/2021, 1:27 PMfast-terabyte-66624
04/13/2021, 7:47 PMhundreds-father-404
04/13/2021, 7:48 PMfast-terabyte-66624
04/13/2021, 7:50 PMhundreds-father-404
04/13/2021, 7:51 PMfast-terabyte-66624
04/13/2021, 8:29 PMhundreds-father-404
04/13/2021, 8:30 PMhappy-kitchen-89482
04/13/2021, 8:55 PM