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

Fails to build latest serde because of out-of-date nightly #65

Closed
xrl opened this issue Oct 6, 2016 · 11 comments
Closed

Fails to build latest serde because of out-of-date nightly #65

xrl opened this issue Oct 6, 2016 · 11 comments

Comments

@xrl
Copy link

xrl commented Oct 6, 2016

I am hitting an issue with serde-derive building on docs.rs: https://docs.rs/crate/rtps/0.2.0/builds/31750

error: the `#[rustc_macro_derive]` attribute is only usable with crates of the `rustc-macro` crate type
 --> .cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive-0.8.11/src/lib.rs:9:3
  |
9 | #[rustc_macro_derive(Serialize)]
  |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The relevant issue in the serde repository: serde-rs/serde#567 .

It looks like the nightly in my build is from September -- perhaps updating it would help?

$ rustc --version
rustc 1.14.0-nightly (289f3a4ca 2016-09-29)
@dtolnay
Copy link
Member

dtolnay commented Oct 6, 2016

Yes updating would help, the rustdoc bug is fixed in rustc 1.14.0-nightly (9c31d76e9 2016-10-03).

@onur
Copy link
Member

onur commented Oct 6, 2016

I updated nightly but still getting same error: https://docs.rs/crate/rtps/0.2.1/builds/31776

@dtolnay
Copy link
Member

dtolnay commented Oct 6, 2016

I cloned rtps 0.2.1 locally and ran cargo doc with rustc 1.14.0-nightly (3210fd5c2 2016-10-05) and it worked. I can try to debug tonight.

@onur
Copy link
Member

onur commented Oct 6, 2016

@dtolnay can you give me rustc command used to compile serde_derive-0.8.11/src/lib.rs from cargo doc --verbose output?

@dtolnay
Copy link
Member

dtolnay commented Oct 6, 2016

rustc /home/david/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive-0.8.11/src/lib.rs --crate-name serde_derive --crate-type rustc-macro -C prefer-dynamic -g -C metadata=a27bc5a26505dfc7 -C extra-filename=-a27bc5a26505dfc7 --out-dir rtps/target/debug/deps --emit=dep-info,link -L dependency=rtps/target/debug/deps --extern serde_codegen=rtps/target/debug/deps/libserde_codegen-d813637bf949d9ed.rlib --cap-lints allow

The difference is --crate-type lib vs --crate-type rustc-macro.

You are going to need a new cargo in order to pick up rust-lang/cargo#3064. I am using cargo 0.13.0-nightly (a713da1 2016-10-05).

@onur
Copy link
Member

onur commented Oct 6, 2016

Yes need to start using a newest version of cargo in cratesfyi.

I'll start working on updating cargo.

@onur onur added the critical label Oct 6, 2016
@xrl
Copy link
Author

xrl commented Oct 9, 2016

@onur is there anything I can do to help?

onur added a commit that referenced this issue Oct 17, 2016
@onur onur closed this as completed in #69 Oct 18, 2016
@onur
Copy link
Member

onur commented Oct 18, 2016

I've updated cargo and serde_derive is building fine now.

But for some reason rtps is still failing to build.

I also tried to build rtps on my local machine (rustc 1.14.0-nightly (6dc035ed9 2016-10-15)) and it says:

error: loading custom derive macro crates is experimentally supported (see issue #35900)
  --> src/lib.rs:16:14
   |
16 | #[macro_use] extern crate serde_derive;
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: add #![feature(proc_macro)] to the crate attributes to enable

error: loading custom derive macro crates is experimentally supported (see issue #35900)
  --> src/lib.rs:16:14
   |
16 | #[macro_use] extern crate serde_derive;
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: add #![feature(proc_macro)] to the crate attributes to enable

error: aborting due to 2 previous errors

error: Could not compile `rtps`.

I believe this issue is fixed in docs.rs and rtmp may need an update for #![feature(proc_macro)] definition.

@xrl
Copy link
Author

xrl commented Oct 20, 2016

This ticket should be reopened as the problem persists. The rustc version is fine but I think the issue may be an older cargo. Here is a recent travis build of rtps which compiles fine: https://travis-ci.org/xdds/rtps/builds/168725503 (this is the version 0.2.3 I published one day ago).

What version of cargo is the service using?

@onur
Copy link
Member

onur commented Oct 20, 2016

@xrl I updated cargo again and looks like everything is working fine now.

BTW clippy is only working on very latest nightly and docs.rs isn't periodically updating nightly ATM. It's better idea to use clippy as a optional dependency. See #54, #62.

@xrl
Copy link
Author

xrl commented Oct 20, 2016

@onur thanks, this is great news! I will take your advice on clippy, it is my highest maintenance dependency.

hadronized pushed a commit to hadronized/docs.rs that referenced this issue Nov 30, 2016
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

3 participants