Cannot build rust app with workspaces with core18

Hi,
I need to compile my app https://github.com/qarmin/czkawka which have modules in different workspaces.

When I use in core20 in snapcraft rust-path

rust-path: ["czkawka_gui"]

then compilation works, but gnome-runtime isn’t available for core20 so I can’t use it.

but when I use same rust-path for core18, then this errors is shown to me:

Failed to load plugin: properties failed to load for czkawka: Additional properties are not allowed ('rust-path' was unexpected)

I see that here https://snapcraft.io/docs/rust-plugin shows that this is only available for core18, but maybe is another way to allow to use workspaces?

You may be better served with a custom build. Equivalent core20 rust-plugin support would look something like:

part:
  rust-part:
    plugin: nil
    build-packages:
      - curl
      - gcc
      - git
    override-build: |
      if ! command -v rustup 2>/dev/null; then
          curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --profile=minimal
          export PATH="${HOME}/.cargo/bin:${PATH}"
      fi

      cargo install --locked --path <rust-path> --root "${SNAPCRAFT_PART_INSTALL}" --force --features <optional-features>
2 Likes