In my project https://github.com/sourcefrog/conserve/tree/261a94fb4def022ace890436a5784c2ec2e6b1d2
I have the strange behavior that cargo build --release
succeeds, but cargo install --offline --locked --path .
fails with errors about derive macros:
error: cannot find derive macro `Serialize` in this scope
--> src/apath.rs:25:39
|
25 | #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
| ^^^^^^^^^
error: cannot find derive macro `Deserialize` in this scope
--> src/apath.rs:25:50
|
25 | #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
| ^^^^^^^^^^^
error: cannot find derive macro `Serialize` in this scope
--> src/archive.rs:35:17
|
35 | #[derive(Debug, Serialize, Deserialize)]
| ^^^^^^^^^
...
It looks like the problem is that I didn't specify serde = { version = "1.0.104", features = ["derive"] }
in my Cargo.toml
. I had serde_derive = "1.0.104"
and I had thought that was enough.
It's perhaps just my bug but it's quite surprising the dependency features seem to behave differently under install
vs build
. The same behavior occurs if I build in a clean directory, or do cargo clean
.