deivid-rodriguez / byebug

Debugging in Ruby 2
BSD 2-Clause "Simplified" License
3.34k stars 328 forks source link

Test failure with ruby 3.0.2 #828

Open lucaskanashiro opened 3 years ago

lucaskanashiro commented 3 years ago

Problem description

In Debian, we are moving from ruby2.7 to ruby3.0 and ruby-byebug is failing to build with the new version. Here is the full build log:

https://people.debian.org/~kanashiro/ruby3.0/round2/builds/3/ruby-byebug/ruby-byebug_11.1.3-1+rebuild1633376056_amd64.build.txt

You can see only test failures against ruby3.0 but the problems seems to be when loading the extension, however, it seems to be built fine.

Expected behavior

byebug should build and pass all tests against ruby 3.0.

Actual behavior

It fails as described above.

Steps to reproduce the problem

In my case, build the Debian package in a Debian unstable environment but installing ruby-dev-all from Debian experimental.

I believe this is also reproducible if you try to build it using ruby 3.0.2.

dleidert commented 3 years ago

The problem is that the tests run exe/byebug directly. The fix for us was quite easy by enabling the behavior you have reserved for Windows only: run the script and precede it with the correct ruby binary. We applied this small patch. Maybe this is suitable for upstream as well (I actually don't see any harm in it):

--- a/test/support/utils.rb
+++ b/test/support/utils.rb
@@ -273,9 +273,9 @@ module Byebug
     #
     def binstub
       cmd = "exe/byebug"
-      return [cmd] unless Gem.win_platform?
+      #return [cmd] unless Gem.win_platform?

-      [RbConfig.ruby, cmd]
+      return [RbConfig.ruby, cmd]
     end
   end
 end

https://salsa.debian.org/ruby-team/ruby-byebug/-/blob/master/debian/patches/996145-fix-tests-with-ruby3.patch