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

TempFile path consistency vs the rest of the Ruby implementations #677

Closed
robertodecurnex opened this issue Apr 29, 2013 · 5 comments

Comments

Projects
None yet
2 participants
@robertodecurnex
Copy link

commented Apr 29, 2013

TempFile is using a different algorithm to generate the temp path.

Here are some examples (MRI vs JRuby):

Ruby 1.8.7

==============> /tmp/temp-index20130429-21223-1qdcggn-0
==============> /tmp/temp-index20130429-21223-1ct0r8o-0

Ruby 1.9.3

==============> /tmp/temp-index20130429-27066-1jtprvn
==============> /tmp/temp-index20130429-27066-rnt1f

JRuby 1.7.3

==============> /tmp/git_test1367248843047/test/temp-index.25063.5336
==============> /tmp/git_test1367248843047/test/temp-index.25063.5337

This may create weird compatibility issues.

Exampĺe: ruby-git/ruby-git#72

@headius

This comment has been minimized.

Copy link
Member

commented Apr 29, 2013

Do you have some example code to run? It appears that we used to implement the tempfile naming differently, but it now uses the same logic as in MRI.

@headius

This comment has been minimized.

Copy link
Member

commented Apr 29, 2013

Ahh sorry...we do have a slightly different algorithm contained in org.jruby.ext.tempfile.Tempfile#make_tmpname.

@headius

This comment has been minimized.

Copy link
Member

commented Apr 29, 2013

Hmm, after reading over the code, I can see no obvious advantage in what we have over the original tempfile.rb anymore. I'll confer with @enebo on whether we should just put it back.

@headius

This comment has been minimized.

Copy link
Member

commented Apr 29, 2013

I think what we'll do is pull out the filename-generating logic into a utility within JRuby and use that for now. For JRuby 9k (next major release) we'll just use MRI's tempfile.rb.

@headius headius closed this in 607c6d5 Apr 29, 2013

@robertodecurnex

This comment has been minimized.

Copy link
Author

commented Apr 29, 2013

Great! Ty, that was fast!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.