-
Notifications
You must be signed in to change notification settings - Fork 914
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 gem for tempfile #7973
Open
headius
wants to merge
3
commits into
jruby:master
Choose a base branch
from
headius:default_tempfile
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Use gem for tempfile #7973
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
headius
force-pushed
the
default_tempfile
branch
2 times, most recently
from
October 20, 2023 00:29
11b57da
to
b9fe936
Compare
headius
added a commit
to headius/jruby
that referenced
this pull request
Oct 26, 2023
The logic here was incorrectly ported. The original code checks the vperm pointer passed in to know whether it can be dereferenced. The broken code in JRuby ends up requiring a a non-null positional vperm argument in order to use the kwarg, which then immediately errors anyway. The new code if the perm kwarg and the positional vperm are both set, but if only the kwarg is given, it will be used for the new file. Fixes failures switching from our own native Tempfile to the tempfile gem. See jruby#7973
headius
added a commit
to headius/jruby
that referenced
this pull request
Oct 26, 2023
The logic here was incorrectly ported. The original code checks the vperm pointer passed in to know whether it can be dereferenced. The broken code in JRuby ends up requiring a a non-null positional vperm argument in order to use the kwarg, which then immediately errors anyway. The new code if the perm kwarg and the positional vperm are both set, but if only the kwarg is given, it will be used for the new file. Fixes failures switching from our own native Tempfile to the tempfile gem. See jruby#7973
Remaining failure is due to a fix for https://bugs.ruby-lang.org/issues/11015 applied to CRuby in ruby/ruby@efbfd90. We'll need something similar in |
headius
added a commit
to headius/jruby
that referenced
this pull request
Oct 26, 2023
Tempfile.new under the standard tempfile library returns a Delegate wrapped around an IO, so it would not have our JI addons. See jruby#7973
The logic here was incorrectly ported. The original code checks the vperm pointer passed in to know whether it can be dereferenced. The broken code in JRuby ends up requiring a a non-null positional vperm argument in order to use the kwarg, which then immediately errors anyway. The new code if the perm kwarg and the positional vperm are both set, but if only the kwarg is given, it will be used for the new file. Fixes failures switching from our own native Tempfile to the tempfile gem. See jruby#7973
Tempfile.new under the standard tempfile library returns a Delegate wrapped around an IO, so it would not have our JI addons. See jruby#7973
headius
force-pushed
the
default_tempfile
branch
from
November 8, 2023 03:40
dc46040
to
f9aac38
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It would be one less library to maintain if we just use the standard tempfile gem, but we would lose the benefit of our own Tempfile that does not use delegate.rb to wrap an IO (ours extends IO itself). This PR is to try it out and discuss.
See ruby/tempfile#7.