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

Parts from Noble packages/sources #705

Merged
merged 29 commits into from
Feb 3, 2025

Conversation

simondeziel
Copy link
Member

@simondeziel simondeziel commented Jan 30, 2025

Some of those changes also resulted in a smaller snap (~7MiB):

root@v1:~# df -ha | grep /snap/lxd
/dev/loop2      116M  116M     0 100% /snap/lxd/32244
/dev/loop3      109M  109M     0 100% /snap/lxd/x1

and a smaller squashfs (~36MiB) as well:

root@v1:~# du -shc /snap/lxd/*
403M	/snap/lxd/32244
367M	/snap/lxd/x1

This means faster download, faster decompression and less RAM usage.

It's also a little faster to build even on amd64:

$ rm *.snap; snapcraft clean; time snapcraft && git checkout parts-from-pkgs && snapcraft clean; time snapcraft
rm: cannot remove '*.snap': No such file or directory
Version has been set to '0+git.a4c733d5'
Version has been set to '0+git.a4c733d5' 
Lint warnings:
- library: libapparmor.so.1: unused library 'lib/libapparmor.so.1.19.0'. (https://snapcraft.io/docs/linters-library)
- library: libnvidia-container-go.so.1: unused library 'lib/libnvidia-container-go.so.1.17.2'. (https://snapcraft.io/docs/linters-library)
- library: libatomic.so.1: unused library 'lib/x86_64-linux-gnu/libatomic.so.1.2.0'. (https://snapcraft.io/docs/linters-library)
- library: libjson-glib-1.0.so.0: unused library 'lib/x86_64-linux-gnu/libjson-glib-1.0.so.0.800.0'. (https://snapcraft.io/docs/linters-library)
- library: liburing-ffi.so.2: unused library 'lib/x86_64-linux-gnu/liburing-ffi.so.2.5'. (https://snapcraft.io/docs/linters-library)
- library: libusbredirhost.so.1: unused library 'lib/x86_64-linux-gnu/libusbredirhost.so.1.0.3'. (https://snapcraft.io/docs/linters-library)
- library: libnvpair.so.3: unused library 'zfs-2.1/lib/libnvpair.so.3.0.0'. (https://snapcraft.io/docs/linters-library)
- library: libuutil.so.3: unused library 'zfs-2.1/lib/libuutil.so.3.0.0'. (https://snapcraft.io/docs/linters-library)
- library: libzfs.so.4: unused library 'zfs-2.1/lib/libzfs.so.4.1.0'. (https://snapcraft.io/docs/linters-library)
- library: libzfs_core.so.3: unused library 'zfs-2.1/lib/libzfs_core.so.3.0.0'. (https://snapcraft.io/docs/linters-library)
- library: libzfsbootenv.so.1: unused library 'zfs-2.1/lib/libzfsbootenv.so.1.0.0'. (https://snapcraft.io/docs/linters-library)
- library: libzpool.so.5: unused library 'zfs-2.1/lib/libzpool.so.5.0.0'. (https://snapcraft.io/docs/linters-library)
- library: libzfsbootenv.so.1: unused library 'zfs-2.2/lib/libzfsbootenv.so.1.0.0'. (https://snapcraft.io/docs/linters-library)
- library: libzpool.so.5: unused library 'zfs-2.2/lib/libzpool.so.5.0.0'. (https://snapcraft.io/docs/linters-library)
Version has been set to '0+git.a4c733d5'
Packed lxd_0+git.a4c733d5_amd64.snap

real	34m11.341s
user	0m4.049s
sys	0m4.676s
Switched to branch 'parts-from-pkgs'
Version has been set to '0+git.73e33c03'
Version has been set to '0+git.73e33c03'
Lint warnings:
- library: libnvpair.so.3: unused library 'zfs-2.1/lib/libnvpair.so.3.0.0'. (https://snapcraft.io/docs/linters-library)
- library: libuutil.so.3: unused library 'zfs-2.1/lib/libuutil.so.3.0.0'. (https://snapcraft.io/docs/linters-library)
- library: libzfs.so.4: unused library 'zfs-2.1/lib/libzfs.so.4.1.0'. (https://snapcraft.io/docs/linters-library)
- library: libzfs_core.so.3: unused library 'zfs-2.1/lib/libzfs_core.so.3.0.0'. (https://snapcraft.io/docs/linters-library)
Version has been set to '0+git.73e33c03'
Packed lxd_0+git.73e33c03_amd64.snap

real	31m57.397s
user	0m4.069s
sys	0m4.670s

But should be quite a bit faster on arches without QEMU/edk2

and libtpms0 (0.9.3-0ubuntu4)

Signed-off-by: Simon Deziel <[email protected]>
…u2) is broken

When using upstream sources, version 1.0.0 worked but the Ubuntu package one does not:

```
==> Set a valid variable data
+ lxc config uefi set v1 testvar-8be4df61-93ca-11d2-aa0d-00e098032b8c=48656c6c6f2066726f6d204c5844
Error: Failed to run: uefivars.py -i json -o edk2: exit status 1 (Reading uefivars from stdin
Read 41 variables
Traceback (most recent call last):
  File "/snap/lxd/x2/bin/uefivars.py", line 33, in <module>
    sys.exit(load_entry_point('pyuefivars==0.1', 'console_scripts', 'uefivars.py')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/snap/lxd/current/lib/python3/dist-packages/pyuefivars/__init__.py", line 156, in main
    outfile.write(bytes(varstore))
                  ^^^^^^^^^^^^^^^
  File "/snap/lxd/current/lib/python3/dist-packages/pyuefivars/edk2.py", line 295, in __bytes__
    self.blockmap = [(self.length // OVMF_BLOCK_SIZE, OVMF_BLOCK_SIZE)]
                                     ^^^^^^^^^^^^^^^
NameError: name 'OVMF_BLOCK_SIZE' is not defined. Did you mean: 'self.OVMF_BLOCK_SIZE'?)
```

This is due to a regression introduced by an Ubuntu patch:
https://git.launchpad.net/ubuntu/+source/python-uefivars/tree/debian/patches/edk2.py-Improve-firmware-volume-de-serialization.patch?h=ubuntu/noble#n112

This patch was dropped in versions after Noble so we should try to use the
future package that comes with `core26`.

Signed-off-by: Simon Deziel <[email protected]>
…ld3)

This avoid `pip` installing the Google version.

Signed-off-by: Simon Deziel <[email protected]>
Even if it did, there is a `libapparmor.so.1` available in `core24`.

Signed-off-by: Simon Deziel <[email protected]>
The snapcraft linter has been complaining that `libusbredirhost.so.1` was
primed without being used by any of the binaries/libs which was true:

```
root@v1:/snap/lxd/current# find -type f -exec ldd {} + 2>&1 | grep libusbredirhost
./lib/x86_64-linux-gnu/libusbredirhost.so.1.0.3:
```

This single hit is because `ldd` report about which file it lists when calling
it on multiple files to inspect.

Signed-off-by: Simon Deziel <[email protected]>
The snapcraft linter has been complaining that `libnvidia-container-go.so.1`
was primed without being used by any of the binaries/libs which was true:

```
root@v1:/snap/lxd/current# find -type f -exec ldd {} + 2>&1 | grep libnvidia-container-go
./lib/libnvidia-container-go.so.1.17.2:
```

This single hit is because `ldd` report about which file it lists when calling
it on multiple files to inspect.

Signed-off-by: Simon Deziel <[email protected]>
Signed-off-by: Simon Deziel <[email protected]>
The previous wildcard included `liburing-ffi.so` which was not used by
anything.

Signed-off-by: Simon Deziel <[email protected]>
@simondeziel simondeziel marked this pull request as ready for review February 1, 2025 13:22
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 tomponline merged commit 6c0107c into canonical:latest-edge Feb 3, 2025
4 checks passed
@simondeziel simondeziel deleted the parts-from-pkgs branch February 3, 2025 16:38
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