-
Notifications
You must be signed in to change notification settings - Fork 285
Fix fdPread: shouldn't move file offset #967
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
It seems, at the root of it, we have that |
I could |
@ncruces is it required for embed to implement this, or is it just due to our tests using embed? |
No, not required. It's just due to tests using But it also means anyone using I came up with an alternative implementation that tries There's some prior to doing this. For instance, see Go's implementation of |
thanks for the notes and the research leading to them! |
If you want to go with an alternative fix, works for me, @achille-roussel will be starting some more abstraction work soon, and the important part is to have tests in to make sure this doesn't re-break later. |
I'll go with this since at least it means no regression for zig folks. The big issue is this leaving the file offset in an inconsistent state if the initial seeks succeed but the final one fails. It's still an improvement over the current situation (final offset is always wrong). Other considerations don't really apply ( I'll work on tests now. |
@ncruces sounds good. we're going to cut the release in a couple days, and this is great to go in. You can add notes in RATIONALE.md and then code comment to there on the tradeoffs. you'll notice there are others. |
work in progress looks excellent! I'll leave you to continue with stdlib tests unless you've run out of steam. |
I drifted you. for names, use export (capitalize first letter) and dot import like so |
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.
great and professional work!
if you like I can fix the drift I caused.
Signed-off-by: Nuno Cruces <[email protected]>
Signed-off-by: Nuno Cruces <[email protected]>
Signed-off-by: Nuno Cruces <[email protected]>
thanks for hanging in there @ncruces! |
No problem. |
Fixes #958.
This is breaking a zig test, I still haven't been able to figure out why.