-
Notifications
You must be signed in to change notification settings - Fork 260
add msrvcheck #1328
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
Merged
Merged
add msrvcheck #1328
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| name: Dependencies | ||
|
|
||
| concurrency: | ||
| group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} | ||
| cancel-in-progress: true | ||
|
|
||
| on: | ||
| push: | ||
| branches-ignore: | ||
| - 'gh-readonly-queue/**' | ||
| paths: | ||
| - "**/Cargo.toml" | ||
| - "**/Cargo.lock" | ||
| pull_request: | ||
| paths: | ||
| - "**/Cargo.toml" | ||
| - "**/Cargo.lock" | ||
| merge_group: | ||
| # manual trigger | ||
| # https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| depcheck: | ||
| name: msrv dependency check | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: amd64/rust | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| submodules: true | ||
| fetch-depth: 1 | ||
| - name: Setup Rust toolchain | ||
| uses: ./.github/actions/setup-builder | ||
| with: | ||
| rust-version: stable | ||
| - name: Check dependencies | ||
| run: | | ||
| cd dev/msrvcheck | ||
| cargo run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Cargo.lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| # MSRV checker for upstream DataFusion | ||
| [package] | ||
| name = "msrvcheck" | ||
| edition = "2021" | ||
|
|
||
| # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
|
||
| [dependencies] | ||
| cargo = "0.91.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <!--- | ||
| Licensed to the Apache Software Foundation (ASF) under one | ||
| or more contributor license agreements. See the NOTICE file | ||
| distributed with this work for additional information | ||
| regarding copyright ownership. The ASF licenses this file | ||
| to you under the Apache License, Version 2.0 (the | ||
| "License"); you may not use this file except in compliance | ||
| with the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, | ||
| software distributed under the License is distributed on an | ||
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| KIND, either express or implied. See the License for the | ||
| specific language governing permissions and limitations | ||
| under the License. | ||
| --> | ||
|
|
||
| This directory contains a tool that ensures there MSRV is consistent with upstream | ||
| datafusion dependencies. | ||
|
|
||
| [issue 1271]: https://github.com/apache/datafusion-ballista/issues/1271#issuecomment-3094456313 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| use cargo::CargoResult; | ||
| use std::env; | ||
| use std::path::Path; | ||
|
|
||
| use cargo::util::context::GlobalContext; | ||
|
|
||
| /// Verifies that we are tracking the right MSRV from datafusion. | ||
| /// This is vastly inspired from <https://github.com/apache/datafusion/tree/10a437b826568c27b81d7d16a02b938a13d1a4ad/dev/depcheck> | ||
| fn main() -> CargoResult<()> { | ||
| let gctx = 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) | ||
| // dev directory | ||
| .parent() | ||
| .expect("Can not find dev directory") | ||
| // project root directory | ||
| .parent() | ||
| .expect("Can not find project root directory") | ||
| .join("Cargo.toml"); | ||
|
|
||
| println!( | ||
| "Checking for MSRV dependencies in {}", | ||
| root_cargo_toml.display() | ||
| ); | ||
|
|
||
| let workspace = cargo::core::Workspace::new(&root_cargo_toml, &gctx)?; | ||
| let project_msrv = workspace.lowest_rust_version().unwrap(); // there should be a MSRV project wise | ||
|
|
||
| let (_, resolve) = cargo::ops::resolve_ws(&workspace, false)?; | ||
| let packages_with_rust_version: Vec<_> = resolve | ||
| .iter() | ||
| .filter(|id| id.name().starts_with("datafusion")) | ||
| .map(|e| resolve.summary(e)) | ||
| .map(|e| (e.name(), e.rust_version())) | ||
| .collect(); | ||
|
|
||
| println!("Current project MSRV: {}", project_msrv); | ||
|
|
||
| for (package, version) in packages_with_rust_version { | ||
| if let Some(v) = version { | ||
| if !v.is_compatible_with(project_msrv.as_partial()) { | ||
| panic!( | ||
| "package '{package}' has MSRV {v} not compatible with current project MSRV {project_msrv}", | ||
| ); | ||
| } | ||
|
|
||
| println!("{package} MSRV: {v}"); | ||
| } | ||
| } | ||
|
|
||
| println!("No inconsistent MSRV found"); | ||
| Ok(()) | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.