Closed AnyTimeTraveler closed 1 month ago
Nevermind, I decided to try replace that function in my own fork of this repo, only to find it already gone and my problem resolved, when I tried the same code with the master branch. I was using version 0.8.1 of the library when the error occured.
May I humbly request another bugfix-release, so I can use the fix in what will be version 0.8.2
Thank you again for fixing my problem :)
Hey, yeah, the cat
was always a bit iffy (I copied that from wl-clipboard where it perhaps makes more sense).
The argument that the cat implementation is safer also makes no sense, since this function uses the unsafe fork().
Written in the good old times when fork()
was marked as safe in nix
for whatever reason :p
Lastly, I can't possibly imagine that spawning not just another instance of the current program with fork, but also then waiting for it to become cat and for that to finish, could in any way be faster than just doing a file-write.
Not sure @bugaevc did any benchmarks here, but there could be a difference when copying very large amounts of data (admittedly, a pretty rare case).
May I humbly request another bugfix-release, so I can use the fix in what will be version 0.8.2
Should it be a 0.8.2 or a 0.9.0? Because I kinda replaced the entire nix with rustix, not sure I'm comfortable releasing that as a patch bump.
Not sure @bugaevc did any benchmarks here
Nope :D
Should it be a 0.8.2 or a 0.9.0? Because I kinda replaced the entire nix with rustix, not sure I'm comfortable releasing that as a patch bump.
If you're swapping out an entire library, I would suggest making it 0.9.0, as there might be as yet unknown issues which one might not expect from a patch release.
Also thank you very much for this nice explanation! In light of that knowledge, the initial implementation makes a lot more sense to me.
Sorry for taking so long. I published v0.9.0 now. I've been running it myself since and haven't found any issues.
I am executing this code:
With
WAYLAND_DEBUG=1
, I am getting this output:I tracked the
cat: write error: Broken pipe
down to this function:in
utils.rs:100
.I am using NixOS, which might have some influence on the environment that this code is running in.
I read the explaination for the usage of
cat
at the top of the function and it doesn't really make sense to me:While I can understand that using cat might be easier, the following function does not look easier than what I would expect this function to do. The argument that the cat implementation is safer also makes no sense, since this function uses the unsafe
fork()
. Lastly, I can't possibly imagine that spawning not just another instance of the current program with fork, but also then waiting for it to becomecat
and for that to finish, could in any way be faster than just doing a file-write.I hope that I am just missing something in my thinking and that the implementation of this function makes sense with that additional knowledge. I would be very glad for an explanation and help for resolving my original problem, since I can't see what's happening in the forked program with my debugger.
Thank you for the good work that is this project and for any answers I might receive Simon