https://pantsbuild.org/ logo
p

proud-dentist-22844

05/27/2022, 2:54 PM
Hmm. I'm trying to run
./pants
in a checkout of the pants repo, but I'm getting an ugly
pex
file not found error. ๐Ÿงต
๐Ÿคท 1
โœ… 1
Copy code
pants.engine.internals.scheduler.ExecutionError: 1 Exception encountered:

Engine traceback:
  in select
  in pants.init.plugin_resolver.resolve_plugins
  in pants.backend.python.util_rules.pex.create_venv_pex (pants_plugins.pex)
  in pants.backend.python.util_rules.pex.build_pex (pants_plugins.pex)
  in pants.engine.process.fallible_to_exec_result_or_raise
Traceback (most recent call last):
  File "/home/cognifloyd/g/github/pantsbuild/pants.git/src/python/pants/engine/process.py", line 277, in fallible_to_exec_result_or_raise
    process_cleanup=process_cleanup.val,
pants.engine.process.ProcessExecutionFailure: Process 'Resolving plugins: hdrhistogram, toolchain.pants.plugin==0.19.0' failed with exit code 1.
stdout:

stderr:
Failed to spawn a job for /home/cognifloyd/.cache/pants/pants_dev_deps/Linux.x86_64.Intel(R).Core(TM).i7-3610QM.CPU.@.2.30GHz.py37.venv/bin/python3.7: [Errno 2] No such file or directory: '/home/cognifloyd/.cache/pants/named_caches/pex_root/venvs/4944c1434412ec17d02ad24dd6e05cf1f0b3a38a/acea27d2dbcc288eac2b093081739a3575b60708/pex': '/home/cognifloyd/.cache/pants/named_caches/pex_root/venvs/4944c1434412ec17d02ad24dd6e05cf1f0b3a38a/acea27d2dbcc288eac2b093081739a3575b60708/pex'
So, apparently I missed setting up githooks before I created my PR, but those just run
./pants ...
as well, so same error.
h

hundreds-father-404

05/27/2022, 2:58 PM
what happens if you
rm -rf ~cache/pants/pants_dev_deps
? Also I'm surprised to see your machine's stats like that
p

proud-dentist-22844

05/27/2022, 2:58 PM
Is there something I'm missing in setting up pants? I'm looking at https://www.pantsbuild.org/docs/contributor-overview https://www.pantsbuild.org/docs/contributor-setup I'm using gentoo linux, and I installed
rustup
(v1.24.3) with
emerge
(gentoo's package manager): https://packages.gentoo.org/packages/dev-util/rustup
I removed
~/.cache/pants
with the same result.
Now I'm trying with just removing
~/.cache/pants/pants_dev_deps
. same result
h

hundreds-father-404

05/27/2022, 3:00 PM
does
/home/cognifloyd/.cache/pants/pants_dev_deps/Linux.x86_64.Intel(R).Core(TM).i7-3610QM.CPU.@.2.30GHz.py37.venv/bin/
exist?
p

proud-dentist-22844

05/27/2022, 3:01 PM
Copy code
~/g/github/pantsbuild/pants.git ๎‚ฐ ๎‚  valid-choices โœš ๎‚ฐ ls ~/.cache/pants/pants_dev_deps/Linux.x86_64.Intel\(R\).Core\(TM\).i7-3610QM.CPU.@.2.30GHz.py37.venv/bin
activate      activate.fish  normalizer  pex3       pip   pip3.7   pytest  python3    wheel
activate.csh  chevron        pex         pex-tools  pip3  py.test  python  python3.7
๐Ÿ‘ 1
h

hundreds-father-404

05/27/2022, 3:03 PM
Okay. I'm not sure what's going on.. does
--no-pantsd --no-local-cache
make any difference?
p

proud-dentist-22844

05/27/2022, 3:03 PM
btw I have many versions of python available. 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10 Not sure why it picked 3.7, but it's within the range in pants.toml
Nope same result
h

hundreds-father-404

05/27/2022, 3:06 PM
Not sure why it picked 3.7, but it's within the range in pants.toml
we choose the lowest of 3.7-3.9 because we're more likely to catch you using stuff not in 3.8, like new syntax You can set
export PY=python3.9
-- maybe it would make a difference..
p

proud-dentist-22844

05/27/2022, 3:08 PM
Well, it seems to be building the native code now.
๐Ÿ‘ 1
h

hundreds-father-404

05/27/2022, 3:09 PM
yeah native code only works w/ a single Python version
p

proud-dentist-22844

05/27/2022, 3:10 PM
Hmm. my python3.7 install might be borked. It's no longer in portage and I haven't copied it over to my local overlay yet.
โ— 1
anywho, it's working with python3.9 - I'm reinstalling python3.7 to see if that fixes it with 3.7
๐Ÿ‘ 1
Go figure. Yes my python3.7 install has apparently been screwed up since a system upgrade a week or two ago. It's working now and pants is working with it. ๐Ÿ™‚
โ— 1
๐Ÿ‘ 1
Or not. I guess it doesn't fully work with 3.7 or 3.9. I can now repeatedly do
./pants
with PY=python3.7 or PY=python3.9 (one try that builds the engine, and a follow up to make sure it still works. But if I do a
kill -HUP <pid of pantsd>
and then run it again, I get that same error again. So, it only works as long as pantsd is still running from the initial time.
And it never works (3.7 or 3.9) when I run
./pants lint src/python/pants/engine/target_test.py
It's probably some other gentoo-specific quirk
โ— 1
I'll have to work on it again another day.
Copy code
pex.resolve.resolvers.Untranslatable: Failed to spawn a job for BuildRequest(target=LocalInterpreter(id='usr.bin.python3.7m', platform=Platform(platform='manylinux_2_34_x86_64', impl='cp', version='3.7.13', version_info=(3, 7, 13), abi='cp37m'), marker_environment=MarkerEnvironment(implementation_name='cpython', implementation_version='3.7.13', os_name='posix', platform_machine='x86_64', platform_python_implementation='CPython', platform_release='5.15.41-gentoo', platform_system='Linux', platform_version='#1 SMP Sat May 21 10:13:44 CDT 2022', python_full_version='3.7.13', python_version='3.7', sys_platform='linux'), interpreter=PythonInterpreter('/usr/bin/python3.7m', PythonIdentity('/usr/bin/python3.7m', 'cp37', 'cp37m', 'manylinux_2_34_x86_64', (3, 7, 13)))), source_path='/home/cognifloyd/.cache/pants/named_caches/pex_root/downloads/3865dbbbb8efb4bb5eaa72f1be7f3e0be00ea8b7f125c69cbd1f5fda926f37a2/untokenize-0.1.1.tar.gz', fingerprint='3865dbbbb8efb4bb5eaa72f1be7f3e0be00ea8b7f125c69cbd1f5fda926f37a2'): [Errno 2] No such file or directory: '/home/cognifloyd/.cache/pants/named_caches/pex_root/venvs/4944c1434412ec17d02ad24dd6e05cf1f0b3a38a/acea27d2dbcc288eac2b093081739a3575b60708/pex': '/home/cognifloyd/.cache/pants/named_caches/pex_root/venvs/4944c1434412ec17d02ad24dd6e05cf1f0b3a38a/acea27d2dbcc288eac2b093081739a3575b60708/pex'
I get this when running with
PY=python3.9 ./pants lint src/python/pants/engine/target_test.py
- odd it is still trying to use 3.7
And this is what I get with
PY=python3.7 ./pants lint src/python/pants/engine/target_test.py
Copy code
pex.resolve.resolvers.Untranslatable: Failed to spawn a job for BuildRequest(target=LocalInterpreter(id='usr.bin.python3.7m', platform=Platform(platform='manylinux_2_34_x86_64', impl='cp', version='3.7.13', version_info=(3, 7, 13), abi='cp37m'), marker_environment=MarkerEnvironment(implementation_name='cpython', implementation_version='3.7.13', os_name='posix', platform_machine='x86_64', platform_python_implementation='CPython', platform_release='5.15.41-gentoo', platform_system='Linux', platform_version='#1 SMP Sat May 21 10:13:44 CDT 2022', python_full_version='3.7.13', python_version='3.7', sys_platform='linux'), interpreter=PythonInterpreter('/usr/bin/python3.7m', PythonIdentity('/usr/bin/python3.7m', 'cp37', 'cp37m', 'manylinux_2_34_x86_64', (3, 7, 13)))), source_path='/home/cognifloyd/.cache/pants/named_caches/pex_root/downloads/61a353012cff6ab94ca062823d1fb2f692c4acda51c76ff83a8d77915fba51ea/autoflake-1.4.tar.gz', fingerprint='61a353012cff6ab94ca062823d1fb2f692c4acda51c76ff83a8d77915fba51ea'): [Errno 2] No such file or directory: '/home/cognifloyd/.cache/pants/named_caches/pex_root/venvs/4944c1434412ec17d02ad24dd6e05cf1f0b3a38a/acea27d2dbcc288eac2b093081739a3575b60708/pex': '/home/cognifloyd/.cache/pants/named_caches/pex_root/venvs/4944c1434412ec17d02ad24dd6e05cf1f0b3a38a/acea27d2dbcc288eac2b093081739a3575b60708/pex'
OK. I deleted everything in my git checkout except for .git, and then checked it out again. Plus I wiped ~/.cache/pants. And, I'm using
PY=python3.7m
(/usr/bin/python3.7 is a symlink to /usr/bin/python3.7m) and now it's working. Deleting ~/.cache/pants was not enough, nor was
PY=python3.7m
, so there must have been something else cached somewhere. Something somewhere must have been cached using the borked python3.7 install. very odd.