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

Default features of dependencies get pulled in for no reason #3164

Closed
nox opened this issue Oct 5, 2016 · 8 comments
Closed

Default features of dependencies get pulled in for no reason #3164

nox opened this issue Oct 5, 2016 · 8 comments

Comments

@nox
Copy link
Contributor

nox commented Oct 5, 2016

When building webrender_traits with servo/webrender#430, even running cargo build --no-default-features --features serde_derive ends up building serde_codegen with its feature with-syntex. This should not happen.

@nox
Copy link
Contributor Author

nox commented Oct 5, 2016

Cc @alexcrichton

@alexcrichton
Copy link
Member

Hm what version of Cargo are you using actually? I just used cargo 0.13.0-nightly (cbe47ed 2016-09-29) locally and got:

features: {
  offscreen_gl_context v0.4.4: {"serde", "serde_serialization", "default"}
  unicode-xid v0.0.3: {"default"}
  serde v0.8.11: {"std", "default"}
  app_units v0.3.0: {"default"}
  byteorder v0.5.3: {"std", "default"}
  uuid v0.3.1: {"rand", "v4"}
  bincode v0.6.0: {"serde", "rustc-serialize", "default"}
  libc v0.2.16: {"use_std", "default"}
  serde_codegen v0.8.11: {"with-syn"}
  webrender_traits v0.6.0 (file:///home/alex/code/lol): {"serde_derive"}
  x11 v2.8.0: {"xlib"}
  log v0.3.6: {"use_std", "default"}
  syn v0.8.7: {"quote", "unicode-xid", "aster", "printing", "default", "visit", "parsing"}
}

which looks correct? Maybe we fixed this bug? (not that I remember it)

@nox
Copy link
Contributor Author

nox commented Oct 5, 2016

@alexcrichton

cargo 0.13.0-nightly (ebcf0a8 2016-10-03)

And in Cargo.lock:

[[package]]
name = "serde_codegen"
version = "0.8.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
 "quote 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
 "serde_codegen_internals 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "syn 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)",
 "syntex 0.44.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "syntex_syntax 0.44.0 (registry+https://github.com/rust-lang/crates.io-index)",
]

@alexcrichton
Copy link
Member

Hm it looks like there's something else in play here because it works if I use the exact Cargo.toml from webrender_traits. What Cargo.toml are you building from again to reproduce?

@nox
Copy link
Contributor Author

nox commented Oct 5, 2016

The one in 94437c4bbbee843e172dfc306b113a13a8a840c8, which is the tip of the PR I linked.

@nox
Copy link
Contributor Author

nox commented Oct 5, 2016

I wonder if that is related to #1197, it's certainly similar.

@alexcrichton
Copy link
Member

If the "bug" is that syntex_syntax is mentioned in Cargo.lock then that's not a bug. There exists a mode to build webrender_traits which builds the syntex_syntax crate, so it must be in the lock file.

@nox
Copy link
Contributor Author

nox commented Oct 5, 2016

I see! Now that makes sense. Closing this then!

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