What did `snapcraft clean ... -s` do?

I recently opened up an old project with a quite long and arduous build script that used to work fine. I guess a recent update to snapcraft completely broke it, though, because now it spews errors.

I think I fixed most of them, but one thing I can’t remember is, what did -s do?

This is the command in question:

snapcraft clean kernel -s build

Thanks in advance :call_me_hand:

-s/--step, it cleaned a specific step in the part lifecycle (pull, build, stage, or prime). You’re right, that feature no longer exists. You can clean specific parts completely (snapcraft clean <part>), but for the most part snapcraft should be smart enough to determine when individual lifecycle steps need to be cleaned. I’m curious why a build script would be doing this, that feature was normally used during a development iteration (clean something, run it again, etc.)-- can you give a little context so we can help get you to a happy place?

1 Like

I see, thanks for the info :+1:

(Side note, I literally just found this post lol)

I’m currently re-running the script. What it’s doing is building an image for a specific hardware platform. It appears that that particular step would clean the entire build step, kernel and all, and re-clone and compile the kernel from scratch. This is going to take a hot sec :sweat_smile:

UPDATE: Now getting this error:

Issues while validating snapcraft.yaml: must be one of base: <base> and type: <app|gadget>, base: bare (with a build-base), or type: <base|kernel|snapd> (without a base)

from my kernel snap. Stay tuned for more errors.

Why did it clean the entire build step? Was it building multiple snaps and re-using the rest of it somehow?

That error makes me think you added a base: <something> to a kernel snap, which isn’t actually supposed to specify a base.

To your first point, that’s a great question. I suppose that it must’ve been because it was building kernel, gadget, base, and a few other snaps (it’s a board enablement build script).

To the second point, looks like that was the issue.

The final issue I’m running into is this:

Unable to determine library dependencies for '/home/wnilges/Documents/<PROJECT>/device-ubuntu-core/device-config/prime/bin/device-config'

This snap can be found here and probably just needs an update.

Thoughts?

Snapcraft runs ldd on ELF files to try and understand what libs are required for various reasons. Sounds like ldd is exiting non-zero on that file. That isn’t unheard of, it’s just a warning, but you can try running ldd on it yourself and see what it says (I’m curious as well). Are you noticing problems as a result of this?