Migration woes 31415 I have a large repository th...
# general
p
Migration woes 31415 I have a large repository that is kind of three chunks: • Chunk A - Embedded arm stuff for IOT • Chunk B - Cloud backend systems • Chunk C - Shared stuffs The initial migration focused on A as we wanted to leverage pant's dependency tracking to keep the artifacts going to the IOT devices as small as possible as they span 💩 networks across a few countries... Anyways Works great. I've been working on B the past few days and I'm having difficulties getting PEX binaries to.. well work for this chunk. It took awhile, like a few months, to unwind the build and get to the point where I'm at today, to build pex binaries and I'm hitting this issue.
Copy code
root@30e064a5e62e:/app# ./server_with_docs.pex/__main__.py 
Traceback (most recent call last):
  File "/app/./server_with_docs.pex/__main__.py", line 108, in <module>
    bootstrap_pex(__entry_point__, execute=__execute__, venv_dir=__venv_dir__)
  File "/app/server_with_docs.pex/.bootstrap/pex/pex_bootstrapper.py", line 627, in bootstrap_pex
    pex.PEX(entry_point).execute()
  File "/app/server_with_docs.pex/.bootstrap/pex/pex.py", line 560, in execute
    sys.exit(self._wrap_coverage(self._wrap_profiling, self._execute))
  File "/app/server_with_docs.pex/.bootstrap/pex/pex.py", line 467, in _wrap_coverage
    return runner(*args)
  File "/app/server_with_docs.pex/.bootstrap/pex/pex.py", line 498, in _wrap_profiling
    return runner(*args)
  File "/app/server_with_docs.pex/.bootstrap/pex/pex.py", line 603, in _execute
    return self.execute_entry(
  File "/app/server_with_docs.pex/.bootstrap/pex/pex.py", line 774, in execute_entry
    return self.execute_module(entry_point.module)
  File "/app/server_with_docs.pex/.bootstrap/pex/pex.py", line 782, in execute_module
    runpy.run_module(module_name, run_name="__main__", alter_sys=True)
  File "/usr/local/lib/python3.9/runpy.py", line 225, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/local/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/app/server_with_docs.pex/enclosure/prism/main.py", line 12, in <module>
    import connexion
  File "/app/server_with_docs.pex/.deps/connexion-2.14.2-py2.py3-none-any.whl/connexion/__init__.py", line 14, in <module>
    from .apis import AbstractAPI  # NOQA
  File "/app/server_with_docs.pex/.deps/connexion-2.14.2-py2.py3-none-any.whl/connexion/apis/__init__.py", line 16, in <module>
    from .abstract import AbstractAPI  # NOQA
  File "/app/server_with_docs.pex/.deps/connexion-2.14.2-py2.py3-none-any.whl/connexion/apis/abstract.py", line 14, in <module>
    from ..exceptions import ResolverError
  File "/app/server_with_docs.pex/.deps/connexion-2.14.2-py2.py3-none-any.whl/connexion/exceptions.py", line 7, in <module>
    from jsonschema.exceptions import ValidationError
  File "/app/server_with_docs.pex/.deps/jsonschema-4.21.1-py3-none-any.whl/jsonschema/__init__.py", line 13, in <module>
    from jsonschema._format import FormatChecker
  File "/app/server_with_docs.pex/.deps/jsonschema-4.21.1-py3-none-any.whl/jsonschema/_format.py", line 11, in <module>
    from jsonschema.exceptions import FormatError
  File "/app/server_with_docs.pex/.deps/jsonschema-4.21.1-py3-none-any.whl/jsonschema/exceptions.py", line 14, in <module>
    from attrs import define
  File "/app/server_with_docs.pex/.deps/attrs-23.2.0-py3-none-any.whl/attrs/__init__.py", line 3, in <module>
    from attr import (
ImportError: cannot import name 'AttrsInstance' from 'pex.vendor._vendored.attrs.attr' (/app/server_with_docs.pex/.bootstrap/pex/vendor/_vendored/attrs/attr/__init__.py)
This doesn't affect chunk A of the repo and I'm not sure where to go from here to debug. Any advice would be helpful.
b
What version of pants? Do you customise your pex version? There’s been a few pex bugs like this that I think have been fixed in recent versions. I’m on mobile so I can’t find the specifics but I guess you can do the search. If that is the case, the
pex-cli
subsystem allows overriding the default pex.
h
See here for discussion and solution.
👍 1
At a previous developers meeting we discussed having a "Recipes/FAQ" area on the docsite that links to github discussions, one per recipe. So @purple-plastic-57801 and @fancy-policeman-6755, if this solution works for you, could you create a GitHub Discussion for it at https://github.com/pantsbuild/pants/discussions, so we have a canonical link to point people to for this question?
If it's come up twice, it'll come up a hundred times more...
Until we fix the underlying issue of course
f
yeah sure