Hi Pants! Trying to get Pants `v2.9.0.dev1` workin...
# general
f
Hi Pants! Trying to get Pants
v2.9.0.dev1
working on an M1 macbook. We’re on Python 3.8 (we can’t upgrade to Python 3.9 just yet) and have installed Python using the homebrew /
pyenv
using x86_64 arch emulation. We’re using the Pants
docker
plugin and are stumped by the attached error. Does anyone have any insight into this? Thanks in advance!
Copy code
./pants dependencies ::
16:10:34.33 [ERROR] 1 Exception encountered:

  ProcessExecutionFailure: Process 'Parse Dockerfile.' failed with exit code 1.
stdout:

stderr:
Traceback (most recent call last):
  File "/private/var/folders/kx/_whrt0l54d9_350g0xwn9zp40000gn/T/process-executionU4DA6T/.cache/pex_root/venvs/5f8edf4d6068dd9c5ff01b0865815af301a9e9d5/05ad48543d1b4172329a34b21ccc64fa30998340/pex", line 157, in <module>
    runpy.run_module(module_name, run_name="__main__", alter_sys=True)
  File "/Users/thoyt/.pyenv/versions/3.8.10/lib/python3.8/runpy.py", line 207, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/Users/thoyt/.pyenv/versions/3.8.10/lib/python3.8/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/Users/thoyt/.pyenv/versions/3.8.10/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/thoyt/.cache/pants/named_caches/pex_root/venvs/s/97bd2daa/venv/lib/python3.8/site-packages/__pants_df_parser.py", line 129, in <module>
    main(cmd, sys.argv[2:])
  File "/Users/thoyt/.cache/pants/named_caches/pex_root/venvs/s/97bd2daa/venv/lib/python3.8/site-packages/__pants_df_parser.py", line 42, in main
    from dockerfile import Command, parse_file, parse_string
ImportError: dlopen(/Users/thoyt/.cache/pants/named_caches/pex_root/venvs/s/97bd2daa/venv/lib/python3.8/site-packages/dockerfile.abi3.so, 0x0002): tried: '/Users/thoyt/.cache/pants/named_caches/pex_root/venvs/s/97bd2daa/venv/lib/python3.8/site-packages/dockerfile.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/dockerfile.abi3.so' (no such file), '/usr/lib/dockerfile.abi3.so' (no such file), '/Users/thoyt/.cache/pants/named_caches/pex_root/venvs/5f8edf4d6068dd9c5ff01b0865815af301a9e9d5/05ad48543d1b4172329a34b21ccc64fa30998340/lib/python3.8/site-packages/dockerfile.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/dockerfile.abi3.so' (no such file), '/usr/lib/dockerfile.abi3.so' (no such file)



Use --no-process-execution-local-cleanup to preserve process chroots for inspection.
p
I suggest trying the latest rc for 2.9.0 just released today: https://pantsbuild.slack.com/archives/C18RRR4JK/p1641423160055400
👍 1
h
Hmmm @curved-television-6568 any insight?
Are there also native Pythons installed on your system? What does your
pants.toml
do to restrict the selected interpreters? And how are you running Pants itself?
c
On the phone now, but seems like it complains about the dockerfile parser lib being for the wrong platform.. if that is a hint for anyone?
Will take a closer look once I'm n front of my 💻
What version of Mac OS are you using? Edit: perhaps not as relevant, posted that before I noticed you mentioned the x86_64 emulation thing..
It seems that the arch emulation for x86_64 you are using trips up here.. as you seem to be getting the
dockerfile
lib for x86_64, but it requires the
arm64
version to work for you?
Given this import error:
Copy code
ImportError: dlopen(/Users/thoyt/.cache/pants/named_caches/pex_root/venvs/s/97bd2daa/venv/lib/python3.8/site-packages/dockerfile.abi3.so, 0x0002): tried: '/Users/thoyt/.cache/pants/named_caches/pex_root/venvs/s/97bd2daa/venv/lib/python3.8/site-packages/dockerfile.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/dockerfile.abi3.so' (no such file), '/usr/lib/dockerfile.abi3.so' (no such file), '/Users/thoyt/.cache/pants/named_caches/pex_root/venvs/5f8edf4d6068dd9c5ff01b0865815af301a9e9d5/05ad48543d1b4172329a34b21ccc64fa30998340/lib/python3.8/site-packages/dockerfile.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/dockerfile.abi3.so' (no such file), '/usr/lib/dockerfile.abi3.so' (no such file)
Perhaps it would be worth while to find a setup that gets this package: https://pypi.org/project/dockerfile/#files to work with a version of python on your machine, and once that works, see if you can get Pants to use the same setup.
👍 1
f
Thanks for the links and guidance – seems promising. I’ll explore these and loop back
r
I am not encountering the problem with the
2.9.0rc3
version. Thanks so much and I'll be sure to report back if I encounter any other issues 🙏
🎉 3
🔥 1
👍 1