diff mbox

ruby-byebug@9.0.5

Message ID 5750246F.5080006@uq.edu.au
State New
Headers show

Commit Message

Ben Woodcroft June 2, 2016, 12:19 p.m. UTC
On 06/02/2016 08:19 PM, Ben Woodcroft wrote:
>
> On 06/01/2016 01:38 AM, Matthew Jordan wrote:
>> +(define-public ruby-byebug-9 

It seems I was off-base a bit here. There was already a ruby-byebug 
packaged, but it was somewhat out of date. Shall we simply update the 
existing package instead of creating a new package?

I had a go at re-enabling tests which were disabled in the original 
package - see the attached patch. Unfortunately it is still failing a 
few tests. Would you like to take a look into why this might be?

Thanks,
ben

Comments

Matthew Jordan June 5, 2016, 9:22 p.m. UTC | #1
Good Day Ben Woodcroft,

This is what I have so far, although I'm not that familiar with byebug
though. I'll try to dig a bit deeper to get a better understanding of
what's going on.

> It seems I was off-base a bit here. There was already a ruby-byebug 
> packaged, but it was somewhat out of date. Shall we simply update the 
> existing package instead of creating a new package?

Wouldn't it be more useful to have one or versions of a package, since
guix is capable of handling multiple versions? Though I have no problems
upgrading the previous version, hopefully nothing will break.

> I had a go at re-enabling tests which were disabled in the original 
> package - see the attached patch. Unfortunately it is still failing a 
> few tests. Would you like to take a look into why this might be?

Here a summary of test info. The test
"Byebug::SaveTest#test_save_shows_a_success_message" seems to fail cause
it's looking for a file in a home directory that doesn't exist. Setting
the HOME variable seems to solve that.

As for the other failing tests, they seem to expect to finish in the
temporary guix build directory.  

$ grep 'Failure:' $BUILD_LOG
  1) Failure:
  2) Failure:
  5) Failure:
  9) Failure:
  10) Failure:

  1) Failure:
  Byebug::FinishAfterReturnTest#test_finish_does_not_stop_in_byebug_internal_frames
  [/tmp/guix-build-ruby-byebug-9.0.5.drv-0/byebug-9.0.5/test/commands/finish_test.rb:88]:
  Expected program to have finished.
  Expected
  [["/tmp/guix-build-ruby-byebug-9.0.5.drv-0/byebug-9.0.5/test/support/utils.rb:61:in
  `debug_code'",
    #<Byebug::FinishAfterReturnTest:0x005555567647a0
       @NAME="test_finish_does_not_stop_in_byebug_internal_frames",
          @assertions=1,
             @example_file=
                 #<File:/tmp/guix-build-ruby-byebug-9.0.5.drv-0/byebug_test20160605-93-1myxp5a.rb>,
                    @example_folder="/tmp/guix-build-ruby-byebug-9.0.5.drv-0",
                       @failures=[]>,
                         Byebug::TestUtils,
                         ...

  2) Failure:
  Byebug::BasicNextTest#test_next_does_not_stop_at_byebug_internal_frames
  [/tmp/guix-build-ruby-byebug-9.0.5.drv-0/byebug-9.0.5/test/commands/next_test.rb:57]:
  Expected program to have finished.
  Expected
  [["/tmp/guix-build-ruby-byebug-9.0.5.drv-0/byebug-9.0.5/test/support/utils.rb:61:in
  `debug_code'",
    #<Byebug::BasicNextTest:0x0055555737b638
       @NAME="test_next_does_not_stop_at_byebug_internal_frames",
          @assertions=1,
             @example_file=
                 #<File:/tmp/guix-build-ruby-byebug-9.0.5.drv-0/byebug_test20160605-93-xpb9f1.rb>,
                    @example_folder="/tmp/guix-build-ruby-byebug-9.0.5.drv-0",
                       @failures=[]>,
                       ...

  5) Failure:
  Byebug::SaveTest#test_save_shows_a_success_message
  [/tmp/guix-build-ruby-byebug-9.0.5.drv-0/byebug-9.0.5/test/support/matchers.rb:27]:
  Expected ["",
   "[1, 5] in
  /tmp/guix-build-ruby-byebug-9.0.5.drv-0/byebug_test20160605-93-lrr6ae.rb",
   "1: module Byebug",
    "2:   byebug",
     "=> 3:   a = 2",
      "4:   a + 3",
       "5: end",
        "(byebug)",
         "(byebug)"]
          to include ["Saved to '/homeless-shelter/.byebug_save'"]
           in order.
           ...

  9) Failure:
  Byebug::FrameTest#test_frame_minus_one_sets_frame_to_the_last_one
  [/tmp/guix-build-ruby-byebug-9.0.5.drv-0/byebug-9.0.5/test/commands/frame_test.rb:78]:
  Expected location to be
  /tmp/guix-build-ruby-byebug-9.0.5.drv-0/byebug_test20160605-93-1w3cvx7.rb:1,
  but was
  /gnu/store/j86y28xf4q42bwlz98vhfjipf4rfb5bn-ruby-2.3.1/bin/rake:23

 10) Failure:
 Byebug::WhereWithNotDeeplyNestedPathsTest#test_where_displays_current_backtrace_w_shorpaths_if_fullpath_disabled
 [/tmp/guix-build-ruby-byebug-9.0.5.drv-0/byebug-9.0.5/test/support/matchers.rb:27]:
 Expected ["",
  "[11, 20] in
 /tmp/guix-build-ruby-byebug-9.0.5.drv-0/byebug_test20160605-93-ojlsg9.rb",
  "11:       to_int(str + 'x') + 5",
   "12:     end",
    "13:",
     "14:     def to_int(str)",
      "15:       byebug",
       "=> 16:       str.ord",
        "17:     end",
         "18:   end",
          "19:",
           "20:   frame = ByebugTest2016060593Ojlsg9Class.new('f')",
            "(byebug)",
             "fullpath is off",
              "(byebug)",
               "--> #0
 Byebug::ByebugTest2016060593Ojlsg9Class.to_int(str#String) at
 .../tmp/guix-build-ruby-byebug-9.0.5.drv-0/byebug_test20160605-93-ojlsg9.rb:16",
  "#1  Byebug::ByebugTest2016060593Ojlsg9Class.encode(str#String) at
 .../tmp/guix-build-ruby-byebug-9.0.5.drv-0/byebug_test20160605-93-ojlsg9.rb:11",
  "#2  Byebug::ByebugTest2016060593Ojlsg9Class.initialize(l#String) at
 .../tmp/guix-build-ruby-byebug-9.0.5.drv-0/byebug_test20160605-93-ojlsg9.rb:7",
 ...
 
Respectfully,

--
Matthew Jordan
Sent with my mu4e
Leo Famulari June 5, 2016, 9:43 p.m. UTC | #2
On Sun, Jun 05, 2016 at 05:22:02PM -0400, Matthew Jordan wrote:
> Wouldn't it be more useful to have one or versions of a package, since
> guix is capable of handling multiple versions? Though I have no problems
> upgrading the previous version, hopefully nothing will break.

In general, Guix handles this just fine. But somebody has to maintain
all those versions ;) We often suggest that if one user needs some old
version of a package, they maintain the package privately. For example,
using $GUIX_PACKAGE_PATH.
Matthew Jordan June 5, 2016, 9:54 p.m. UTC | #3
> In general, Guix handles this just fine. But somebody has to maintain
> all those versions ;) We often suggest that if one user needs some old
> version of a package, they maintain the package privately. For example,
> using $GUIX_PACKAGE_PATH.

Ah okay, that makes sense. Does this also also apply to compilers and
runtime environments? As I have two pachtes for the current versions of
node (JavaScript runtime), one is the reccomended version and the other
represents the latest stable version.

Although I have not submitted them yet.

Rsepectfully,

--
Matthew Jordan
Sent with my mu4e
Ben Woodcroft June 8, 2016, 12:41 p.m. UTC | #4
On 06/06/16 07:54, Matthew Jordan wrote:
>> In general, Guix handles this just fine. But somebody has to maintain
>> all those versions ;) We often suggest that if one user needs some old
>> version of a package, they maintain the package privately. For example,
>> using $GUIX_PACKAGE_PATH.
> Ah okay, that makes sense. Does this also also apply to compilers and
> runtime environments? As I have two pachtes for the current versions of
> node (JavaScript runtime), one is the reccomended version and the other
> represents the latest stable version.

There are some examples of multiple versions being included in Guix e.g. 
Ruby itself, GCC, etc, and we do tend to more commonly keep multiple 
versions of compilers and runtime environments.

> Although I have not submitted them yet.

Good luck. there are others working on node you may be able to 
coordinate with.

Thanks,
ben
Leo Famulari June 10, 2016, 3:11 p.m. UTC | #5
On Sun, Jun 05, 2016 at 05:54:34PM -0400, Matthew Jordan wrote:
> 
> > In general, Guix handles this just fine. But somebody has to maintain
> > all those versions ;) We often suggest that if one user needs some old
> > version of a package, they maintain the package privately. For example,
> > using $GUIX_PACKAGE_PATH.
> 
> Ah okay, that makes sense. Does this also also apply to compilers and
> runtime environments? As I have two pachtes for the current versions of
> node (JavaScript runtime), one is the reccomended version and the other
> represents the latest stable version.

There's no hard rule that allows us to keep multiple versions of
compilers and runtimes. I think we keep those around for a variety of
reasons: bootstrapping chains; many packages still require the old
version; it was very difficult to make the package work so it's not
reasonable to ask users to recreate and maintain the old versions
themselves; etc.
diff mbox

Patch

From c75cc9bd3af585907ef019d43236f12cc70cf832 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Thu, 2 Jun 2016 22:06:46 +1000
Subject: [PATCH] gnu: ruby-byebug: Update to 9.0.5.

* gnu/packages/ruby.scm (ruby-byebug): Update to 9.0.5.
[source]: Use 'GitHub' source.
[arguments]: Enable tests.
[native-inputs]: Add dependencies for tests.
---
 gnu/packages/ruby.scm | 39 +++++++++++++++++++++++++++++++++++----
 1 file changed, 35 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 6eebd9a..68e42be 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -2724,17 +2724,48 @@  with PostgreSQL 8.4 and later.")
 (define-public ruby-byebug
   (package
     (name "ruby-byebug")
-    (version "6.0.2")
+    (version "9.0.5")
     (source
      (origin
        (method url-fetch)
-       (uri (rubygems-uri "byebug" version))
+       (uri (string-append
+             "https://github.com/deivid-rodriguez/byebug/archive/v" version
+             ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
        (sha256
         (base32
-         "0537h9qbhr6csahmzyn4lk1g5b2lcligbzd21gfy93nx9lbfdnzc"))))
+         "0apgk5d2s68rzmzli09ryqigbk2nx7k5r01qw0iz51pp7m7hm34l"))))
     (build-system ruby-build-system)
     (arguments
-     '(#:tests? #f)) ; no tests
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; Most of the dependencies are not needed for building and testing,
+         ;; so remove them.
+         (add-before 'build 'remove-dependencies
+           (lambda _
+             (substitute* "Gemfile"
+               (("gem .*") ""))
+             (substitute* "Rakefile"
+               (("require 'chandler/tasks'") ""))
+             #t))
+         ;; Tests require an installed gem, so run tests after install phase.
+         (delete 'check)
+         (add-after 'install 'check-after-install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (setenv "GEM_PATH"
+                     (string-append
+                      (getenv "GEM_PATH")
+                      ":"
+                      (gem-home (assoc-ref outputs "out")
+                                ,(package-version ruby))))
+             (and (system* "rake" "compile")
+                  (zero? (system* "rake" "test"))))))))
+    (native-inputs
+     `(("bundler" ,bundler)
+       ("ruby-yard" ,ruby-yard)
+       ("ruby-rake-compiler" ,ruby-rake-compiler)
+       ("ruby-simplecov" ,ruby-simplecov)
+       ("ruby-pry" ,ruby-pry)))
     (synopsis "Debugger for Ruby 2")
     (description "Byebug is a Ruby 2 debugger implemented using the Ruby 2
 TracePoint C API for execution control and the Debug Inspector C API for call
-- 
2.7.4