unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#66336] [PATCH] gnu: guile-proba: Fix environment vars in Guile Proba's script.
@ 2023-10-04 10:20 Fabio Natali via Guix-patches via
  2023-10-05 18:35 ` Luis Felipe via Guix-patches via
  2023-10-14 13:29 ` bug#66336: " Mathieu Othacehe
  0 siblings, 2 replies; 3+ messages in thread
From: Fabio Natali via Guix-patches via @ 2023-10-04 10:20 UTC (permalink / raw)
  To: 66336; +Cc: Luis Felipe, Fabio Natali

* gnu/packages/check.scm (guile-proba): Micro fix.

Guile Proba's CLI script, as created via Guix's `wrap-program', should take
into account (as opposed to discard) the original, user-defined values of
`GUILE_LOAD_PATH' and `GUILE_LOAD_COMPILED_PATH'.

Currently, Guile Proba's CLI script is unable to find any third-party library
needed by the app being tested. This micro change should fix this.
---
Hi,

I think there might be a slight PATH-related issue in the way guile-proba is currently packaged. Specifically, I think it should be:

#+begin_src scheme :noeval
`("GUILE_LOAD_PATH" prefix (,(getenv "GUILE_LOAD_PATH")))
`("GUILE_LOAD_COMPILED_PATH" prefix (,(getenv "GUILE_LOAD_COMPILED_PATH")))))))
#+end_src

as opposed to the way it's now:

#+begin_src scheme :noeval
`("GUILE_LOAD_PATH" = (,(getenv "GUILE_LOAD_PATH")))
`("GUILE_LOAD_COMPILED_PATH" = (,(getenv "GUILE_LOAD_COMPILED_PATH")))))))
#+end_src

The current version results in the following CLI program:

#+begin_export ascii
user@host:~/staging/guix$ guix shell --container --link-profile coreutils guile-proba -- cat ~/.guix-profile/bin/proba
#!/gnu/store/9vw5slrffp27rzy2i2plnw7xfqjyk7m4-bash-minimal-5.1.16/bin/bash
export GUILE_LOAD_PATH="/gnu/store/2k854q6limcmiinqsysc7r5p3x61spcj-guile-proba-0.3.0/share/guile/site/3.0:/gnu/store/wfhc8rbbmd0z25frrb5skhwcz242092i-guile-config-0.5.1/share/guile/site/3.0:/gnu/store/bc3zzjych6jyp4ph2af9k3w8qcs3nsn2-guile-lib-0.2.7/share/guile/site/3.0"
export GUILE_LOAD_COMPILED_PATH="/gnu/store/2k854q6limcmiinqsysc7r5p3x61spcj-guile-proba-0.3.0/lib/guile/3.0/site-ccache/:/gnu/store/2k854q6limcmiinqsysc7r5p3x61spcj-guile-proba-0.3.0/lib/guile/3.0/site-ccache:/gnu/store/wfhc8rbbmd0z25frrb5skhwcz242092i-guile-config-0.5.1/lib/guile/3.0/site-ccache:/gnu/store/wfhc8rbbmd0z25frrb5skhwcz242092i-guile-config-0.5.1/share/guile/site/3.0:/gnu/store/bc3zzjych6jyp4ph2af9k3w8qcs3nsn2-guile-lib-0.2.7/lib/guile/3.0/site-ccache:/gnu/store/bc3zzjych6jyp4ph2af9k3w8qcs3nsn2-guile-lib-0.2.7/share/guile/site/3.0"
exec -a "$0" "/gnu/store/2k854q6limcmiinqsysc7r5p3x61spcj-guile-proba-0.3.0/bin/.proba-real" "$@"
#+end_export

whereas I think the script should read (with this micro-patch):

#+begin_export ascii
user@host:~/staging/guix$ ./pre-inst-env guix shell --container --link-profile coreutils guile-proba -- cat ~/.guix-profile/bin/proba
#!/gnu/store/9vw5slrffp27rzy2i2plnw7xfqjyk7m4-bash-minimal-5.1.16/bin/bash
export GUILE_LOAD_PATH="/gnu/store/ibkh3kvhg5ky3xa9f49b48iv3wk0l1lk-guile-proba-0.3.0/share/guile/site/3.0:/gnu/store/wfhc8rbbmd0z25frrb5skhwcz242092i-guile-config-0.5.1/share/guile/site/3.0:/gnu/store/bc3zzjych6jyp4ph2af9k3w8qcs3nsn2-guile-lib-0.2.7/share/guile/site/3.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
export GUILE_LOAD_COMPILED_PATH="/gnu/store/ibkh3kvhg5ky3xa9f49b48iv3wk0l1lk-guile-proba-0.3.0/lib/guile/3.0/site-ccache/:/gnu/store/ibkh3kvhg5ky3xa9f49b48iv3wk0l1lk-guile-proba-0.3.0/lib/guile/3.0/site-ccache:/gnu/store/wfhc8rbbmd0z25frrb5skhwcz242092i-guile-config-0.5.1/lib/guile/3.0/site-ccache:/gnu/store/wfhc8rbbmd0z25frrb5skhwcz242092i-guile-config-0.5.1/share/guile/site/3.0:/gnu/store/bc3zzjych6jyp4ph2af9k3w8qcs3nsn2-guile-lib-0.2.7/lib/guile/3.0/site-ccache:/gnu/store/bc3zzjych6jyp4ph2af9k3w8qcs3nsn2-guile-lib-0.2.7/share/guile/site/3.0${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
exec -a "$0" "/gnu/store/ibkh3kvhg5ky3xa9f49b48iv3wk0l1lk-guile-proba-0.3.0/bin/.proba-real" "$@"
#+end_export

As a result of this, currently, Guile Proba's CLI script is unable to find any third-party library needed by the app being tested. This micro change should fix this.

This can be tested as follows.

#+begin_export shell :noeval
$ tree
.
├── foo.scm
└── tests
    └── test-main.scm
#+end_export

#+begin_src scheme :noeval
;; foo.scm
(define-module (foo)
  #:use-module (ini)
  #:export (bar))

(define (bar)
  (call-with-input-string "[foo]\nbar=baz\n" ini->scm))
#+end_src

#+begin_src scheme :noeval
;; test-main.scm
(define-module (test-main)
  #:use-module (foo)
  #:use-module (srfi srfi-64))

(test-begin "main")

(test-equal "main"
  (bar)
  '(("foo" ("bar" . "baz"))))

(test-end "main")
#+end_src

With the above files in place:

#+begin_src shell :noeval
$ proba run tests
[...]
ice-9/boot-9.scm:3330:6: In procedure resolve-interface:
no code for module (ini)
#+end_src

What do you think? I hope the change looks fine.

Thanks, best, Fabio.


 gnu/packages/check.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 5af3b49280..e3c32c17c2 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -3599,8 +3599,8 @@ (define-public guile-proba
                 (copy-file "proba.scm" script)
                 (chmod script #o555)
                 (wrap-program script
-                  `("GUILE_LOAD_PATH" = (,(getenv "GUILE_LOAD_PATH")))
-                  `("GUILE_LOAD_COMPILED_PATH" =
+                  `("GUILE_LOAD_PATH" prefix (,(getenv "GUILE_LOAD_PATH")))
+                  `("GUILE_LOAD_COMPILED_PATH" prefix
                     (,(getenv "GUILE_LOAD_COMPILED_PATH")))))))
           (add-after 'install 'install-manual
             (lambda* (#:key outputs #:allow-other-keys)

base-commit: 24fc0370d0d12f34cffd44801cc6382fc5cc5f23
-- 
2.41.0





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

* [bug#66336] [PATCH] gnu: guile-proba: Fix environment vars in Guile Proba's script.
  2023-10-04 10:20 [bug#66336] [PATCH] gnu: guile-proba: Fix environment vars in Guile Proba's script Fabio Natali via Guix-patches via
@ 2023-10-05 18:35 ` Luis Felipe via Guix-patches via
  2023-10-14 13:29 ` bug#66336: " Mathieu Othacehe
  1 sibling, 0 replies; 3+ messages in thread
From: Luis Felipe via Guix-patches via @ 2023-10-05 18:35 UTC (permalink / raw)
  To: 66336


[-- Attachment #1.1.1: Type: text/plain, Size: 414 bytes --]

Hi Fabio, everyone.

I can reproduce the defect and can confirm that the patch solves the 
problem.

I don't have commit access, but, for what it's worth, I see that in a 
|./pre-inst-env|

☑ The patch applies correctly
☑ |guix build --check --no-grafts guile-proba |succeeds
☑ guix lint guile-proba does not report issues (although it indicates 
the package can be upgraded to 0.3.1)

Cheers,

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 2881 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* bug#66336: [PATCH] gnu: guile-proba: Fix environment vars in Guile Proba's script.
  2023-10-04 10:20 [bug#66336] [PATCH] gnu: guile-proba: Fix environment vars in Guile Proba's script Fabio Natali via Guix-patches via
  2023-10-05 18:35 ` Luis Felipe via Guix-patches via
@ 2023-10-14 13:29 ` Mathieu Othacehe
  1 sibling, 0 replies; 3+ messages in thread
From: Mathieu Othacehe @ 2023-10-14 13:29 UTC (permalink / raw)
  To: Fabio Natali; +Cc: Luis Felipe, 66336-done


> * gnu/packages/check.scm (guile-proba): Micro fix.

Applied, thanks!

Mathieu




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

end of thread, other threads:[~2023-10-14 13:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-04 10:20 [bug#66336] [PATCH] gnu: guile-proba: Fix environment vars in Guile Proba's script Fabio Natali via Guix-patches via
2023-10-05 18:35 ` Luis Felipe via Guix-patches via
2023-10-14 13:29 ` bug#66336: " Mathieu Othacehe

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).