Rust Plugin build-attributes question (failing validation)

Hi there - I’m working on a snap for ncspot (ncurses spotify player written in Rust). WHen looking at the docs and some samples on github, I see many snapcraft.yaml files using build-attributes: [no-system-libraries] with the rust plugin.

I’m using snapcraft 3 and when building I am running into the following.

Using 'snap/snapcraft.yaml': Project assets will be searched for from the 'snap' directory.
Issues while validating snapcraft.yaml: The 'parts/ncspot/build-attributes[0]' property does not match the required schema: 'no-system-libraries' is not one of ['no-patchelf', 'no-install', 'debug', 'keep-execstack']

So which one of the new options would be the proper one to use?

Also had tried snapcrft help plugins which only showed 2 options:

  - build-attributes: [attribute1, attribute2]

    A list of special attributes that affect the build of this specific part.
    Supported attributes:

      - no-install:
        Do not run the install target provided by the plugin's build system.

        Supported by: kbuild

      - debug:
        Plugins that support the concept of build types build in Release mode
        by default. Setting the 'debug' attribute requests that they instead
        build in Debug mode.

Thank you.

PS - Had read up on - but that one still uses the no-system-libraries option.

PPS - While looking at a bunch of other Rust projects - I suspect this may not be needed.

Hi there.
No system libraries is the default behavior for snapcraft 3.x
Hope this helps!

1 Like

That absolutely does help. I was just not sure because so many of the examples had that attribute. Including the one in the documentation. Completely appreciate the reply!

is this case also when cross compiling
it seems to behave correctly for native build, but when cross-building packages like libc are pulled in.
snapcraft, version 3.8+

Can you clarify what is failing when cross building?

it does not fail to build. But additional dependencies are pulled in. Such as glibc.
And I did not find way to tell snapcraft not to auto-pull in extra dependencies