I’m updating a core18
snap to core22
. One of the parts is Rust-based, and in the original version the following was sufficient to get it built.
xxx:
plugin: rust
source: .
With a core22
base this fails with the error:
Environment validation failed for part 'xxx': 'cargo' not found and part 'xxx' does not depend on a part named 'rust-deps' that would satisfy the dependency.
I don’t get the part about rust-deps
, but the cargo
dependency part is clear, also based on (micro) Howto migrate from core20 to core22. Adding
build-packages: [cargo, rustc]
to the part definition seems to allow the build to start, but it promptly fails with
Executing parts lifecycle: build xxx
[18/Jul/2022:16:40:52 +0000] "CONNECT crates.io:443 HTTP/1.1" 200 78517 "-" "cargo 1.59.0"
[18/Jul/2022:16:40:52 +0000] "CONNECT crates.io:443 HTTP/1.1" 200 8644 "-" "cargo 1.59.0"
[18/Jul/2022:16:40:52 +0000] "CONNECT static.crates.io:443 HTTP/1.1" 200 10253797 "-" "cargo 1.59.0"
[18/Jul/2022:16:40:52 +0000] "CONNECT github.com:443 HTTP/1.1" 200 81731880 "-" "git/1.0 (git2-curl 0.14.1)"
Failed to run the build script for part 'xxx'.
Full execution log: '/root/.cache/snapcraft/log/snapcraft-20220718-164025.781575.log'
Build failed
The above is from the CI builder. I was able to reproduce this locally, and it appears that my snap is being built with the stable Rust toolchain. The build fails because the code itself is dependent on nightly features. I do have a rust-toolchain.toml
file that states
[toolchain]
channel = "nightly"
and this was being correctly picked up and built with the core18
base, but appears to be getting ignored now. This is all with snapcraft version 7.0.11.
Any tips on where I go from here?