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

Can't use optional dependencies in a build script #2086

Closed
gkoz opened this issue Oct 27, 2015 · 3 comments
Closed

Can't use optional dependencies in a build script #2086

gkoz opened this issue Oct 27, 2015 · 3 comments

Comments

@gkoz
Copy link
Contributor

gkoz commented Oct 27, 2015

When an optional dependency is enabled via --features bar_feat the build script is built without --extern bar=... and can't import the bar crate.

[project]
name = "foo"
version = "0.5.0"
build = "build.rs"

[features]
bar_feat = ["bar"]

[dependencies.bar]
path = "bar"
optional = true

A failing test.

This was supposed to be a workaround for #1581... 😦

@gkoz
Copy link
Contributor Author

gkoz commented Oct 27, 2015

Oops, I might've misunderstood something. Does the build script not get access to any of the normal dependencies?

@alexcrichton
Copy link
Member

Ah yes this is intended behavior, build scripts don't have access to normal dependencies. I believe you can have an optional build-dependencies entry, however, though.

@gkoz
Copy link
Contributor Author

gkoz commented Oct 27, 2015

Yep, that's it.

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