diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index ebc5bcf91c94..b98de09565f9 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -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: diff --git a/dev/depcheck/Cargo.toml b/dev/depcheck/Cargo.toml index cb4e77eabb22..23cefaec43be 100644 --- a/dev/depcheck/Cargo.toml +++ b/dev/depcheck/Cargo.toml @@ -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" diff --git a/dev/depcheck/src/main.rs b/dev/depcheck/src/main.rs index 1599fdd4188d..a30539c4b01b 100644 --- a/dev/depcheck/src/main.rs +++ b/dev/depcheck/src/main.rs @@ -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) @@ -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();