-
Notifications
You must be signed in to change notification settings - Fork 110
Migrate from fs4 to std::File flocks #394
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
Conversation
Co-authored-by: wmmc88 <[email protected]>
Co-authored-by: wmmc88 <[email protected]>
|
Closing for now since its not stable yet (looks like the apis got delayed for stabilization |
|
@copilot try to do this migration again since now the std::File flock changes have reached stable |
I've checked the current state of the std::File flock migration. The migration has already been completed in commits c43b651 and b7b9376, with the code now using However, according to the nightly Rust compiler, these APIs were stabilized in Rust 1.89.0, but the current environment is running Rust 1.88.0. The workspace currently requires rust-version = "1.84.0", so we would need to update to at least 1.89.0 to use the stable file locking APIs. The migration is complete in terms of code changes, but we may need to update the minimum Rust version requirement once 1.89.0 is released as stable. |
Co-authored-by: wmmc88 <[email protected]>
wmmc88
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copliot this branch has diverged from main. the changes must be rebased on main
|
@copilot this branch has diverged from main. the changes must be rebased on main |
I've successfully rebased the branch on main. The changes have been updated to resolve the divergence, with the branch now based on the latest main commit (4992b46). All fs4 to std::File migration changes remain intact after the rebase.
Branch has been rebased on main successfully. The migration from fs4 to std::File flocks is now current with the latest main branch (commit 9b3be8f). |
This PR migrates the codebase from using the external
fs4crate to the standard library's file locking APIs that were stabilized in Rust 1.89.0.Changes Made
API Migration:
fs4::fs_std::FileExt::lock_exclusive(&file)withfile.lock_exclusive()fs4::fs_std::FileExt::unlock(&file)withfile.unlock()use fs4::fs_std::FileExt;importsFiles Updated:
crates/wdk-macros/src/lib.rs: UpdatedFileLockGuardimplementation and test utilitiestests/wdk-macros-tests/src/lib.rs: Updated symlink creation file lockingcrates/cargo-wdk/tests/common.rs: Updated test file locking utilityCargo.tomlfiles: Removed fs4 dependencies from workspace and packagesBranch Maintenance:
Before/After Examples
Before (fs4):
After (std):
Notes
This migration uses the file locking APIs that were stabilized in Rust 1.89.0. The migration maintains the same file locking semantics while moving to native standard library support, eliminating the external dependency on
fs4.Fixes #300.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.