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

snapcraft: prime only needed python bits for pyuefivars #345

Merged
merged 2 commits into from
Feb 21, 2024

Conversation

simondeziel
Copy link
Member

It looks like the snapcraft python plugin does weird things as the uefivars part ended up bringing a lot of unneeded bits:

$ du -smc /snap/lxd/current/lib/python3.10/site-packages/*
1	/snap/lxd/current/lib/python3.10/site-packages/_distutils_hack
1	/snap/lxd/current/lib/python3.10/site-packages/distutils-precedence.pth
1	/snap/lxd/current/lib/python3.10/site-packages/google_crc32c
1	/snap/lxd/current/lib/python3.10/site-packages/google_crc32c-1.5.0.dist-info
1	/snap/lxd/current/lib/python3.10/site-packages/google_crc32c.libs
12	/snap/lxd/current/lib/python3.10/site-packages/pip
1	/snap/lxd/current/lib/python3.10/site-packages/pip-24.0.dist-info
2	/snap/lxd/current/lib/python3.10/site-packages/pkg_resources
1	/snap/lxd/current/lib/python3.10/site-packages/pyuefivars
1	/snap/lxd/current/lib/python3.10/site-packages/pyuefivars-0.1.dist-info
4	/snap/lxd/current/lib/python3.10/site-packages/setuptools
1	/snap/lxd/current/lib/python3.10/site-packages/setuptools-69.1.0.dist-info
1	/snap/lxd/current/lib/python3.10/site-packages/wheel
1	/snap/lxd/current/lib/python3.10/site-packages/wheel-0.42.0.dist-info
18	total

The other python bits we have are all under lib/python3 so I did some mangling to put pyuefivars there as well. Since pip/setuptools and wheel packages are only needed to install/update packages, I dropped them as unneeded bits.

Lastly, this is amd64/arm64 specific so I added the usual set of override-*.

This was tested locally to not break lxc config uefi.

Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tomponline
Copy link
Member

How do u find out what it actually needs, go through the source?

@tomponline tomponline merged commit cfe0ae4 into canonical:latest-edge Feb 21, 2024
5 checks passed
@simondeziel simondeziel deleted the smaller-uefivars branch February 21, 2024 22:02
@simondeziel
Copy link
Member Author

Yeah, mostly by looking at the sources that has setup.py mention google_crc32c as the only dependency (which I'm not sure we even need for our use but it's tiny).

What prompted me into looking into this is the inflation of the snap ;)

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

Successfully merging this pull request may close these issues.

2 participants