as the selective-checkout script is used by the pull stage of the main part. This used to work. The docs for after say:
Ensures that all the <part-name>s listed in after are staged before this part begins its lifecycle.
So the main part was only pulled once selective-checkout had been staged.
But with snapcraft 7.2.7 this no longer works, the order of execution seems to have changed. Now all the pull stages run in order first. That means the main part’s pull fails because the selective-checkout’s stage had not yet been run. Is this a bug or intentional behavior?
That’s correct, Snapcraft 7 will stage the dependent part after the build step runs when building core22 snaps. A workaround in this case could be to have a local copy of selective-checkout, and avoid staging patches (by applying them from $CRAFT_PROJECT_DIR/patches instead of $CRAFT_STAGE/patches).
@Lin-Buo-Ren I need to look into this and it might take a while until I have time to tackle this, but if I have something working in regards to snapcraft 7 + selective-checkout I’ll let you know
This was originally intended to be part of the V2 plugin changes for core20, however the implementation kept the previous behavior. This was later addressed and then rolled back because it caused compatibility problems with existing core20 snaps, and the core22-step-dependenciesbuild attribute was added to enable the behavior as opt-in. The idea is to decouple the pull step to work towards offline building, but we’re not quite there yet.