Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Auto merge of #1252 - rust-lang:dependabot/cargo/cargo_metadata-0.7.0…
Browse files Browse the repository at this point in the history
…, r=alexheretic

Bump cargo_metadata from 0.6.4 to 0.7.0

Bumps [cargo_metadata](https://github.com/oli-obk/cargo_metadata) from 0.6.4 to 0.7.0.
<details>
<summary>Commits</summary>

- See full diff in [compare view](https://github.com/oli-obk/cargo_metadata/commits)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=cargo_metadata&package-manager=cargo&previous-version=0.6.4&new-version=0.7.0)](https://dependabot.com/compatibility-score.html?dependency-name=cargo_metadata&package-manager=cargo&previous-version=0.6.4&new-version=0.7.0)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

**Note:** This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

You can always request more updates by clicking `Bump now` in your [Dependabot dashboard](https://app.dependabot.com).

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>
  • Loading branch information
bors committed Jan 24, 2019
2 parents 6f63eb4 + df824c5 commit 6a14ed9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 deletions.
15 changes: 14 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test = false

[dependencies]
cargo = { git = "https://github.com/rust-lang/cargo", rev = "907c0febe7045fa02dff2a35c5e36d3bd59ea50d" }
cargo_metadata = "0.6"
cargo_metadata = "0.7"
clippy_lints = { git = "https://github.com/rust-lang/rust-clippy", rev = "280069ddc750d8a20d075c76322c45d5db4a48f8", optional = true }
env_logger = "0.6"
failure = "0.1.1"
Expand Down
29 changes: 12 additions & 17 deletions src/build/cargo_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@ use cargo::core::{PackageId, Target, TargetKind};
use cargo::util::ProcessBuilder;
use cargo_metadata;
use log::{error, trace};
use url::Url;

use crate::build::PackageArg;
use crate::build::plan::{BuildKey, BuildGraph, JobQueue, WorkStatus};
use crate::build::plan::{BuildGraph, BuildKey, JobQueue, WorkStatus};
use crate::build::rustc::src_path;
use crate::lsp_data::parse_file_path;
use crate::build::PackageArg;

/// Main key type by which `Unit`s will be distinguished in the build plan.
/// In Target we're mostly interested in TargetKind (Lib, Bin, ...) and name
Expand Down Expand Up @@ -455,19 +453,16 @@ impl PackageMap {
// Find each package in the workspace and record the root directory and package name.
fn discover_package_paths(manifest_path: &Path) -> HashMap<PathBuf, String> {
trace!("read metadata {:?}", manifest_path);
let metadata = match cargo_metadata::metadata(Some(manifest_path)) {
Ok(metadata) => metadata,
Err(_) => return HashMap::new(),
};
metadata
.workspace_members
.into_iter()
.map(|wm| {
assert!(wm.url().starts_with("path+"));
let url = Url::parse(&wm.url()[5..]).expect("Bad URL");
let path = parse_file_path(&url).expect("URL not a path");
(path, wm.name().into())
}).collect()
cargo_metadata::MetadataCommand::new()
.manifest_path(manifest_path)
.exec()
.iter()
.flat_map(|meta| meta.workspace_members.iter().map(move |id| &meta[id]))
.filter_map(|pkg| {
let dir = pkg.manifest_path.parent()?.to_path_buf();
Some((dir, pkg.name.clone()))
})
.collect()
}

/// Given modified set of files, returns a set of corresponding dirty packages.
Expand Down

0 comments on commit 6a14ed9

Please sign in to comment.