override-build exits prematurely, part build succeeds

Bug #2011993 reported by Tony Espy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
New
Undecided
Unassigned

Bug Description

I recently worked with a customer to help them enable video accelerated playback on a their device running Ubuntu Core, and one of the changes necessary was to switch from standard Flutter to a fork called Flutter-elinux which provides a new backend which doesn't rely on GTK.

I ran into a problem with their snap build which I haven't yet been able to root cause. For the sake of this bug, I'm using the workshops snap maintained by the Ubuntu Desktop team, as it exhibits the same behavior as the customer's snap when I update it to use flutter-elinux.

The problem I'm seeing is that when the workshops part runs, the override-build scriptlet exits prematurely, yet snapcraft seems to think the build of the part was successful. This results in the snap build failing because the actual binary 'bin/workshops', isn't found when the snap is packed.

Note - the customer found a workaround, namely to run the first flutter-elinux command (e.g. `flutter-elinux precache`) in an override-stage scriptlet in the flutter-git part, however I would still like to figure out why an override-build scriptlet could exit prematurely, but not trigger a build stage failure.

Snapcraft version: 7.x
Core: 22
Build machine: 22.04 LTS Desktop
Extensions: gnome

Workshop/flutter-elinux branch that fails:
https://github.com/tonyespy/workshops/tree/flutter-elinux

Workshop/flutter-elinux branch that works:
https://github.com/tonyespy/workshops/tree/flutter-elinux-fix

Tony Espy (awe)
summary: - [workshops/flutter-elinux] override-build exits prematurely, part build
- succeeds
+ override-build exits prematurely, part build succeeds
Revision history for this message
Tony Espy (awe) wrote :

Note, @Sergio suggested earlier this week that I used `snapcraft build --shell; cd parts/workshops/build` and then try to run the commands from the scriptlet manually to try and catch the failure. This almost works... it doesn't actually drop me into the right directory, so after cd'ing to /root/parts/workshops/build, I found that (a) the directory wasn't populated and (b) flutter-elinux wasn't found on my PATH.

What I finally ended up doing was adding:

craftctl default
exit 0

...to my scriptlet, and then running `snapcraft build workshops --shell-after`, which dropped me into the container with a populated build directory, and flutter-elinux found on my PATH.

Of course now when I run all of the flutter-elinux commands by hand, it works. Thanks Murphy.

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.