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

Don't resolve std's optional dependencies #7337

Merged
merged 1 commit into from
Sep 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/cargo/core/compiler/standard_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,13 @@ pub fn resolve_std<'cfg>(
// now. Perhaps in the future features will be decoupled from the resolver
// and it will be easier to control feature selection.
let current_manifest = src_path.join("src/libtest/Cargo.toml");
// TODO: Consider setting require_option_deps false?
// TODO: Consider doing something to enforce --locked? Or to prevent the
// lock file from being written, such as setting ephemeral.
let std_ws = Workspace::new_virtual(src_path, current_manifest, virtual_manifest, config)?;
let mut std_ws = Workspace::new_virtual(src_path, current_manifest, virtual_manifest, config)?;
// Don't require optional dependencies in this workspace, aka std's own
// `[dev-dependencies]`. No need for us to generate a `Resolve` which has
// those included because we'll never use them anyway.
std_ws.set_require_optional_deps(false);
// `test` is not in the default set because it is optional, but it needs
// to be part of the resolve in case we do need it.
let mut spec_pkgs = Vec::from(crates);
Expand Down