Specify contents of /root/parts/<part>/install

Hi All,

This is my first post so please be kind :slight_smile:

I’m trying to snap an existing cmake super build application.

The build succeeds and the executable is located in /root/parts/<part>/build/install. This makes sense as that is how the cmake project is set up.

It looks like the snapcraft stage step expects the contents of /root/parts/<part>/install to contain the output of the build instead.

Is there a way I can specify in snapcraft.yaml to use a different install folder?

Regards,

Brian

You can use override-build to add some custom logic. e.g. this might work:

parts:
  your-part:
    plugin: cmake
    ... # the rest of your part here
    build-packages:
      ... # the rest of your existing build-packages
      - rsync # make sure rsync is available for the override-build script
    override-build: |
      snapcraftctl build # do the normal build steps supplied with snapcraft
      rsync -a ./install/ $SNAPCRAFT_PART_INSTALL/

Thank you @lucyllewy that worked however I ended up using cp -a rather than rsync. Was there a specific need/reason to use rsync?

Cheers,

Brian

if cp works for you then it’s fine