Preview: Snapcraft remote build

Before it would only package up git sources if you specified --package-all-sources.

Previously there was a bug where local git sources were not accounted for. Now it will package up git sources if it is local (to match expected behavior).

Though behavior shouldn’t have changed if your source points to a github URL (Snapcraft will simply pass through the remote unless you specified --package-all-sources).

If that’s not the behavior you are seeing, can you share your yaml?

Thanks @cjp256, that is the behaviour I’m seeing, it’s just not what I thought the behaviour used to be.

I thought that previously remote-build would ignore the remote GitHub URL and package and upload my local working tree by default. That’s why remote-build was useful to me, because I wouldn’t have to commit my changes to GitHub before testing them (those changes were already built automatically when committed to master using the GitHub webhook)! You can see from the discussion above that it was previously also packaging up and uploading files included in .gitignore like my node_modules directory, which I didn’t want.

But perhaps I am misremembering and I had always modified snapcraft.yaml to point at my local source.

So anyway, it seems like what I need to do is edit my snapcraft.yaml to point to a local source during development and remember to change it back again before committing my changes.

If your snapcraft.yaml is in the same git repository that you are linking to by full path in source: configuration then you might find using . as a better solution generally - that is unless you need to clone a specific branch or tag to build via the build service, because the build service will always clone the default branch to get the yaml.

1 Like

Oh, thanks! Will that take into account snapcraft.yaml being in the snapcraft/ subdirectory of the repo or does it need to be ../?

for the build service to see it, I believe it needs to be either at ./snap/snapcraft.yaml or ./.snapcraft.yml (that is beginning with a dot if it is in the root directory)

There is another location supported but I can’t remember what that path is - something like ./packaging/snap/snapcraft.yaml but that’s a sheer guess. :wink:

Sorry, I meant snap/, not snapcraft/

The point not being whether the build service can find snapcraft.yaml, but whether remote-build can find the source code one directory level up from snapcraft.yaml in the local working tree?

I will test it.

yes, using remote-build from the top-level project directory, not inside snap/, will work fine.

1 Like