snap build recipes don't seem to handle core24 "platforms" section

Bug #2072622 reported by James Henstridge
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Quentin Debhi

Bug Description

I recently upgraded one of my architecture independent snaps to build with core24, and the Launchpad build recipe started failing. Here is an example failure log:

https://launchpadlibrarian.net/738762228/buildlog_snap_ubuntu_noble_amd64_ubuntu-desktop-session-snap-core24_BUILDING.txt.gz

Comparing with a previous log files, a successful build invokes buildsnap with:

    RUN: /usr/share/launchpad-buildd/bin/in-target buildsnap --backend=lxd --series=focal --arch=amd64 SNAPBUILD-2523812 --channel core20=stable --channel snapcraft=stable/launchpad-buildd --build-request-id 90050156 --build-request-timestamp 2024-06-25T07:45:11Z --build-url 'https://launchpad.net/~ubuntu-desktop/+snap/ubuntu-desktop-session-snap-core24/+build/2523812' --proxy-url http://10.10.10.1:8222/ --revocation-endpoint http://builder-proxy-auth.lp.internal:8080/tokens/SNAPBUILD-2523812-1719301525 --git-repository https://git.launchpad.net/ubuntu-desktop-session-snap --git-path 24 --target-arch all ubuntu-desktop-session

and the failed build invoked it as:

    RUN: /usr/share/launchpad-buildd/bin/in-target buildsnap --backend=lxd --series=noble --arch=amd64 SNAPBUILD-2537037 --channel snapcraft=stable/launchpad-buildd --build-request-id 90428341 --build-request-timestamp 2024-07-10T04:15:11Z --build-url 'https://launchpad.net/~ubuntu-desktop/+snap/ubuntu-desktop-session-snap-core24/+build/2537037' --proxy-url http://10.10.10.1:8222/ --revocation-endpoint http://builder-proxy-auth.lp.internal:8080/tokens/SNAPBUILD-2537037-1720584920 --git-repository https://git.launchpad.net/ubuntu-desktop-session-snap --git-path 24 --target-arch amd64 ubuntu-desktop-session

Of note, it's changed "--target-arch all" to "--target-arch amd64", and there is no amd64 snap to build (since it is architecture independent).

For core24 builds, Snapcraft has changed the syntax it uses to specify which architectures to build on as described in the documentation:

https://snapcraft.io/docs/architectures

It now uses a "platforms" top level section rather than "architectures". So I'd changed my snap to use:

    platforms:
      all:
        build-on: amd64
        build-for: all

This works fine building locally with Snapcraft 8.3.1, but the code in Launchpad used to schedule builds seems to only consult "architectures" when deciding what builds to schedule:

https://git.launchpad.net/launchpad/tree/lib/lp/snappy/adapters/buildarch.py#n175

So it ends up scheduling an amd64 build rather than an architecture independent build.

I can't work around the problem by leaving the old architectures section in place, since Snapcraft will reject that in core24 projects.

Changed in launchpad:
importance: Undecided → High
status: New → Triaged
tags: added: buildfarm lp-snappy
Changed in launchpad:
status: Triaged → In Progress
assignee: nobody → Quentin Debhi (ruinedyourlife)
Revision history for this message
Callahan Kovacs (mr-cal) wrote :

Hi @ines-almeida and @ruinedyourlife - Is there any update on this? Thanks!

Revision history for this message
Quentin Debhi (ruinedyourlife) wrote :

hi @mr-cal
it is currently merged and i was in the middle of testing this with @lgp171188
sadly, qastaging was not exactly fitted for our needs
i'll get back to this asap to get it deployed

here is the MP if you wanna take a look at it:
https://bugs.launchpad.net/launchpad/+bug/2072622

Revision history for this message
Quentin Debhi (ruinedyourlife) wrote :

now deployed

tested a build here:
https://launchpad.net/~ruinedyourlife/snap-base-unification-core24/+snap/snap-base-unification-core24/+build/2565429

built succesfully

sadly, for arm builds, we are still missing "something", which idk what it is yet
when i have arm platforms in `snapcraft.yaml`, it does not know how to build it
you can check this out here:
https://launchpad.net/~ruinedyourlife/snap-base-unification-core24/+snap/snap-base-unification-core24

i suspect we are missing something inside Launchpad

Revision history for this message
Quentin Debhi (ruinedyourlife) wrote :

most likely it was a miss on my end, i'll get some advice towards that and change the status of this accordingly

Changed in launchpad:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.