rust plugin crashes when trying to rebuild a snap package
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
To reproduce:
- create a rust project that will build and install executables (e.g. with `cargo init --bin`)
- add a snapcraft.yaml using the rust plugin
- run `snapcraft` (this works)
- run `snapcraft` again. This fails with:
```
/root/.
Installing scriptkeeper v0.1.0 (/root/
error: binary `scriptkeeper` already exists in destination as part of `scriptkeeper v0.1.0 (/root/
Add --force to overwrite
```
It seems as if the plugin runs `cargo install` on the same virtual machine, but that fails the second time, because `cargo` prevents you from overwriting executables without passing `--force`. `snapcraft clean scriptkeeper` fixes this, but it also means that I have to rebuild the entire project for every little change. Which is annoying when trying to debug the snap file.
Here's the project and commit where I'm seeing this: https:/
Using:
- snapcraft, version 3.4
- multipass 0.6.0
- multipassd 0.6.0
- Ubuntu 18.10
- base: core18
Changed in snapcraft: | |
status: | New → Fix Committed |
Changed in snapcraft: | |
status: | Fix Committed → Fix Released |
I found this workaround that allows not doing a full rebuild:
parts: /forum. snapcraft. io/t/issue- with-rebuilding -a-rust- snap/10830 PART_INSTALL/ bin/juju- kubectl" ] && rm "$SNAPCRAFT_ PART_INSTALL/ bin/juju- kubectl"
part-name:
source: .
plugin: rust
# https:/
override-build: |
[ -f "$SNAPCRAFT_
snapcraftctl build