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

Fix depcheck by updating to cargo 0.81.0 #11672

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ on:
push:
paths:
- "**/Cargo.toml"
- "dev/depcheck"
pull_request:
paths:
- "**/Cargo.toml"
- "dev/depcheck"
# manual trigger
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion dev/depcheck/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ name = "depcheck"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
cargo = "0.78.1"
cargo = "0.81.0"
8 changes: 3 additions & 5 deletions dev/depcheck/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,19 @@

extern crate cargo;

use cargo::CargoResult;
use cargo::{CargoResult, GlobalContext};
/// Check for circular dependencies between DataFusion crates
use std::collections::{HashMap, HashSet};
use std::env;
use std::path::Path;

use cargo::util::config::Config;

/// Verifies that there are no circular dependencies between DataFusion crates
/// (which prevents publishing on crates.io) by parsing the Cargo.toml files and
/// checking the dependency graph.
///
/// See https://github.com/apache/datafusion/issues/9278 for more details
fn main() -> CargoResult<()> {
let config = Config::default()?;
let global_context = GlobalContext::default()?;
// This is the path for the depcheck binary
let path = env::var("CARGO_MANIFEST_DIR").unwrap();
let root_cargo_toml = Path::new(&path)
Expand All @@ -47,7 +45,7 @@ fn main() -> CargoResult<()> {
"Checking for circular dependencies in {}",
root_cargo_toml.display()
);
let workspace = cargo::core::Workspace::new(&root_cargo_toml, &config)?;
let workspace = cargo::core::Workspace::new(&root_cargo_toml, &global_context)?;
let (_, resolve) = cargo::ops::resolve_ws(&workspace)?;

let mut package_deps = HashMap::new();
Expand Down