Supoort for various build targets for the rust plugin

It seems that the build target for a rust project seems to be hardcoded to the “gnu” target. See Rust Plugin.
Inside our Rust project we aim to add support for delivering Snap packages but we also need that the binaries we deliver be built with the musl target instead of the gnu (i.e --target=x86_64-unknown-linux-musl).
Is there any plan to add support for this or is there any workaround to this problem?

Thanks,
Diana

Hi there, thanks for taking interest in the plugin.

I can certainly look into this, if you can provide me with a bootstrap in knowledge (what does the environment need to look like) to set this up I can certainly get this done sooner.

The quick workaround is to either:

  • copy the plugin into your project as <project-root>/snap/plugins/x_rust.py and make the necessary edits.
  • make use of the override-build feature and call rust with the needed parameters.

Cheers,
Sergio