I currently have a snap that during build time leaves metadata about its build environment in various places. I need to either clear this data up to be consistent, or make use of snapcraft layouts to just symlink/bind the locations so that they’re accessible at runtime.
Specifically, the snap is a compiler framework that JIT’s C++ code. It is leaving references to the $SNAPCRAFT_PART_BUILD and $SNAPCRAFT_PART_INSTALL folders around various locations, E.G, $SNAPCRAFT_PART_BUILD/include.
These include folders do need to exist in $SNAP at runtime, and they do, but because the metadata is still pointing to
/root/ where the snap is built, it is failing due to permission errors and snapcraft layouts cannot help because new top level directories cannot be made.
I am under the impression that Launchpad has some fluidity with the location of the $SNAPCRAFT_PROJECT_DIR variable, if I was able to change this to be say, /var/snap-build ; I’d be able to use layouts to patch around the problem in a way that might be a lot easier than trying to correct it in the program itself.
And so I’m wondering, is there any way to tell snapcraft (with LXD backend, if it changes the answer) to use an alternate $SNAPCRAFT_PROJECT_DIR?