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

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.

Show comment
Hide comment
@headius

headius Apr 29, 2013

Member

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.

Member

headius 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.

Show comment
Hide comment
@headius

headius Apr 29, 2013

Member

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

Member

headius 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.

Show comment
Hide comment
@headius

headius Apr 29, 2013

Member

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.

Member

headius 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.

Show comment
Hide comment
@headius

headius Apr 29, 2013

Member

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.

Member

headius 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.

Show comment
Hide comment
@robertodecurnex

robertodecurnex Apr 29, 2013

Great! Ty, that was fast!

Great! Ty, that was fast!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment