all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#42948: (wrap-program) bug
@ 2020-08-20 11:59 Prafulla Giri
  2020-08-20 12:31 ` Julien Lepiller
  2020-08-20 16:57 ` Julien Lepiller
  0 siblings, 2 replies; 4+ messages in thread
From: Prafulla Giri @ 2020-08-20 11:59 UTC (permalink / raw)
  To: 42948


[-- Attachment #1.1: Type: text/plain, Size: 1787 bytes --]

Esteemed maintainers,

It seems that (wrap-program ...) over-writes the previous wrapping of a
package done by the build system.

This does not happen for many (wrap-programs) called in the modify-phases
section of the package definition itself.

Attached is a package definition for ruby-ronn-ng, that demonstrates this
issue. The custom (wrap-program)-s
called from the package definition seem to over-write the definitions of
GEM_ENV as made by the 'wrap %standard-phase
of the ruby-build system.
The wrappings made by 'wrap %standard-phase can be seen during the custom
'DEBUG phase. The subsequent 'wrap-program1
and 'wrap-program2 add more environment variables to the wrapping, but on
checking the contents of `which ronn`, once
it is installed (using `less $(which ronn)`), it can be verified that the
GEM_ENV package definitions have been overwritten.

This may just be a ruby-build-system issue. Or perhaps it might be
something that permeates over a few more build systems.
That still remains to be tested.

Attached are a few different versions of the package definitions for
ruby-ronn-ng for the ease of those who would like to
verify this.
1. ruby-ronn-ng-standalone.scm : To be tested using `guix time-machine --
build --verbosity=2 --file=ruby-ronn-ng-standalone.scm`[1]
2. ruby-ronn-ng.scm : To be appended to the end of the
gnu/packages/ruby.scm file in local guix checkout, and be tested using the
local version
3. ruby-ronn-ng.patch : To be applied to local guix checkout

[1] - This package definition needs ruby-mustache, which has only recently
been added to guix. Hence, the time-machine.

NOTE: `ronn` does not work even with `propagated-inputs`. See this patch as
to why:
https://aur.archlinux.org/cgit/aur.git/tree/0001-allow-mustache-1.0.patch?h=ruby-ronn-ng

[-- Attachment #1.2: Type: text/html, Size: 2038 bytes --]

[-- Attachment #2: ruby-ronn-ng.patch --]
[-- Type: text/x-patch, Size: 2737 bytes --]

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 010028082a..5797b7cb9d 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -11659,3 +11659,56 @@ which snapshots to consider and what files to include.")
 defined in @file{.travis.yml} on your local machine, using @code{rvm},
 @code{rbenv}, or @code{chruby} to test different versions of Ruby.")
     (license license:expat)))
+
+(define-public ruby-ronn-ng
+  (package
+    (name "ruby-ronn-ng")
+    (version "0.9.1")
+    (home-page "asdf")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (rubygems-uri "ronn-ng" version))
+       (sha256
+        (base32
+         "1slxfg57cabmh98fw507z4ka6lwq1pvbrqwppflxw6700pi8ykfh"))))
+    (build-system ruby-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; Debug phase, just to show that before any of this wrapping, the standard ruby 'wrap phase has
+         ;; already done it's job, AND it gets over-written, for some strange reason. The (wrappings)
+         ;; defined in the package itself don't seem to over-write each other. Hmm.
+         (add-after
+             'wrap 'DEBUG
+           (lambda _
+             (pk "Hey there, I'm closer than I appear!")
+             (invoke "cat" (string-append (assoc-ref %outputs "out") "/bin/.ronn-real"))
+             #t))
+         (add-after
+             'wrap 'wrap-program2
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((prog (string-append (assoc-ref %outputs "out") "/bin/ronn")))
+               (begin (display %build-inputs)(newline))
+               (wrap-program prog
+                 `("PATH" ":" suffix ,(map (lambda (exp_inpt)
+                                             (string-append (assoc-ref %build-inputs exp_inpt) "/bin"))
+                                           '("ruby-kramdown" "ruby-mustache" "ruby-nokogiri")))))
+             #t))
+         (add-after
+             'wrap 'wrap-program1
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((prog (string-append (assoc-ref %outputs "out") "/bin/ronn")))
+               (wrap-program prog
+                 `("FOO" ":" = ("BAR"))))#t))
+         ;; another add-after may go here
+         )))
+    (inputs ;; note to self: these were propagated-inputs before
+     `(("ruby-kramdown" ,ruby-kramdown)
+       ("ruby-mustache" ,ruby-mustache)
+       ("ruby-nokogiri" ,ruby-nokogiri)))
+    (synopsis
+     "Ronn-NG builds manuals in HTML and Unix man page format from Markdown.")
+    (description
+     "Ronn-NG builds manuals in HTML and Unix man page format from Markdown.")
+    (license license:expat))) ;; license and home-page are mock values here

[-- Attachment #3: ruby-ronn-ng.scm --]
[-- Type: text/x-scheme, Size: 2278 bytes --]


(define-public ruby-ronn-ng
  (package
    (name "ruby-ronn-ng")
    (version "0.9.1")
    (home-page "asdf")
    (source
     (origin
       (method url-fetch)
       (uri (rubygems-uri "ronn-ng" version))
       (sha256
        (base32
         "1slxfg57cabmh98fw507z4ka6lwq1pvbrqwppflxw6700pi8ykfh"))))
    (build-system ruby-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         ;; Debug phase, just to show that before any of this wrapping, the standard ruby 'wrap phase has
         ;; already done it's job, AND it gets over-written, for some strange reason. The (wrappings)
         ;; defined in the package itself don't seem to over-write each other. Hmm.
         (add-after
             'wrap 'DEBUG
           (lambda _
             (pk "Hey there, I'm closer than I appear!")
             (invoke "cat" (string-append (assoc-ref %outputs "out") "/bin/.ronn-real"))
             #t))
         (add-after
             'wrap 'wrap-program2
           (lambda* (#:key outputs #:allow-other-keys)
             (let ((prog (string-append (assoc-ref %outputs "out") "/bin/ronn")))
               (begin (display %build-inputs)(newline))
               (wrap-program prog
                 `("PATH" ":" suffix ,(map (lambda (exp_inpt)
                                             (string-append (assoc-ref %build-inputs exp_inpt) "/bin"))
                                           '("ruby-kramdown" "ruby-mustache" "ruby-nokogiri")))))
             #t))
         (add-after
             'wrap 'wrap-program1
           (lambda* (#:key outputs #:allow-other-keys)
             (let ((prog (string-append (assoc-ref %outputs "out") "/bin/ronn")))
               (wrap-program prog
                 `("FOO" ":" = ("BAR"))))#t))
         ;; another add-after may go here
         )))
    (inputs ;; note to self: these were propagated-inputs before
     `(("ruby-kramdown" ,ruby-kramdown)
       ("ruby-mustache" ,ruby-mustache)
       ("ruby-nokogiri" ,ruby-nokogiri)))
    (synopsis
     "Ronn-NG builds manuals in HTML and Unix man page format from Markdown.")
    (description
     "Ronn-NG builds manuals in HTML and Unix man page format from Markdown.")
    (license license:expat))) ;; license and home-page are mock values here

[-- Attachment #4: ruby-ronn-ng-standalone.scm --]
[-- Type: text/x-scheme, Size: 2223 bytes --]

(use-modules (guix packages)
	     (guix download)
	     (guix build-system ruby)
	     ((guix licenses) #:prefix license:)
	     (gnu packages ruby))

(define ruby-ronn-ng
  (package
   (name "ruby-ronn-ng")
   (version "0.9.1")
   (home-page "asdf")
   (source
    (origin
     (method url-fetch)
     (uri (rubygems-uri "ronn-ng" version))
     (sha256
      (base32
       "1slxfg57cabmh98fw507z4ka6lwq1pvbrqwppflxw6700pi8ykfh"))))
   (build-system ruby-build-system)
   (arguments
    `(#:phases
      (modify-phases %standard-phases
		     ;; Debug phase, just to show that before any of this wrapping, the standard ruby 'wrap phase has
		     ;; already done it's job, AND it gets over-written, for some strange reason. The (wrappings)
		     ;; defined in the package itself don't seem to over-write each other. Hmm.
		     (add-after
		      'wrap 'DEBUG
		      (lambda _
			(pk "Hey there, I'm closer than I appear!")
			(invoke "cat" (string-append (assoc-ref %outputs "out") "/bin/.ronn-real"))
			#t))
		     (add-after
		      'wrap 'wrap-program2
		      (lambda* (#:key outputs #:allow-other-keys)
			       (let ((prog (string-append (assoc-ref %outputs "out") "/bin/ronn")))
				 (begin (display %build-inputs)(newline))
				 (wrap-program prog
					       `("PATH" ":" suffix ,(map (lambda (exp_inpt)
									   (string-append (assoc-ref %build-inputs exp_inpt) "/bin"))
									 '("ruby-kramdown" "ruby-mustache" "ruby-nokogiri")))))
			       #t))
		     (add-after
		      'wrap 'wrap-program1
		      (lambda* (#:key outputs #:allow-other-keys)
			       (let ((prog (string-append (assoc-ref %outputs "out") "/bin/ronn")))
				 (wrap-program prog
					       `("FOO" ":" = ("BAR"))))#t))
		     ;; another add-after may go here
		     )))
   (inputs ;; note to self: these were propagated-inputs before
    `(("ruby-kramdown" ,ruby-kramdown)
      ("ruby-mustache" ,ruby-mustache)
      ("ruby-nokogiri" ,ruby-nokogiri)))
   (synopsis
    "Ronn-NG builds manuals in HTML and Unix man page format from Markdown.")
   (description
    "Ronn-NG builds manuals in HTML and Unix man page format from Markdown.")
   (license license:expat))) ;; license and home-page are mock values here

ruby-ronn-ng

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-20 16:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-20 11:59 bug#42948: (wrap-program) bug Prafulla Giri
2020-08-20 12:31 ` Julien Lepiller
2020-08-20 15:15   ` Prafulla Giri
2020-08-20 16:57 ` Julien Lepiller

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.