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

Add flock shim #3759

Merged
merged 1 commit into from
Jul 30, 2024
Merged

Add flock shim #3759

merged 1 commit into from
Jul 30, 2024

Conversation

newpavlov
Copy link
Contributor

No description provided.

src/shims/unix/fs.rs Outdated Show resolved Hide resolved
@newpavlov newpavlov force-pushed the flock branch 4 times, most recently from 32b71a3 to 5979937 Compare July 24, 2024 15:22
// in the `helpers` module
if lock_nb && matches!(code, ERROR_IO_PENDING | ERROR_LOCK_VIOLATION) {
let desc = format!("LockFileEx wouldblock error: {err}");
err = io::Error::new(io::ErrorKind::WouldBlock, desc);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This remapping is a bit hacky, but I couldn't find a better solution. Mapping it here or in fd.rs conflicts with mapping in helpers.rs.

Also, according to LockFileEx non-blocking call should return ERROR_IO_PENDING, but in practice we get ERROR_LOCK_VIOLATION, so to be safe I remap both of those.

@bors
Copy link
Contributor

bors commented Jul 26, 2024

☔ The latest upstream changes (presumably #3766) made this pull request unmergeable. Please resolve the merge conflicts.

@rustbot
Copy link
Collaborator

rustbot commented Jul 26, 2024

There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

You can start a rebase with the following commands:

$ # rebase
$ git pull --rebase https://github.com/rust-lang/miri.git master
$ git push --force-with-lease

The following commits are merge commits:

@newpavlov newpavlov force-pushed the flock branch 2 times, most recently from 9bd15b3 to 2313892 Compare July 26, 2024 14:27
src/shims/unix/fs.rs Outdated Show resolved Hide resolved
@newpavlov newpavlov force-pushed the flock branch 3 times, most recently from c4ece75 to f4b70b0 Compare July 26, 2024 17:26
@oli-obk
Copy link
Contributor

oli-obk commented Jul 30, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Jul 30, 2024

📌 Commit ed3ae03 has been approved by oli-obk

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jul 30, 2024

⌛ Testing commit ed3ae03 with merge 3fbdc82...

@bors
Copy link
Contributor

bors commented Jul 30, 2024

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 3fbdc82 to master...

@bors bors merged commit 3fbdc82 into rust-lang:master Jul 30, 2024
8 checks passed
@newpavlov newpavlov deleted the flock branch July 30, 2024 11:03
@@ -0,0 +1,71 @@
// Flock tests are separate since they don't in general work on a Windows host.
Copy link
Member

@RalfJung RalfJung Aug 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment is confusing... CI seems to indicate that it works just fine on a windows host? It doesn't work with a windows target but that's normal for these libc tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it was copied from another test and I forgot to update it after the emulation was implemented.

@RalfJung RalfJung mentioned this pull request Aug 1, 2024
bors added a commit that referenced this pull request Aug 1, 2024
flock: a bit of cleanup

Follow-up to #3759
RalfJung pushed a commit to RalfJung/rust that referenced this pull request Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants