Snapcraft <step> <part> ignores the <part>

This used to work, and the docs indicate that it still should:

$ snapcraft build --help
Usage: snapcraft build [OPTIONS] <part>...

Using current stable (v4.7.1), this only seems to pass snapcraft build to the build instance. Is this a bug, or intended behavior and the docs weren’t updated?

I just gave this a go to see if anything had changed (4.7.1 on LXD), and I think you’re right. For me, snapcraft build <part-name> built all parts (as with snapcraft build). If this is now the correct behaviour (@cjp256 ?), we’ll need to update the help text and the parts docs here (which I’ll do).

Unless I’m missing something, it looks like it’s been that way for a few years at least (if ever in a managed environment).

There’s some upcoming work to pivot to craft-providers which already effectively addresses this, though may take time before landing in snapcraft. @sergiusens do you have a preference if we fix this now (add & use an optional part_names parameter for execute_step())?

1 Like