Redefining the source directory for building snaps with the base keyword


#1

I have a repository that I want to build multiple snaps with. Each directory with the different packages has its own snapcraft.yaml; however, some of these directories require the other packages in order to build. The problem is that when building these packages with the “base” keyword, it only mounts the directory that the snapcraft.yaml is in and not the parent directory. Is there any way to redefine what directory gets mounted in the VM?


#2

See https://github.com/solvespace/solvespace/blob/master/pkg/snap/build.sh for a pragmatic approach that copies the parent tree into one of its own subdirectories. It wraps the snapcraft command, so no functionality is lost.