Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing crate to crates.io fails due to Serialize/Deserialize traits #116

Open
caufieldjh opened this issue Dec 19, 2023 · 2 comments
Open

Comments

@caufieldjh
Copy link
Member

Publishing the crate for the 0.2.11 release failed due to compile-time errors.
The PyPI release went fine.

See https://github.com/monarch-initiative/semsimian/actions/runs/7035367971/job/19145570587

The errors:

error: cannot find derive macro `Serialize` in this scope
Error:  --> src/termset_pairwise_similarity.rs:7:33
  |
7 | #[derive(Debug, Clone, Default, Serialize, Deserialize)]
  |                                 ^^^^^^^^^
  |
note: `Serialize` is imported here, but it is only a trait, without a derive macro
 --> src/termset_pairwise_similarity.rs:4:26
  |
4 | use serde::{Deserialize, Serialize};
  |                          ^^^^^^^^^

error: cannot find derive macro `Deserialize` in this scope
Error:  --> src/termset_pairwise_similarity.rs:7:44
  |
7 | #[derive(Debug, Clone, Default, Serialize, Deserialize)]
  |                                            ^^^^^^^^^^^
  |
note: `Deserialize` is imported here, but it is only a trait, without a derive macro
 --> src/termset_pairwise_similarity.rs:4:13
  |
4 | use serde::{Deserialize, Serialize};
  |             ^^^^^^^^^^^

error: could not compile `semsimian` (lib) due to 2 previous errors
Error: error: failed to verify package tarball
Error: The process '/home/runner/.cargo/bin/cargo' failed with exit code 101
@justaddcoffee
Copy link
Member

One guess is that cargo publish is running in some directory other than where the Cargo.toml file is, so it doesn't read this line:

serde = { version = "1.0.193", features = ["derive"] }

thus the error above?

@justaddcoffee
Copy link
Member

Or @caufieldjh says this might be to do with the fact that github actions here is using the stable build of Rust instead of the nightly build?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants