When I ran `pants export ::` , it hanged. (m1) Is ...
# general
c
When I ran
pants export ::
, it hanged. (m1) Is there way to find a problem here?
Copy code
12:15:05.39 [DEBUG] Completed: pants.backend.python.util_rules.pex.build_pex
12:15:05.39 [DEBUG] Completed: Scheduling: Get interpreter version
12:15:05.39 [DEBUG] Completed: Determine all Python interpreter versions used by Pytest in your project (for `export` goal)
12:15:05.40 [DEBUG] Completed: Scheduling: Building pytest.pex from pytest_default.lock
12:15:05.40 [DEBUG] Completed: pants.backend.python.util_rules.pex.build_pex
12:15:05.40 [DEBUG] Completed: Scheduling: Get interpreter version
12:15:05.52 [DEBUG] Completed: setup_sandbox
When stops
Copy code
^CTraceback (most recent call last):
  File "/Users/szto/.pyenv/versions/3.9.15/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/szto/.pyenv/versions/3.9.15/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/szto/.cache/pants/named_caches/pex_root/unzipped_pexes/404b7939ac9a4cbb33f728a5723c1f4b67d9a803/__main__.py", line 103, in <module>
    bootstrap_pex(__entry_point__, execute=__execute__, venv_dir=__venv_dir__)
  File "/Users/szto/.cache/pants/named_caches/pex_root/unzipped_pexes/404b7939ac9a4cbb33f728a5723c1f4b67d9a803/.bootstrap/pex/pex_bootstrapper.py", line 599, in bootstrap_pex
    pex.PEX(entry_point).execute()
  File "/Users/szto/.cache/pants/named_caches/pex_root/unzipped_pexes/404b7939ac9a4cbb33f728a5723c1f4b67d9a803/.bootstrap/pex/pex.py", line 551, in execute
    sys.exit(self._wrap_coverage(self._wrap_profiling, self._execute))
  File "/Users/szto/.cache/pants/named_caches/pex_root/unzipped_pexes/404b7939ac9a4cbb33f728a5723c1f4b67d9a803/.bootstrap/pex/pex.py", line 458, in _wrap_coverage
    return runner(*args)
  File "/Users/szto/.cache/pants/named_caches/pex_root/unzipped_pexes/404b7939ac9a4cbb33f728a5723c1f4b67d9a803/.bootstrap/pex/pex.py", line 489, in _wrap_profiling
    return runner(*args)
  File "/Users/szto/.cache/pants/named_caches/pex_root/unzipped_pexes/404b7939ac9a4cbb33f728a5723c1f4b67d9a803/.bootstrap/pex/pex.py", line 583, in _execute
    return self.execute_entry(
  File "/Users/szto/.cache/pants/named_caches/pex_root/unzipped_pexes/404b7939ac9a4cbb33f728a5723c1f4b67d9a803/.bootstrap/pex/pex.py", line 775, in execute_entry
    return self.execute_module(entry_point.module)
  File "/Users/szto/.cache/pants/named_caches/pex_root/unzipped_pexes/404b7939ac9a4cbb33f728a5723c1f4b67d9a803/.bootstrap/pex/pex.py", line 783, in execute_module
    runpy.run_module(module_name, run_name="__main__", alter_sys=True)
  File "/Users/szto/.pyenv/versions/3.9.15/lib/python3.9/runpy.py", line 225, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/Users/szto/.pyenv/versions/3.9.15/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/Users/szto/.pyenv/versions/3.9.15/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/szto/.cache/pants/named_caches/pex_root/installed_wheels/71c50e03e63506d9e56add7cd5a4d6bb9fcc7985f39e7d2e152233fc4d6fd74d/pex-2.1.111-py2.py3-none-any.whl/pex/tools/__main__.py", line 10, in <module>
    sys.exit(tools())
  File "/Users/szto/.cache/pants/named_caches/pex_root/installed_wheels/71c50e03e63506d9e56add7cd5a4d6bb9fcc7985f39e7d2e152233fc4d6fd74d/pex-2.1.111-py2.py3-none-any.whl/pex/tools/main.py", line 93, in main
    result = catch(pex_command.run, pex)
  File "/Users/szto/.cache/pants/named_caches/pex_root/installed_wheels/71c50e03e63506d9e56add7cd5a4d6bb9fcc7985f39e7d2e152233fc4d6fd74d/pex-2.1.111-py2.py3-none-any.whl/pex/result.py", line 105, in catch
    return func(*args, **kwargs)
  File "/Users/szto/.cache/pants/named_caches/pex_root/installed_wheels/71c50e03e63506d9e56add7cd5a4d6bb9fcc7985f39e7d2e152233fc4d6fd74d/pex-2.1.111-py2.py3-none-any.whl/pex/tools/commands/venv.py", line 202, in run
    venv.install_pip()
  File "/Users/szto/.cache/pants/named_caches/pex_root/installed_wheels/71c50e03e63506d9e56add7cd5a4d6bb9fcc7985f39e7d2e152233fc4d6fd74d/pex-2.1.111-py2.py3-none-any.whl/pex/venv/virtualenv.py", line 352, in install_pip
    self._interpreter.execute(args=["-m", "ensurepip", "-U", "--default-pip"])
  File "/Users/szto/.cache/pants/named_caches/pex_root/installed_wheels/71c50e03e63506d9e56add7cd5a4d6bb9fcc7985f39e7d2e152233fc4d6fd74d/pex-2.1.111-py2.py3-none-any.whl/pex/interpreter.py", line 1292, in execute
    stdout, stderr = Executor.execute(cmd, stdin_payload=stdin_payload, env=env, **kwargs)
  File "/Users/szto/.cache/pants/named_caches/pex_root/installed_wheels/71c50e03e63506d9e56add7cd5a4d6bb9fcc7985f39e7d2e152233fc4d6fd74d/pex-2.1.111-py2.py3-none-any.whl/pex/executor.py", line 93, in execute
    stdout_raw, stderr_raw = process.communicate(input=stdin_payload)
  File "/Users/szto/.pyenv/versions/3.9.15/lib/python3.9/subprocess.py", line 1134, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "/Users/szto/.pyenv/versions/3.9.15/lib/python3.9/subprocess.py", line 1979, in _communicate
    ready = selector.select(timeout)
  File "/Users/szto/.pyenv/versions/3.9.15/lib/python3.9/selectors.py", line 416, in select
    fd_event_list = self._selector.poll(timeout)
KeyboardInterrupt
Interrupted by user.
12:21:15.08 [DEBUG] Completed: interactive_process

12:21:15.08 [DEBUG] Async completion is enabled: workunit callbacks will complete in the background.
e
Sure, so Pex is trying to create a venv and it's running:
Copy code
/Users/szto/.pyenv/versions/3.9.15/bin/python -m ensurepip -U --default-pip
That apparently hangs. Can you try running that manually?
c
Copy code
➜  linear-cli git:(main) ✗ /Users/szto/.pyenv/versions/3.9.15/bin/python -m ensurepip -U --default-pip            
Looking in links: /var/folders/4y/2r8ypdnx6kv0t1vd71t6kd1h0000gn/T/tmpltwei0db
Requirement already satisfied: setuptools in /Users/szto/.pyenv/versions/3.9.15/lib/python3.9/site-packages (58.1.0)
Requirement already satisfied: pip in /Users/szto/.pyenv/versions/3.9.15/lib/python3.9/site-packages (22.3.1)
I ran the script but it is the same running export command
e
For full fidelity, try:
Copy code
/Users/szto/.pyenv/versions/3.9.15/bin/python -mvenv pex.venv
pex.venv/bin/pip install pex==2.1.111
pex.venv/bin/pex -o empty.pex --include-tools
PEX_TOOLS=1 ./empty.pex venv test.venv --pip
c
it hangs~
e
Ok then, you have a good narrow case to dig on. I have no clue why it hangs.
Sometimes folks have a borked interpreter. You could try
pyenv install 3.9.16
and see if that interpreter has the same issue or not.