canonical / wlcs

Wayland Conformance Test Suite
GNU General Public License v2.0
50 stars 14 forks source link

spread: add Arch Linux task #344

Closed FabioLolix closed 1 month ago

FabioLolix commented 1 month ago

Hello, following the kind request to add spread CI for Arch Linux https://github.com/canonical/mir/issues/3537#issuecomment-2341510597 https://github.com/canonical/mir/issues/3593#issuecomment-2396120297

I started with wlcs because it have less dependencies

I have never used spread, LXC, LXD or any CI/CD before and I have at least an issue with most LXD images

spread.yaml is still unedited

spread compiled yesterday (local Arch pkgbuild)

$ spread -v
2024-10-08 18:55:41 Found /home/fabio/Dev-Git/wlcs/spread.yaml.
2024-10-08 18:55:41 Project content is packed for delivery (247.24KB).
2024-10-08 18:55:41 Sequence of jobs produced with -seed=1728406541
2024-10-08 18:55:41 If killed, discard servers with: spread -reuse-pid=527863 -discard
2024-10-08 18:55:41 Allocating lxd:alpine-edge...
2024-10-08 18:55:41 Allocating lxd:ubuntu-devel...
2024-10-08 18:55:41 Allocating lxd:ubuntu-23.10...
2024-10-08 18:55:41 Allocating lxd:fedora-rawhide...
2024-10-08 18:55:41 Allocating lxd:alpine-3.19...
2024-10-08 18:55:41 Allocating lxd:alpine-3.20...
2024-10-08 18:55:41 Allocating lxd:ubuntu-24.04...
2024-10-08 18:55:41 Allocating lxd:fedora-39...
2024-10-08 18:55:41 Allocating lxd:ubuntu-22.04...
2024-10-08 18:55:41 Allocating lxd:fedora-40...
2024-10-08 18:55:41 Using cached LXD image for lxd:ubuntu-23.10: 6f0e5207fc85
2024-10-08 18:55:41 Using cached LXD image for lxd:ubuntu-22.04: 7ff91d595eaf
2024-10-08 18:55:41 Using cached LXD image for lxd:ubuntu-24.04: 788feb0b7c4a
2024-10-08 18:55:41 Cannot find cached LXD image for lxd:alpine-3.19.
2024-10-08 18:55:41 Cannot find cached LXD image for lxd:alpine-edge.
2024-10-08 18:55:41 Cannot find cached LXD image for lxd:fedora-39.
2024-10-08 18:55:41 Cannot find cached LXD image for lxd:alpine-3.20.
2024-10-08 18:55:41 Cannot find cached LXD image for lxd:fedora-rawhide.
2024-10-08 18:55:41 Cannot find cached LXD image for lxd:fedora-40.
2024-10-08 18:55:41 Cannot find cached LXD image for lxd:ubuntu-devel.
2024-10-08 18:55:42 Cannot allocate lxd:alpine-3.19: cannot launch lxd container: 
-----
Creating spread-54-alpine-3-19
Starting spread-54-alpine-3-19            
Error: Failed to run: /usr/bin/lxd forkstart spread-54-alpine-3-19 /var/lib/lxd/containers /var/log/lxd/spread-54-alpine-3-19/lxc.conf: exit status 1
Try `lxc info --show-log local:spread-54-alpine-3-19` for more info
-----
2024-10-08 18:55:42 Cannot allocate lxd:alpine-3.20: cannot launch lxd container: 
-----
Creating spread-57-alpine-3-20
Starting spread-57-alpine-3-20            
Error: Failed to run: /usr/bin/lxd forkstart spread-57-alpine-3-20 /var/lib/lxd/containers /var/log/lxd/spread-57-alpine-3-20/lxc.conf: exit status 1
Try `lxc info --show-log local:spread-57-alpine-3-20` for more info
-----
2024-10-08 18:55:43 Cannot allocate lxd:alpine-edge: cannot launch lxd container: 
-----
Creating spread-55-alpine-edge
Starting spread-55-alpine-edge            
Error: Failed to run: /usr/bin/lxd forkstart spread-55-alpine-edge /var/lib/lxd/containers /var/log/lxd/spread-55-alpine-edge/lxc.conf: exit status 1
Try `lxc info --show-log local:spread-55-alpine-edge` for more info
-----
2024-10-08 18:55:44 Cannot allocate lxd:fedora-39: cannot launch lxd container: 
-----
Creating spread-56-fedora-39
Starting spread-56-fedora-39              
Error: Failed to run: /usr/bin/lxd forkstart spread-56-fedora-39 /var/lib/lxd/containers /var/log/lxd/spread-56-fedora-39/lxc.conf: exit status 1
Try `lxc info --show-log local:spread-56-fedora-39` for more info
-----
2024-10-08 18:55:44 Cannot allocate lxd:fedora-rawhide: cannot launch lxd container: 
-----
Creating spread-58-fedora-rawhide
Starting spread-58-fedora-rawhide         
Error: Failed to run: /usr/bin/lxd forkstart spread-58-fedora-rawhide /var/lib/lxd/containers /var/log/lxd/spread-58-fedora-rawhide/lxc.conf: exit status 1
Try `lxc info --show-log local:spread-58-fedora-rawhide` for more info
-----
2024-10-08 18:55:45 Cannot allocate lxd:fedora-40: cannot launch lxd container: 
-----
Creating spread-59-fedora-40
Starting spread-59-fedora-40              
Error: Failed to run: /usr/bin/lxd forkstart spread-59-fedora-40 /var/lib/lxd/containers /var/log/lxd/spread-59-fedora-40/lxc.conf: exit status 1
Try `lxc info --show-log local:spread-59-fedora-40` for more info
-----
2024-10-08 18:55:45 Cannot allocate lxd:ubuntu-24.04: cannot launch lxd container: 
-----
Creating spread-53-ubuntu-24-04
Starting spread-53-ubuntu-24-04           
Error: Failed to run: /usr/bin/lxd forkstart spread-53-ubuntu-24-04 /var/lib/lxd/containers /var/log/lxd/spread-53-ubuntu-24-04/lxc.conf: exit status 1
Try `lxc info --show-log local:spread-53-ubuntu-24-04` for more info
-----
2024-10-08 18:55:46 Cannot allocate lxd:ubuntu-devel: cannot launch lxd container: 
-----
Creating spread-60-ubuntu-devel
Starting spread-60-ubuntu-devel             
Error: Failed to run: /usr/bin/lxd forkstart spread-60-ubuntu-devel /var/lib/lxd/containers /var/log/lxd/spread-60-ubuntu-devel/lxc.conf: exit status 1
Try `lxc info --show-log local:spread-60-ubuntu-devel` for more info
-----
2024-10-08 18:55:46 Cannot allocate lxd:ubuntu-22.04: cannot launch lxd container: 
-----
Creating spread-52-ubuntu-22-04
Starting spread-52-ubuntu-22-04             
Error: Failed to run: /usr/bin/lxd forkstart spread-52-ubuntu-22-04 /var/lib/lxd/containers /var/log/lxd/spread-52-ubuntu-22-04/lxc.conf: exit status 1
Try `lxc info --show-log local:spread-52-ubuntu-22-04` for more info
-----
2024-10-08 18:55:46 Cannot allocate lxd:ubuntu-23.10: cannot launch lxd container: 
-----
Creating spread-51-ubuntu-23-10
Starting spread-51-ubuntu-23-10           
Error: Failed to run: /usr/bin/lxd forkstart spread-51-ubuntu-23-10 /var/lib/lxd/containers /var/log/lxd/spread-51-ubuntu-23-10/lxc.conf: exit status 1
Try `lxc info --show-log local:spread-51-ubuntu-23-10` for more info
-----
2024-10-08 18:55:46 Successful tasks: 0
2024-10-08 18:55:46 Aborted tasks: 20
error: unsuccessful run
[fabio@archlinux wlcs]$
 lxc info --show-log local:spread-54-alpine-3-19
Error: Failed to fetch instance "spread-54-alpine-3-19" in project "default": Instance not found
$ lxc info --show-log local:spread-51-ubuntu-23-10
Error: Failed to fetch instance "spread-51-ubuntu-23-10" in project "default": Instance not found
Saviq commented 1 month ago

Thanks @FabioLolix!

We're actually using a fork of spread: https://github.com/MirServer/spread-mir-ci/, you should be able to use it as a snap: https://snapcraft.io/spread-mir-ci/.

I had to add Arch Linux support there:

https://github.com/canonical/spread/commit/50434fee9b6062c11ca74f2672c164616e52d2cb

And with the tweaks I made to your task, I successfully built locally :)

CI for it will fail until the snap gets built: https://launchpad.net/~mir-team/+snap/spread-mir-ci, will monitor when that's done and circle back.

Thanks again :)

FabioLolix commented 1 month ago

We're actually using a fork of spread: https://github.com/MirServer/spread-mir-ci/, you should be able to use it as a snap

I prefer native packagig :), so I builded that but I have the same problem as before

And with the tweaks I made to your task, I successfully built locally :)

No issues around with LTO ? I got a problem with that

Thanks again :)

You're welcome :)

let me know if you'd like to tweak anything.

It's fine

Saviq commented 1 month ago

I prefer native packagig :), so I builded that but I have the same problem as before

Do you have LXD working? That's what our setup uses for containers… Anyway, OT.

No issues around with LTO ? I got a problem with that

No, I suppose it's not enabled by default? Could you try a PR with however you're enabling LTO?

I'll merge in the mean time.

FabioLolix commented 1 month ago

No, I suppose it's not enabled by default? Could you try a PR with however you're enabling LTO?

Ah yes, it is enable by default when packaging, not when launching cmake directly

The flags can be seen here: https://gitlab.archlinux.org/archlinux/packaging/packages/pacman/-/blob/main/makepkg.conf?ref_type=heads

CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
        -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \
        -fstack-clash-protection -fcf-protection \
        -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now \
         -Wl,-z,pack-relative-relocs"
LTOFLAGS="-flto=auto"
#-- Make Flags: change this for DistCC/SMP systems
#MAKEFLAGS="-j2"
#-- Debugging flags
DEBUG_CFLAGS="-g"
DEBUG_CXXFLAGS="$DEBUG_CFLAGS"

I'm not sure how to correctly pass that to cmake here

Do you have LXD working? That's what our setup uses for containers… Anyway, OT.

Yes for VM, had to downgrade Qemu to 9.0.2, containers still fails to run but don't have problems with Instance not found