Re: [Patch] ruby-byebug@9.0.5

2016-06-10 Thread Leo Famulari
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.



Fwd: Re: [Patch] ruby-byebug@9.0.5

2016-06-08 Thread Ben Woodcroft


This got bounced from the list for being over the attachment size limit, 
so sending again with gzipped build.log


On 06/06/16 07:22, Matthew Jordan wrote:

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.


Thanks for looking into it.

[..]

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.


Good plan. I'm not sure how you set HOME in your package, but setting it
to /tmp seems to give less errors, though there is still 4 of them.

The first one seems to be due to "File.realpath" returning a form the
test isn't expecting:

e.g. expected;
  "--> #0 Byebug::ByebugTest201606081021q3p5qfClass.to_int(str#String)
at
/tmp/nix-build-ruby-byebug-9.0.5.drv-0/byebug_test20160608-102-1q3p5qf.rb:16
observed
  "--> #0 Byebug::ByebugTest201606081021q3p5qfClass.to_int(str#String)
at
.../tmp/nix-build-ruby-byebug-9.0.5.drv-0/byebug_test20160608-102-1q3p5qf.rb:16",

This might be fixable by patching line 76 of this file:
https://github.com/deivid-rodriguez/byebug/blob/24ad09b8f84531a7d5b112e6e7932bbc13fb7086/test/support/test_case.rb

I've not had time to look at the other tests, some are the same as the
errors you found. Are you able to take a look please?

Thanks,
ben



>From c323ab6c9d1e9d8cfa7f6b879e17826f7e1ef62e Mon Sep 17 00:00:00 2001
From: Ben Woodcroft 
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 | 40 
 1 file changed, 36 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 527f76b..327a6a4 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -2757,17 +2757,49 @@ 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 "HOME" "/tmp")
+ (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




build.log.gz
Description: application/gzip


Re: [Patch] ruby-byebug@9.0.5

2016-06-08 Thread Ben Woodcroft



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



Re: [Patch] ruby-byebug@9.0.5

2016-06-05 Thread Matthew Jordan

> 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



Re: [Patch] ruby-byebug@9.0.5

2016-06-05 Thread Matthew Jordan
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'",
#,
@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'",
#,
@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



Re: [Patch] ruby-byebug@9.0.5

2016-06-02 Thread Ben Woodcroft

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
>From c75cc9bd3af585907ef019d43236f12cc70cf832 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft 
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



[Patch] ruby-byebug@9.0.5

2016-05-31 Thread Matthew Jordan
>From db2eb23978143363861b780fa43e28301b70f464 Mon Sep 17 00:00:00 2001
From: Matthew Jordan 
Date: Tue, 31 May 2016 07:31:37 -0400
Subject: [PATCH 3/4] gnu: Add ruby-byebug@9.0.5

* gnu/packages/rails.scm: Modified file.
---
 gnu/packages/ruby.scm | 25 +
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 6eebd9a..595abeb 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -2721,6 +2721,31 @@ with PostgreSQL 8.4 and later.")
 (home-page "https://bitbucket.org/ged/ruby-pg;)
 (license license:ruby)))
 
+(define-public ruby-byebug-9
+  (package
+(name "ruby-byebug")
+(version "9.0.5")
+(source
+ (origin
+   (method url-fetch)
+   (uri (rubygems-uri "byebug" version))
+   (sha256
+(base32
+ "18sdnscwwm76i2kbcib2ckwfwpq8b1dbfr97gdcx3j1x547yqv9x"
+(build-system ruby-build-system)
+(arguments
+ `(#:tests? #f))
+(synopsis "Byebug is a Ruby 2 debugger.")
+(description
+ "Byebug is a Ruby 2 debugger.  It's implemented using the Ruby 2
+TracePoint C API for execution control and the Debug Inspector C API for call
+stack navigation.  The core component provides support that front-ends can
+build on.  It provides breakpoint handling and bindings for stack frames among
+other things and it comes with an easy to use command line interface.")
+(home-page
+ "http://github.com/deivid-rodriguez/byebug;)
+(license license:bsd-3)))
+
 (define-public ruby-byebug
   (package
 (name "ruby-byebug")
-- 
2.8.3


-- 
Matthew Jordan
Sent with my mu4e