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

serde_derive fails to compile as part of cargo build #3965

Closed
djc opened this Issue Apr 27, 2017 · 6 comments

Comments

Projects
None yet
4 participants
@djc
Copy link
Contributor

djc commented Apr 27, 2017

I'm trying to update the Gentoo Linux packages for cargo to 0.18.0, and am running into trouble with the compile process exiting with the error that serde_derive cannot be compiled:

error: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type
  --> /var/tmp/portage/dev-util/cargo-0.18.0/work/cargo_home/gentoo/serde_derive-0.9.12/src/lib.rs:24:3
   |
24 | #[proc_macro_derive(Serialize, attributes(serde))]
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Here's the configure output for starters:

enrai cargo-0.18.0 # ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-unknown-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --docdir=/usr/share/doc/cargo-0.18.0 --libdir=/usr/lib64 --host=x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu --target=x86_64-unknown-linux-gnu --cargo=/var/tmp/portage/dev-util/cargo-0.18.0/work/cargo-0.18.0/target/snapshot/bin/cargo --enable-optimize --disable-verify-install --disable-debug --disable-cross-tests --help
configure: looking for configure programs
configure: found cmp
configure: found mkdir
configure: found printf
configure: found cut
configure: found head
configure: found grep
configure: found xargs
configure: found cp
configure: found find
configure: found uname
configure: found date
configure: found tr
configure: found sed
configure: found cmake
configure: found make
configure: recreating config.tmp
configure: 
configure: processing ./configure args
configure: 
configure: CFG_DISABLE_DEBUG    := 1 
configure: CFG_DISABLE_VERIFY_INSTALL := 1 
configure: CFG_DISABLE_CROSS_TESTS := 1 
configure: CFG_PREFIX           := /usr 
configure: CFG_LOCAL_RUST_ROOT  :=  
configure: CFG_CARGO            := /var/tmp/portage/dev-util/cargo-0.1 ...
configure: CFG_RUSTC            := rustc 
configure: CFG_RUSTDOC          := rustdoc 
configure: CFG_CARGO            := /var/tmp/portage/dev-util/cargo-0.1 ...
configure: CFG_RUSTC            := /usr/bin/rustc (1.16.0)
configure: CFG_RUSTDOC          := /usr/bin/rustdoc (1.16.0)
configure: CFG_BUILD            := x86_64-unknown-linux-gnu 
configure: CFG_HOST             := x86_64-unknown-linux-gnu 
configure: CFG_TARGET           := x86_64-unknown-linux-gnu 
configure: CFG_LOCALSTATEDIR    := /var/lib 
configure: CFG_SYSCONFDIR       := /etc 
configure: CFG_DATADIR          := /usr/share 
configure: CFG_INFODIR          := /usr/share/info 
configure: CFG_DOCDIR           := /usr/share/doc/cargo-0.18.0 
configure: CFG_MANDIR           := /usr/share/man 
configure: CFG_LIBDIR           := /usr/lib64 
configure: git: no git directory. Changing default release channel to stable
configure: CFG_RELEASE_CHANNEL  := stable 
configure: 
configure: validating ./configure args
configure: 

No more help available for Configure options,
check the Wiki or join our IRC channel
configure: 
configure: looking for build programs
configure: 
configure: CFG_CC               := /usr/bin/cc (4.9.4)
configure: GIT                  := /usr/bin/git (2.10.2)
configure: 
configure: writing configuration
configure: 
configure: CFG_SRC_DIR          := /var/tmp/portage/dev-util/cargo-0.1 ...
configure: CFG_BUILD_DIR        := /var/tmp/portage/dev-util/cargo-0.1 ...
configure: CFG_CONFIGURE_ARGS   := --prefix=/usr --build=x86_64-pc-lin ...
configure: CFG_PREFIX           := /usr 
configure: CFG_BUILD            := x86_64-unknown-linux-gnu 
configure: CFG_HOST             := x86_64-unknown-linux-gnu 
configure: CFG_TARGET           := x86_64-unknown-linux-gnu 
configure: CFG_DATADIR          := /share 
configure: CFG_DOCDIR           := /share/doc/cargo-0.18.0 
configure: CFG_INFODIR          := /share/info 
configure: CFG_MANDIR           := /share/man 
configure: CFG_LIBDIR           := /lib64 
configure: CFG_RUSTC            := /usr/bin/rustc 
configure: CFG_RUSTDOC          := /usr/bin/rustdoc 
configure: CFG_CARGO            := /var/tmp/portage/dev-util/cargo-0.1 ...
configure: CFG_GIT              :=  
configure: 
configure: leaving ./Makefile unchanged
configure: mv config.tmp config.mk
configure: 
configure: complete
configure: 
configure: 

rustc is 1.16.0. It is pulling in cargo-0.17.0 for bootstrapping.

@MingcongBai

This comment has been minimized.

Copy link

MingcongBai commented Apr 27, 2017

Same here, using Rust 1.17.0 and Cargo 0.16.0.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Apr 28, 2017

I just compiled the 0.18.0 tag with the 1.{15,16,17}.0 official releases. Is this a local configuration problem?

@djc

This comment has been minimized.

Copy link
Contributor Author

djc commented Apr 28, 2017

I don't know how it could be. I definitely have modern Cargo installed both in the packaging setup and in the system at large. What kinds of configuration problem do you think could cause this?

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Apr 29, 2017

Can you try reproducing with a more minimal test case? E.g. get a precise command of cargo that fails to work? That will inform us precisely which cargo and rustc are actually being used here.

@MingcongBai

This comment has been minimized.

Copy link

MingcongBai commented Apr 30, 2017

In my case it's /usr/bin/cargo or the one built and installed to the system myself.

@carols10cents

This comment has been minimized.

Copy link
Member

carols10cents commented Oct 2, 2017

Closing due to inactivity and inability to reproduce. Please reopen with the output of rustc --version, cargo --version, and a cargo command that reproduces the problem if this is still an issue! Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.