ruby-packer icon indicating copy to clipboard operation
ruby-packer copied to clipboard

Set Ruby to 3.1.2

Open HarlemSquirrel opened this issue 3 years ago • 7 comments

HarlemSquirrel avatar Jun 07 '22 13:06 HarlemSquirrel

I am afraid that it is not as easy. using another ruby version requires also to modify the ruby language source code.

laurent-martin avatar Jun 08 '22 08:06 laurent-martin

Ah so we have to pull in Ruby source to ruby directory here?

HarlemSquirrel avatar Jun 08 '22 10:06 HarlemSquirrel

Yes, and report all changes, as far as I understand, you can find them:

grep -rE 'Hack (start|end)' .

It would have been nice if all that was included in ruby code directly...

or if those changes were reported automatically in ruby code after processing, instead of manual change, if it's the current case.

laurent-martin avatar Jun 08 '22 12:06 laurent-martin

I pulled in ruby from https://github.com/ruby/ruby/releases/tag/v3_1_2

Not sure if this is what you're looking for

➤  grep -rE 'Hack (start|end)' .
./vendor/gdbm/src/gdbmopen.c:// --------- [Enclose.IO Hack start] ---------
./vendor/gdbm/src/gdbmopen.c:// --------- [Enclose.IO Hack end] ---------

HarlemSquirrel avatar Jun 08 '22 12:06 HarlemSquirrel

Well, I mean rather this:

./ruby/process.c:// --------- [Enclose.IO Hack start] ---------
./ruby/process.c:// --------- [Enclose.IO Hack end] ---------
./ruby/util.c:// --------- [Enclose.IO Hack start] ---------
./ruby/util.c:// --------- [Enclose.IO Hack end] ---------
./ruby/io.c:// --------- [Enclose.IO Hack start] ---------
./ruby/io.c:// --------- [Enclose.IO Hack end] ---------
./ruby/ruby.c:// --------- [Enclose.IO Hack start] ---------
./ruby/ruby.c:// --------- [Enclose.IO Hack end] ---------
./ruby/ruby.c:// --------- [Enclose.IO Hack start] ---------
./ruby/ruby.c:// --------- [Enclose.IO Hack end] ---------
./ruby/ruby.c:// --------- [Enclose.IO Hack start] ---------
./ruby/ruby.c:// --------- [Enclose.IO Hack end] ---------
./ruby/ext/dbm/extconf.rb:# --------- [Enclose.IO Hack start] ---------
./ruby/ext/dbm/extconf.rb:# --------- [Enclose.IO Hack end] ---------
./ruby/ext/openssl/ossl_x509store.c:// --------- [Enclose.IO Hack start] ---------
./ruby/ext/openssl/ossl_x509store.c:// --------- [Enclose.IO Hack end] ---------
./ruby/ext/openssl/ossl_x509store.c:    // --------- [Enclose.IO Hack start] ---------
./ruby/ext/openssl/ossl_x509store.c:    // --------- [Enclose.IO Hack end] ---------
./ruby/dln.c:// --------- [Enclose.IO Hack start] ---------
./ruby/dln.c:// --------- [Enclose.IO Hack end] ---------
./ruby/dir.c:// --------- [Enclose.IO Hack start] ---------
./ruby/dir.c:// --------- [Enclose.IO Hack end] ---------
./ruby/main.c:// --------- [Enclose.IO Hack start] ---------
./ruby/main.c:// --------- [Enclose.IO Hack end] ---------
./ruby/main.c:// --------- [Enclose.IO Hack start] ---------
./ruby/main.c:// --------- [Enclose.IO Hack end] ---------
./ruby/lib/rubygems/path_support.rb:    # --------- [Enclose.IO Hack start] ---------
./ruby/lib/rubygems/path_support.rb:    # --------- [Enclose.IO Hack end] ---------
./ruby/lib/rubygems/path_support.rb:    # --------- [Enclose.IO Hack start] ---------
./ruby/lib/rubygems/path_support.rb:    # --------- [Enclose.IO Hack end] ---------
./ruby/file.c:// --------- [Enclose.IO Hack start] ---------
./ruby/file.c:// --------- [Enclose.IO Hack end] ---------
./ruby/win32/file.c:// --------- [Enclose.IO Hack start] ---------
./ruby/win32/file.c:// --------- [Enclose.IO Hack end] ---------
./ruby/win32/win32.c:// --------- [Enclose.IO Hack start] ---------
./ruby/win32/win32.c:// --------- [Enclose.IO Hack end] ---------
./ruby/win32/win32.c:// --------- [Enclose.IO Hack start] ---------
./ruby/win32/win32.c:// --------- [Enclose.IO Hack end] ---------
./ruby/win32/win32.c:// --------- [Enclose.IO Hack start] ---------
./ruby/win32/win32.c:// --------- [Enclose.IO Hack end] ---------
./ruby/win32/win32.c:// --------- [Enclose.IO Hack start] ---------
./ruby/win32/win32.c:// --------- [Enclose.IO Hack end] ---------
./ruby/win32/win32.c:// --------- [Enclose.IO Hack start] ---------
./ruby/win32/win32.c:// --------- [Enclose.IO Hack end] ---------
./ruby/win32/win32.c:// --------- [Enclose.IO Hack start] ---------
./ruby/win32/win32.c:// --------- [Enclose.IO Hack end] ---------
./ruby/tool/mkconfig.rb:    # --------- [Enclose.IO Hack start] ---------
./ruby/tool/mkconfig.rb:    # --------- [Enclose.IO Hack end] ---------
./vendor/gdbm/src/gdbmopen.c:// --------- [Enclose.IO Hack start] ---------
./vendor/gdbm/src/gdbmopen.c:// --------- [Enclose.IO Hack end] ---------

laurent-martin avatar Jun 08 '22 13:06 laurent-martin

Does that come from the compilation? bundle exec rake is failing for me

/usr/bin/ld: ./libgdbmapp.a(parseopt.o):/tmp/rubyc/gdbm/src/parseopt.c:256: multiple definition of `parseopt_program_args'; gdbm_load.o:/tmp/rubyc/gdbm/src/gdbm_load.c:33: first defined here
/usr/bin/ld: ./libgdbmapp.a(parseopt.o):/tmp/rubyc/gdbm/src/parseopt.c:255: multiple definition of `parseopt_program_doc'; gdbm_load.o:/tmp/rubyc/gdbm/src/gdbm_load.c:32: first defined here
/usr/bin/ld: ./libgdbmapp.a(parseopt.o):/tmp/rubyc/gdbm/src/parseopt.c:256: multiple definition of `parseopt_program_args'; gdbm_dump.o:/tmp/rubyc/gdbm/src/gdbm_dump.c:23: first defined here
/usr/bin/ld: ./libgdbmapp.a(parseopt.o):/tmp/rubyc/gdbm/src/parseopt.c:255: multiple definition of `parseopt_program_doc'; gdbm_dump.o:/tmp/rubyc/gdbm/src/gdbm_dump.c:22: first defined here
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status

HarlemSquirrel avatar Jun 08 '22 15:06 HarlemSquirrel

I am considering taking a pass at this. If I had to summarize the proposed process I would use, is it something like?

  • check out the project

  • grep the /ruby folder in this repo for every hack to get a list of them for reference

  • download ruby 3.1.2 source into the /ruby folder

  • make sure it builds ruby 3.1.2

  • For each hack that still aligns with the appropriate place in the current source, add it into 3.1.2.

  • For any hacks that are unaccounted for and remaining, review and see if there's somewhere to apply it to the equivalent 3.1.2 source location whereever it may now be

  • build

  • fix whatever else goes wrong

Profit???

Is this on-track? Are there other gotchas or code to change?

I see there's a large diff. Is that what was tried previously?

ericbeland avatar Sep 17 '22 15:09 ericbeland