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

Use pipe instead of eventfd for unix compatibility #49

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

MarcusGrass
Copy link
Contributor

Fixes #48

Changes use from Linux-specific eventfd to poll and pipe which are POSIX.

Ran same tests as with #43 to check for regressions.

Also ran https://github.com/obi1kenobi/cargo-semver-checks to check for no major version changes.
Sadly, renaming the error causes a major version change, I'll leave it up to you if it's worth it to change that name.

Since the read and write pipes are separate fds, there's no need for an Arc and the write-end will be dropped with the Clipboard, Clipboard therefore doesn't need to implement drop and can rely on OwnedFds drop, which closes the underlying fd.

@0323pin
Copy link

0323pin commented Feb 29, 2024

@MarcusGrass Thanks for caring.

Sadly, renaming the error causes a major version change, I'll leave it up to you if it's worth it to change that name.

What do you mean here? MSRV? If so, these days I think 1.74 is acceptable.

@MarcusGrass
Copy link
Contributor Author

@MarcusGrass Thanks for caring.

Sadly, renaming the error causes a major version change, I'll leave it up to you if it's worth it to change that name.

What do you mean here? MSRV? If so, these days I think 1.74 is acceptable.

Of course, this was my fault to begin with, sorry about that!

In this case the Error-enum is part of the public API, so instead of this being a minor change 0.9.1 to 0.9.2 for this crate, it'd have to be 0.9.1 to 0.10.0 if the enum tag is renamed, I think the MSRV should remain the same after this. That's again on me for accidentally exposing the implementation through the public API.

@0323pin
Copy link

0323pin commented Feb 29, 2024

Thank you for the explanation.

@0323pin
Copy link

0323pin commented Feb 29, 2024

If it helps :)

~> cd x11-clipboard-mg-switch-out-eventfd/
~> cargo build --release
    Updating crates.io index
  Downloaded errno v0.3.8
  Downloaded bitflags v2.4.2
  Downloaded rustix v0.38.31
  Downloaded x11rb v0.13.0
  Downloaded x11rb-protocol v0.13.0
  Downloaded libc v0.2.153
  Downloaded 6 crates (1.9 MB) in 1.88s
   Compiling libc v0.2.153
   Compiling rustix v0.38.31
   Compiling bitflags v2.4.2
   Compiling x11rb-protocol v0.13.0
   Compiling errno v0.3.8
   Compiling x11rb v0.13.0
   Compiling x11-clipboard v0.9.2 (/home/pin/Downloads/x11-clipboard-mg-switch-out-eventfd)
    Finished release [optimized] target(s) in 53.16s
~> uname -a
NetBSD mybox 10.99.10 NetBSD 10.99.10 (GENERIC) #0: Fri Feb 23 21:09:49 UTC 2024  [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC amd64
~> pkg_info | grep rust
rust-1.76.0         Safe, concurrent, practical language

@quininer quininer merged commit a716f79 into quininer:master Feb 29, 2024
@quininer
Copy link
Owner

Thank you!

@0323pin
Copy link

0323pin commented Feb 29, 2024

Thank you both for the quick fix.

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.

Fails to build on NetBSD
3 participants