[Solved somehow] Build with a local snap dependency

Howdy guys,

I’m looking to make 2 snaps ‘alice’ and ‘bob’. I already generated ‘alice’ with classic confinement. ‘bob’ as a dependency on ‘alice’ as I require its app during the build.

  • First, I tried using ‘build-snaps: alice’ to make the dependency. I didn’t register ‘alice’ on snapcraft server as I want to debug the whole thing first, so the build can’t retrieve it from server and fails to recover it.

  • Then, I tried using ‘build-snaps: alice.snap’ with locally installed snap. It fails with following log:

Initialising lifecycle
ignore patterns: [‘.snap’]
part build snaps: [‘alice.snap’]
ignore patterns: ['
.snap’]
Installing build-packages
Installing build-snaps
The http error when checking the store for alice.snap is 400 (retries left 5)

So, Is there a way or trick to debug the whole thing ? Or am I forced to publish ‘alice’ ?

Thanks <3

Are you building in destructive, or in managed mode? For destructive mode, if you have the local alice snap installed it’ll be visible to the build, so you don’t need to add it to build-snaps.

For managed mode (via LXD or Multipass), since this is a temporary flow while you debug things I would do something like this: Put the local snap file in 'bob’s project directory, then write an override-pull scriptlet to do something like snap install --dangerous alice-local-snap.snap.

1 Like

Thanks, resolved this part somehow.

  • put ‘alice.snap’ in /snap/local/bin/ folder
  • installed it with
  local:
    plugin: dump
    source: snap/local
    override-build: |
      snap install --dangerous --classic ../src/bin/alice.snap