Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unintended effects of ./contrib/neopg-trezor #429

Open
attila-lendvai opened this issue Aug 31, 2023 · 4 comments
Open

unintended effects of ./contrib/neopg-trezor #429

attila-lendvai opened this issue Aug 31, 2023 · 4 comments

Comments

@attila-lendvai
Copy link

i'm packaging the trezor tools for guix, but i'm not proficient in the python ecosystem.

with that in mind, i think ./contrib/neopg-trezor causes some trouble. there's a sanity-check phase in the guix build of python packages, and i think what it does is that it tries to load every module.

this sanity check phase fails for trezor-agent. i think the cause is that the .egg-info/top_level.txt file is not empty:

$ cat /gnu/store/sy1szncn8qa464611d7a21wz7ks4hwhl-trezor-agent-0.14.7/lib/python3.10/site-packages/trezor_agent-0.12.0-py3.10.egg-info/top_level.txt 
contrib

i fixed the guix package by deleting the entire contrib/ in an early phase of the build of the package.

someone with a better understanding of the python ecosystem may be able to answer whether this is an issue with trezor-agent, or something that the guix package needs to deal with. please close/fix accordingly.

the error output

starting phase `sanity-check'
validating 'trezor-agent' /gnu/store/69vad40nvw6j1kcl34dbis40dcjg1r4g-trezor-agent-0.14.7/lib/python3.10/site-packages
...checking requirements: OK
...trying to load endpoint console_scripts age-plugin-trezor: ERROR:
Traceback (most recent call last):
  File "/gnu/store/iqsjkp55pcx5bfcp2jm9yj5rlx9a0whd-sanity-check.py", line 89, in <module>
    ep.load()
  File "/gnu/store/dy3xh053ahkhrp2jamggq8cpsyvp8mg0-python-3.10.7/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2471, in load
    return self.resolve()
  File "/gnu/store/dy3xh053ahkhrp2jamggq8cpsyvp8mg0-python-3.10.7/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2477, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
ModuleNotFoundError: No module named 'trezor_agent'
...trying to load endpoint console_scripts trezor-agent: ERROR:
Traceback (most recent call last):
  File "/gnu/store/iqsjkp55pcx5bfcp2jm9yj5rlx9a0whd-sanity-check.py", line 89, in <module>
    ep.load()
  File "/gnu/store/dy3xh053ahkhrp2jamggq8cpsyvp8mg0-python-3.10.7/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2471, in load
    return self.resolve()
  File "/gnu/store/dy3xh053ahkhrp2jamggq8cpsyvp8mg0-python-3.10.7/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2477, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
ModuleNotFoundError: No module named 'trezor_agent'
...trying to load endpoint console_scripts trezor-gpg: ERROR:
Traceback (most recent call last):
  File "/gnu/store/iqsjkp55pcx5bfcp2jm9yj5rlx9a0whd-sanity-check.py", line 89, in <module>
    ep.load()
  File "/gnu/store/dy3xh053ahkhrp2jamggq8cpsyvp8mg0-python-3.10.7/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2471, in load
    return self.resolve()
  File "/gnu/store/dy3xh053ahkhrp2jamggq8cpsyvp8mg0-python-3.10.7/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2477, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
ModuleNotFoundError: No module named 'trezor_agent'
...trying to load endpoint console_scripts trezor-gpg-agent: ERROR:
Traceback (most recent call last):
  File "/gnu/store/iqsjkp55pcx5bfcp2jm9yj5rlx9a0whd-sanity-check.py", line 89, in <module>
    ep.load()
  File "/gnu/store/dy3xh053ahkhrp2jamggq8cpsyvp8mg0-python-3.10.7/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2471, in load
    return self.resolve()
  File "/gnu/store/dy3xh053ahkhrp2jamggq8cpsyvp8mg0-python-3.10.7/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2477, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
ModuleNotFoundError: No module named 'trezor_agent'
...trying to load endpoint console_scripts trezor-signify: ERROR:
Traceback (most recent call last):
  File "/gnu/store/iqsjkp55pcx5bfcp2jm9yj5rlx9a0whd-sanity-check.py", line 89, in <module>
    ep.load()
  File "/gnu/store/dy3xh053ahkhrp2jamggq8cpsyvp8mg0-python-3.10.7/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2471, in load
    return self.resolve()
  File "/gnu/store/dy3xh053ahkhrp2jamggq8cpsyvp8mg0-python-3.10.7/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2477, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
ModuleNotFoundError: No module named 'trezor_agent'
error: in phase 'sanity-check': uncaught exception:
%exception #<&invoke-error program: "python" arguments: ("/gnu/store/iqsjkp55pcx5bfcp2jm9yj5rlx9a0whd-sanity-check.py" "/gnu/store/69vad40nvw6j1kcl34dbis40dcjg1r4g-trezor-agent-0.14.7/lib/python3.10/site-packages") exit-status: 1 term-signal: #f stop-signal: #f> 
phase `sanity-check' failed after 0.3 seconds
@attila-lendvai
Copy link
Author

hrm, also note that setuptools can complain like this: error: Multiple top-level packages discovered in a flat-layout: ['contrib', 'libagent']., whatever that means.

i think this is also a sing of some issue.

@romanz
Copy link
Owner

romanz commented Sep 2, 2023

Good catch, thanks!
I have also removed contrib/ in 6776971.

@romanz
Copy link
Owner

romanz commented Sep 2, 2023

Could you please share the commands you are using for packaging?

@attila-lendvai
Copy link
Author

note that "packaging" in guix means building. i don't know the details of how python apps are built in guix, but it involves running setup.py, and/or setuptools, and whatnot. i.e. it may rerun something that you don't run in your normal build process. but then again, i don't know the python build ecosystem.

this is the file: https://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/python-build-system.scm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants