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

fj doesn't build with the serialization feature #681

Closed
kamirr opened this issue Jun 11, 2022 · 1 comment · Fixed by #682
Closed

fj doesn't build with the serialization feature #681

kamirr opened this issue Jun 11, 2022 · 1 comment · Fixed by #682

Comments

@kamirr
Copy link
Contributor

kamirr commented Jun 11, 2022

cargo build --features serialization fails as follows:

Build Log
error: cannot find derive macro `Serialize` in this scope
 --> crates/fj/src/angle.rs:8:46
  |
8 | #[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
  |                                              ^^^^^^^^^

error: cannot find derive macro `Deserialize` in this scope
 --> crates/fj/src/angle.rs:8:57
  |
8 | #[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
  |                                                         ^^^^^^^^^^^

error: cannot find derive macro `Serialize` in this scope
 --> crates/fj/src/shape_2d.rs:8:46
  |
8 | #[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
  |                                              ^^^^^^^^^

error: cannot find derive macro `Deserialize` in this scope
 --> crates/fj/src/shape_2d.rs:8:57
  |
8 | #[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
  |                                                         ^^^^^^^^^^^

error: cannot find derive macro `Serialize` in this scope
  --> crates/fj/src/shape_2d.rs:34:46
   |
34 | #[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
   |                                              ^^^^^^^^^

error: cannot find derive macro `Deserialize` in this scope
  --> crates/fj/src/shape_2d.rs:34:57
   |
34 | #[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
   |                                                         ^^^^^^^^^^^

error: cannot find derive macro `Serialize` in this scope
  --> crates/fj/src/shape_2d.rs:88:46
   |
88 | #[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
   |                                              ^^^^^^^^^

error: cannot find derive macro `Deserialize` in this scope
  --> crates/fj/src/shape_2d.rs:88:57
   |
88 | #[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
   |                                                         ^^^^^^^^^^^

error: cannot find derive macro `Serialize` in this scope
   --> crates/fj/src/shape_2d.rs:133:46
    |
133 | #[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
    |                                              ^^^^^^^^^

error: cannot find derive macro `Deserialize` in this scope
   --> crates/fj/src/shape_2d.rs:133:57
    |
133 | #[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
    |                                                         ^^^^^^^^^^^

error: cannot find derive macro `Serialize` in this scope
 --> crates/fj/src/shape_3d.rs:5:46
  |
5 | #[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
  |                                              ^^^^^^^^^

error: cannot find derive macro `Deserialize` in this scope
 --> crates/fj/src/shape_3d.rs:5:57
  |
5 | #[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
  |                                                         ^^^^^^^^^^^

error: cannot find derive macro `Serialize` in this scope
  --> crates/fj/src/shape_3d.rs:33:46
   |
33 | #[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
   |                                              ^^^^^^^^^

error: cannot find derive macro `Deserialize` in this scope
  --> crates/fj/src/shape_3d.rs:33:57
   |
33 | #[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
   |                                                         ^^^^^^^^^^^

error: cannot find derive macro `Serialize` in this scope
  --> crates/fj/src/shape_3d.rs:65:46
   |
65 | #[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
   |                                              ^^^^^^^^^

error: cannot find derive macro `Deserialize` in this scope
  --> crates/fj/src/shape_3d.rs:65:57
   |
65 | #[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
   |                                                         ^^^^^^^^^^^

error: cannot find derive macro `Serialize` in this scope
  --> crates/fj/src/shape_3d.rs:95:46
   |
95 | #[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
   |                                              ^^^^^^^^^

error: cannot find derive macro `Deserialize` in this scope
  --> crates/fj/src/shape_3d.rs:95:57
   |
95 | #[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
   |                                                         ^^^^^^^^^^^

error: cannot find derive macro `Serialize` in this scope
  --> crates/fj/src/lib.rs:32:46
   |
32 | #[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
   |                                              ^^^^^^^^^

error: cannot find derive macro `Deserialize` in this scope
  --> crates/fj/src/lib.rs:32:57
   |
32 | #[cfg_attr(feature = "serialization", derive(Serialize, Deserialize))]
   |                                                         ^^^^^^^^^^^

error: could not compile `fj` due to 20 previous error

There are three issues responsible for this:

  1. serde doesn't have the derive feature enabled in crates/fj/Cargo.toml.
  2. Lacking use serde::{Serialize, Deserialize};.
  3. Sketch uses raw pointers for managing its data, so the derive macros can't be used.

I'm working on a patch to address those.

@hannobraun
Copy link
Owner

Thanks for reporting this, @kamirr! Looking at your pull request right now.

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

Successfully merging a pull request may close this issue.

2 participants