In a little test setup, I have: ```[python] interp...
# general
r
In a little test setup, I have:
Copy code
[python]
interpreter_constraints = ["==3.9.*"]
Which works successfully. But when I bump it to 3.10.*, I get the following:
Copy code
bruce@groot:~/tmp/semaphore-demo-python-pants$ ./pants test ::
22:34:39.42 [INFO] Initializing scheduler...
22:34:40.15 [INFO] Scheduler initialized.
22:34:43.19 [INFO] Canceled: Building pytest.pex from pytest_default.lock
22:34:44.01 [INFO] Completed: Building requirements.pex
22:34:44.08 [INFO] Completed: Building requirements.pex with 1 requirement: ansicolors>=1.1.8
22:34:44.08 [ERROR] 1 Exception encountered:

Engine traceback:
  in `test` goal
  in Run Pytest - hello_world/test_main.py:tests

ProcessExecutionFailure: Process 'Building requirements.pex with 1 requirement: ansicolors>=1.1.8' failed with exit code 1.
stdout:

stderr:
[Errno 2] No such file or directory: '/tmp/pants-sandbox-zOYk5D/.tmp/pex-pip-log.lhpmsm3l/pip.log'
It's not obvious to me why this is happening and what the error messages mean.
e
It's not obvious to me either, the likes of that I have not seen yet. In terms of debugging, there are 3 tacks that come to mind: 1. Is the repo open / shareable? This always makes debugging much faster. 2. Can you re-run with
-ldebug
? That gives more info and can be useful for debugging. 3. Can you run with
--keep-sandboxes=always
? That will keep that
/tmp/pants-sandbox-*
around for poking at. It would also be good to know the Pants version, and, in lieu of #1, as much of
pants.toml
as you can share.
r
I thought it might be something obvious; definitely need to create a reproducible sharable repo then.
Here is the repo and instructions for reproducing the error: https://github.com/BruceEckel/tmp-pants-bug
e
Unfortunately I don't repro. The only surface difference is WIndows 11:
Copy code
jsirois@Gill-Windows:~/dev $ mkdir BruceEckel
jsirois@Gill-Windows:~/dev $ cd BruceEckel/
jsirois@Gill-Windows:~/dev/BruceEckel $ git clone <https://github.com/BruceEckel/tmp-pants-bug>
Cloning into 'tmp-pants-bug'...
remote: Enumerating objects: 24, done.
remote: Counting objects: 100% (24/24), done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 24 (delta 3), reused 22 (delta 3), pack-reused 0
Receiving objects: 100% (24/24), 10.62 KiB | 1.52 MiB/s, done.
Resolving deltas: 100% (3/3), done.
jsirois@Gill-Windows:~/dev/BruceEckel $ cd tmp-pants-bug/
jsirois@Gill-Windows:~/dev/BruceEckel/tmp-pants-bug (main) $ ./pants test ::
-bash: ./pants: Permission denied
jsirois@Gill-Windows:~/dev/BruceEckel/tmp-pants-bug (main) $ chmod +x pants
jsirois@Gill-Windows:~/dev/BruceEckel/tmp-pants-bug (main *) $ ./pants test ::
Bootstrapping Pants using /home/jsirois/.pyenv/shims/python3.9
Installing pantsbuild.pants==2.16.0.dev0 into a virtual environment at /home/jsirois/.cache/pants/setup/bootstrap-Linux-x86_64/2.16.0.dev0_py39
New virtual environment successfully created at /home/jsirois/.cache/pants/setup/bootstrap-Linux-x86_64/2.16.0.dev0_py39.
14:13:13.86 [INFO] Initializing scheduler...
14:13:14.29 [INFO] Scheduler initialized.
14:13:15.85 [INFO] Canceled: Building pytest.pex from pytest_default.lock
14:13:16.34 [INFO] Completed: Building requirements.pex
14:13:16.79 [INFO] Completed: Building pytest.pex from pytest_default.lock
14:13:17.08 [INFO] Completed: Building local_dists.pex
14:13:17.13 [INFO] Completed: Building requirements.pex with 1 requirement: ansicolors>=1.1.8
14:13:17.65 [INFO] Completed: Building pytest_runner.pex
14:13:17.65 [INFO] Completed: Building pytest_runner.pex
14:13:17.97 [INFO] Completed: Run Pytest - commons/math_utils_test.py:tests - succeeded.
14:13:17.97 [INFO] Completed: Run Pytest - commons/string_utils_test.py:tests - succeeded.
14:13:17.97 [INFO] Completed: Run Pytest - hello_world/test_main.py:tests - succeeded.

✓ commons/math_utils_test.py:tests succeeded in 0.30s.
✓ commons/string_utils_test.py:tests succeeded in 0.30s.
✓ hello_world/test_main.py:tests succeeded in 0.30s.
jsirois@Gill-Windows:~/dev/BruceEckel/tmp-pants-bug (main *) $ vi pants.toml
jsirois@Gill-Windows:~/dev/BruceEckel/tmp-pants-bug (main *) $ git diff
diff --git a/pants b/pants
old mode 100644
new mode 100755
diff --git a/pants.toml b/pants.toml
index 6be5e10..f02bd9d 100644
--- a/pants.toml
+++ b/pants.toml
@@ -14,6 +14,6 @@ backend_packages = [
 enabled = false

 [python]
-interpreter_constraints = ["==3.9.*"]
+#interpreter_constraints = ["==3.9.*"]
 # To see the problem, change this to:
-# interpreter_constraints = ["==3.10.*"]
+interpreter_constraints = ["==3.10.*"]
jsirois@Gill-Windows:~/dev/BruceEckel/tmp-pants-bug (main *) $ ./pants test ::
14:13:49.10 [INFO] Initializing scheduler...
14:13:49.52 [INFO] Scheduler initialized.
14:13:50.78 [INFO] Canceled: Building pytest.pex from pytest_default.lock
14:13:51.17 [INFO] Completed: Building requirements.pex
14:13:51.96 [INFO] Completed: Building requirements.pex with 1 requirement: ansicolors>=1.1.8
14:13:52.40 [INFO] Completed: Building pytest.pex from pytest_default.lock
14:13:52.78 [INFO] Completed: Building local_dists.pex
14:13:53.45 [INFO] Completed: Building pytest_runner.pex
14:13:53.45 [INFO] Completed: Building pytest_runner.pex
14:13:53.83 [INFO] Completed: Run Pytest - commons/string_utils_test.py:tests - succeeded.
14:13:53.83 [INFO] Completed: Run Pytest - commons/math_utils_test.py:tests - succeeded.
14:13:53.83 [INFO] Completed: Run Pytest - hello_world/test_main.py:tests - succeeded.

✓ commons/math_utils_test.py:tests succeeded in 0.37s.
✓ commons/string_utils_test.py:tests succeeded in 0.37s.
✓ hello_world/test_main.py:tests succeeded in 0.37s.
jsirois@Gill-Windows:~/dev/BruceEckel/tmp-pants-bug (main *) $ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
The next steps then would be trying the #2 or #3 or both debug steps I listed above. If you report details from those, I might be able to help guide deeper investigation.
f
I can't repro either:
Copy code
➜  tmp-pants-bug git:(main) ✗ ./pants test ::
23:42:29.49 [INFO] Initializing scheduler...
23:42:29.50 [WARN] File handle limit is capped to: 4096. To avoid 'too many open file handle' errors, we recommend a limit of at least 10000: please see <https://www.pantsbuild.org/docs/troubleshooting#too-many-open-files-error> for more information.
23:42:30.31 [INFO] Scheduler initialized.
23:42:35.79 [INFO] Completed: Building requirements.pex
23:42:40.04 [INFO] Completed: Building requirements.pex with 1 requirement: ansicolors>=1.1.8
23:42:41.50 [INFO] Completed: Building pytest.pex from pytest_default.lock
23:42:42.54 [INFO] Completed: Building local_dists.pex
23:42:44.57 [INFO] Completed: Building pytest_runner.pex
23:42:44.58 [INFO] Completed: Building pytest_runner.pex
23:42:45.67 [INFO] Completed: Run Pytest - commons/math_utils_test.py:tests - succeeded.
23:42:45.67 [INFO] Completed: Run Pytest - commons/string_utils_test.py:tests - succeeded.
23:42:45.70 [INFO] Completed: Run Pytest - hello_world/test_main.py:tests - succeeded.

✓ commons/math_utils_test.py:tests succeeded in 1.06s.
✓ commons/string_utils_test.py:tests succeeded in 1.06s.
✓ hello_world/test_main.py:tests succeeded in 1.10s.
Windows 10, Ubuntu 22.04
r
OK, that's very strange. After I successfully ran
./pants test :: -ldebug --keep-sandboxes=always
with Python 3.9, I changed to Python 3.10 in
pants.toml
and it ran successfully. After that I can run
./pants test ::
and it still works. Is there some side effect to
-ldebug --keep-sandboxes=always
that might account for this?
I will try a fresh clone of the repo and see if I can reproduce it.
No, if I do a fresh clone it still works with Python 3.10. This makes me think that the issue happened because I had a completely new install of WSL (I removed it and re-installed it). Which means there appears to be a missing step in the WSL configuration for Pants, that somehow either
-ldebug
or
--keep-sandboxes=always
fixes?
e
That definitely should not be the case. Both of those steps should never be needed in normal usage, nor should they help anything in any permanent way. They both have the side-effect of restarting the pants daemon, but that's just due to pants options changing, not due to anything intrinsic about those options particularly.
@fresh-cat-90827 do you use Windows Store WSL? I do not; so this is the only free variable I'm aware of in Bruce's woes.
r
I think this might also have been happening when I was using
wsl
on the command line to install from scratch. There were so many uncertain parts at that time that I wasn't drilling into the problem. But I'm pretty sure I saw those errors then, too. I will continue experimenting and see if I can reveal anything new.
f
@enough-analyst-54434 no, I have installed it via a terminal, not via Windows Store.