ancient-rose-27306
08/03/2023, 7:21 PM2.15.0
and am having a problem with pants test ::
where it is just stuck at following:
59.94s Building requirements.pex with 11 requirements:
⠉ 59.84s Building requirements.pex with 7 requirements:
⠉ 59.81s Building requirements.pex with 9 requirements:
⠉ 59.78s Building requirements.pex with 8 requirements:
⠉ 59.88s Building requirements.pex with 14 requirements:
I know for sure that it has something to do with some package/s not being found and it keeps on trying to build the pex before running tests. I say this because I had encountered this issue once before where I made some changes to my code and requirements.txt and it was trying to find a class not present in one of the requirements. I was able to figure the issue out at that time but right now there has been no change to the codebase nor to the requirements.txt file and that makes it very difficult to pin point the cause.
Since there is no change, I tried -ldebug
, --print-stacktrace
and --keep-sandboxes
but nothing gives me any helpful info. --keep-sandboxes
saves pip.log
files but there is nothing in those files that suggest anything.
I’d really appreciate if I get some help in getting some directions where to look at.
NOTE: I redacted the packages from above console output because those were enterprise packages (not the only kind of packages in the repo though).ancient-rose-27306
08/03/2023, 7:42 PMhappy-kitchen-89482
08/03/2023, 8:19 PMancient-rose-27306
08/03/2023, 8:54 PMancient-rose-27306
08/03/2023, 8:54 PMancient-rose-27306
08/03/2023, 9:40 PMPANTS_PYTHON_INFER_IMPORTS=False
skipped the building of requirements.pex step and that's why it proceeded. There's definitely something wrong with one or more of the dependencies and I wish there was some way of looking at inferred dependency graph - which import statement is bringing which package.happy-kitchen-89482
08/03/2023, 10:09 PMhappy-kitchen-89482
08/03/2023, 10:10 PMancient-rose-27306
08/03/2023, 11:23 PMancient-rose-27306
08/03/2023, 11:24 PMancient-rose-27306
08/03/2023, 11:59 PMenough-analyst-54434
08/04/2023, 12:34 AMancient-rose-27306
08/04/2023, 12:36 AMenough-analyst-54434
08/04/2023, 12:36 AMancient-rose-27306
08/04/2023, 12:36 AMenough-analyst-54434
08/04/2023, 12:37 AMenough-analyst-54434
08/04/2023, 12:38 AMancient-rose-27306
08/04/2023, 12:39 AMgenerate-lockfiles
wouldn't work due to the same reason that requirements.pex is not building?enough-analyst-54434
08/04/2023, 12:40 AMancient-rose-27306
08/04/2023, 12:42 AMgenerate-lockfile
goal is stuck in the same way as building requirements.pex.enough-analyst-54434
08/04/2023, 12:45 AMenough-analyst-54434
08/04/2023, 12:47 AMancient-rose-27306
08/04/2023, 12:48 AMenough-analyst-54434
08/04/2023, 12:48 AMancient-rose-27306
08/04/2023, 12:49 AMenough-analyst-54434
08/04/2023, 12:49 AMpants.toml
you edit:
[GLOBAL]
pants_version = "2.16.0"
enough-analyst-54434
08/04/2023, 12:49 AMancient-rose-27306
08/04/2023, 1:02 AMenough-analyst-54434
08/04/2023, 1:05 AM[python]
pip_version = "23.0.1"
ancient-rose-27306
08/04/2023, 1:07 AMenough-analyst-54434
08/04/2023, 1:08 AMenough-analyst-54434
08/04/2023, 1:09 AMenough-analyst-54434
08/04/2023, 1:10 AMancient-rose-27306
08/04/2023, 1:11 AMenough-analyst-54434
08/04/2023, 1:12 AMancient-rose-27306
08/04/2023, 1:15 AMenough-analyst-54434
08/04/2023, 1:16 AMenough-analyst-54434
08/04/2023, 1:18 AMpants.toml
, that would help build a shared basis as well.ancient-rose-27306
08/04/2023, 1:23 AMenough-analyst-54434
08/04/2023, 1:30 AMancient-rose-27306
08/04/2023, 1:30 AMenough-analyst-54434
08/04/2023, 1:31 AMancient-rose-27306
08/04/2023, 1:32 AMenough-analyst-54434
08/04/2023, 1:33 AMenough-analyst-54434
08/04/2023, 1:33 AMancient-rose-27306
08/04/2023, 1:35 AMenough-analyst-54434
08/04/2023, 1:36 AMancient-rose-27306
08/04/2023, 1:36 AMenough-analyst-54434
08/04/2023, 1:37 AMancient-rose-27306
08/04/2023, 1:38 AMenough-analyst-54434
08/04/2023, 1:38 AMenough-analyst-54434
08/04/2023, 1:39 AMancient-rose-27306
08/05/2023, 1:53 AMenough-analyst-54434
08/05/2023, 2:08 AMenough-analyst-54434
08/05/2023, 2:13 AMancient-rose-27306
08/05/2023, 3:21 PMpants test ::
started failing. And then it worked when I upgraded the pip version to 23.0.1
and had to upgrade Pants too because 2.15.0
doesn't support that pip version.
My best guess regarding the situation is that probably something changed in some dependency or transitive dependency somewhere and pip's old version had problems with that. I have had such issues in the past in the same project (before we started using Pants) in a venv
setup that pip install -r requirements.txt
failed with an older version of pip and it went fine after upgrading the pip. I think I should be able to demonstrate that and we can see what exactly the error was as it's been long and I don't recollect it.
With all the above information:
1. Could lock files have helped averting the issue (and saved one full work day wondering what's wrong)?
2. As I said that I have had issues with an older pip version where it failed and threw some error that I don't recall, wouldn't it be nice for Pants to throw some user friendly error or propagate error from pip rather just keep trying building requirements.pex. One time I let it run for 25000+ seconds to see if it completes or throw some error but finally, I had to cancel it.enough-analyst-54434
08/05/2023, 3:41 PMMy best guess regarding the situation is that probably something changed in some dependency or transitive dependency somewhere and pip's old version had problems with that.Yes, exactly; so the details matter. I would need to have an open source version of your problem with the exact requirements set you use, etc. Words will not be useful here. The exact details will.
enough-analyst-54434
08/05/2023, 3:41 PMenough-analyst-54434
08/05/2023, 3:46 PM1. Could lock files have helped ...It really doesn't matter. Maybe? But there is no reason whatsoever I've ever been made aware of to not use them. So just continue using them, they are good for a host of reasons security / reproducibility and perf related.
2. As I said that I have had issues with an older pip version where it failed and threw some error that I don't recall, wouldn't it be nice for Pants to throw some user friendly error or propagate error from pip rather just keep trying building requirements.pex...That's the problem - there is no error, old Pip is likely backtracking and resolving very slow. This is where those details would matter to prove this. The solution is to use new Pip like you are now and continue to use new Pip, bumping the version as Pants supports newer versions.
ancient-rose-27306
08/09/2023, 8:47 PMpants generate-lockfiles
is continuing to run today for the same pants.toml
, same pip_version
, same pants version and the same requirements.txt
. Its been 1300+ seconds ☹️happy-kitchen-89482
08/09/2023, 9:11 PMgenerate-lockfiles
with --keep-sandboxes=always
, inspect the sandbox that the lockfile generation is running in, and look at the __run.sh
command there (which will call the pex command line interface) to see if anything pops out at you.happy-kitchen-89482
08/09/2023, 9:11 PMancient-rose-27306
08/09/2023, 9:58 PMenough-analyst-54434
08/09/2023, 10:03 PMancient-rose-27306
08/10/2023, 12:51 AMpants.toml
(probably masked). Definitely not requirements.txt
. I shall try again with @happy-kitchen-89482’s suggestion and see what findings I can report.ancient-rose-27306
08/10/2023, 1:25 PMpants-sandbox-
directory that got created with --keep-sanboxes=true
but there is no __run.sh
in the entire directory structure.