I have to `rm -rf ~/.cache/pypoetry/` when switchi...
# development
e
I have to
rm -rf ~/.cache/pypoetry/
when switching branches and running
./build-support/bin/generate_all_lockfiles.sh
frequently due to solver errors like:
Copy code
Engine traceback:
  in select
  in pants.backend.python.goals.lockfile.generate_lockfiles_goal
  in pants.backend.python.goals.lockfile.generate_lockfile
  in pants.engine.process.fallible_to_exec_result_or_raise
Traceback (most recent call last):
  File "/home/jsirois/dev/pantsbuild/jsirois-pants/src/python/pants/engine/process.py", line 270, in fallible_to_exec_result_or_raise
    local_cleanup=global_options.options.process_execution_local_cleanup,
pants.engine.process.ProcessExecutionFailure: Process 'Generate lockfile for black' failed with exit code 1.
stdout:
Creating virtualenv pants-lockfile-generation-GVeIbsce-py3.6 in /home/jsirois/.cache/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies...

  SolverProblemError

  Because pants-lockfile-generation depends on black (==21.9b0) which doesn't exist, version solving failed.

  at ~/.cache/pants/named_caches/pex_root/venvs/short/e2fd2a6d/lib/python3.6/site-packages/poetry/puzzle/solver.py:241 in _solve
      237│             packages = result.packages
      238│         except OverrideNeeded as e:
      239│             return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
      240│         except SolveFailure as e:
    → 241│             raise SolverProblemError(e)
      242│ 
      243│         results = dict(
      244│             depth_first_search(
      245│                 PackageNode(self._package, packages), aggregate_package_nodes

stderr:
IOW: We leak state to the global user Poetry caches and that state is apparently not safely shared. Is this a known issue? I counldn't find a bug.
Pehaps I'm the only person with Python 3.6 and that's why I see this and no-one else? I have all the Pythons for Pex testing.
My state verbage above may be all wrong. Perhaps we incorrectly pick Python3.6.
h
known that we leak global state Their config setting doesn't work at all on macOS. So when we decided to switch to Pex, I didn't spend the time trying to hook up Poetry to named caches etc and conditionally handle linux vs macOS
it's plausible that was the wrong judgment call and we should fix this in 2.7 and 2.8
e
Ok, well if we leave the option to use Poetry for lockfile gen, this will need to be solved. I'll add writing a bug to my stack.
h
well if we leave the option to use Poetry for lockfile gen
There are no plans for that fwict. Pex is meant to replace Poetry. Users are welcome to still use Poetry, but by running it outside of Pants, not via
generate-lockfiles
Thus, the prioritization question of how much time to spend on this temporary broken window
e
AH, gotcha. I'm happy to Wally it and wait for the bug report that never comes.