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

refactor(rust): Allow polars to pass cargo check on windows #18672

Merged
merged 3 commits into from
Sep 13, 2024

Conversation

squnit
Copy link
Contributor

@squnit squnit commented Sep 11, 2024

This fix is similar to what was done in #18498. We also added windows to lint-rust.yml in CI to prevent similar issues from occuring again.

It fixes cargo check regression in windows as of 5c4e7e9 with the message

$ cargo check --workspace --all-targets --all-features
...
   --> crates\polars-utils\src\mmap.rs:130:20
    |
130 | use polars_error::{polars_bail, PolarsResult};
    |                    ^^^^^^^^^^^
    |
    = note: `#[warn(unused_imports)]` on by default
...

This is caused by #18532 at

use polars_error::{polars_bail, PolarsResult};

#[cfg(target_family = "unix")]
{
use std::os::unix::fs::MetadataExt;
let guard = MEMORY_MAPPED_FILES.lock().unwrap();
let metadata = file.metadata()?;
if guard.contains_key(&(metadata.dev(), metadata.ino())) {
polars_bail!(ComputeError: "cannot write to file: already memory mapped");
}
}

@github-actions github-actions bot added internal An internal refactor or improvement rust Related to Rust Polars labels Sep 11, 2024
@squnit squnit marked this pull request as ready for review September 11, 2024 04:36
Copy link

codecov bot commented Sep 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.91%. Comparing base (5c4e7e9) to head (c1456e4).
Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #18672   +/-   ##
=======================================
  Coverage   79.90%   79.91%           
=======================================
  Files        1512     1512           
  Lines      203203   203203           
  Branches     2891     2891           
=======================================
+ Hits       162379   162390   +11     
+ Misses      40274    40263   -11     
  Partials      550      550           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ritchie46
Copy link
Member

Thanks for the fix, but I don't want extra linting on windows runners. It will make CI much more costly and I don't think it's worth it for this one.

@squnit squnit changed the title refactor(rust): Allow polars to pass cargo check on windows and update CI to prevent similar issue again refactor(rust): Allow polars to pass cargo check on windows Sep 11, 2024
@squnit
Copy link
Contributor Author

squnit commented Sep 11, 2024

@ritchie46 I've reverted the change in CI configs.

@ritchie46
Copy link
Member

Than ks!

@ritchie46 ritchie46 merged commit 6c08041 into pola-rs:main Sep 13, 2024
21 of 22 checks passed
nameexhaustion pushed a commit to nameexhaustion/polars that referenced this pull request Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants