unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Search paths in packages
@ 2017-10-09 10:43 Roel Janssen
  2017-10-09 16:31 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Roel Janssen @ 2017-10-09 10:43 UTC (permalink / raw)
  To: guix-devel

Dear Guix,

I have a question about how search paths are handled in Guix.
So, I have a package that tries to set an environment variable:
DRMAA_LIBRARY_PATH.

So, I tried:
(native-search-paths
     (list (search-path-specification
            (variable "DRMAA_LIBRARY_PATH")
            (files '("lib/libdrmaa.so")))))

But after running:
$ guix environment --container --ad-hoc <the-package> bash coreutils

... the DRMAA_LIBRARY_PATH is not set.

However, the manifest contains the search path.  From inside the container:
$ cat $GUIX_ENVIRONMENT/manifest
(manifest
  (version 3)
  (packages
    (("coreutils"
      "8.27"
      "out"
      "/gnu/store/m9l0j7apf9ac7shqwi5sh4hsn12x4dnk-coreutils-8.27"
      (propagated-inputs ())
      (search-paths ()))
     ("bash"
      "4.4.12"
      "out"
      "/gnu/store/b7y66db86k57vbb03nr4bfn9svmks4gf-bash-4.4.12"
      (propagated-inputs ())
      (search-paths
        (("BASH_LOADABLES_PATH"
          ("lib/bash")
          ":"
          directory
          #f))))
     ("grid-engine-core"
      "8.1.9"
      "out"
      "/gnu/store/jw80iilm964q2y0krnc1r67fxi07fix2-grid-engine-core-8.1.9"
      (propagated-inputs ())
      (search-paths
        (("DRMAA_LIBRARY_PATH"
          ("lib/libdrmaa.so")
          ":"
          directory
          #f)))))))

Why isn't DRMAA_LIBRARY_PATH set in this case?

Kind regards,
Roel Janssen

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

* Re: Search paths in packages
  2017-10-09 10:43 Search paths in packages Roel Janssen
@ 2017-10-09 16:31 ` Ludovic Courtès
  2017-10-09 20:57   ` Roel Janssen
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2017-10-09 16:31 UTC (permalink / raw)
  To: Roel Janssen; +Cc: guix-devel

Hi Roel,

Roel Janssen <roel@gnu.org> skribis:

> I have a question about how search paths are handled in Guix.
> So, I have a package that tries to set an environment variable:
> DRMAA_LIBRARY_PATH.
>
> So, I tried:
> (native-search-paths
>      (list (search-path-specification
>             (variable "DRMAA_LIBRARY_PATH")
>             (files '("lib/libdrmaa.so")))))

If you want to match a regular file instead of a directory (the
default), you must write:

  (search-path-specification
    (variable "DRMAA_LIBRARY_PATH")
    (files '("lib/libdrmaa.so"))
    (file-type 'regular))

This will match all the lib/libdrmaa.so files found in the environment.

> But after running:
> $ guix environment --container --ad-hoc <the-package> bash coreutils
>
> ... the DRMAA_LIBRARY_PATH is not set.

That’s because none of the packages listed after --ad-hoc contains a
lib/libdrmaa.so file.

You can do this experiment with GIT_SSL_CAINFO:

--8<---------------cut here---------------start------------->8---
$ guix environment -C --ad-hoc git coreutils -- env |grep GIT
GIT_EXEC_PATH=/gnu/store/m5baadh2m4kgvzgxc5m3phw9f6pyhwnv-profile/libexec/git-core
$ guix environment -C --ad-hoc git coreutils nss-certs -- env |grep GIT
GIT_SSL_CAINFO=/gnu/store/x6f5ywznnjzwa81a3g7rcs5riippx2zh-profile/etc/ssl/certs/ca-certificates.crt
GIT_EXEC_PATH=/gnu/store/x6f5ywznnjzwa81a3g7rcs5riippx2zh-profile/libexec/git-core
--8<---------------cut here---------------end--------------->8---

In the first run, there was no etc/ssl/ca-certificates.crt file, so
GIT_SSL_CAINFO was undefined.

HTH!

Ludo’.

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

* Re: Search paths in packages
  2017-10-09 16:31 ` Ludovic Courtès
@ 2017-10-09 20:57   ` Roel Janssen
  0 siblings, 0 replies; 3+ messages in thread
From: Roel Janssen @ 2017-10-09 20:57 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel


Ludovic Courtès writes:

> Hi Roel,
>
> Roel Janssen <roel@gnu.org> skribis:
>
>> I have a question about how search paths are handled in Guix.
>> So, I have a package that tries to set an environment variable:
>> DRMAA_LIBRARY_PATH.
>>
>> So, I tried:
>> (native-search-paths
>>      (list (search-path-specification
>>             (variable "DRMAA_LIBRARY_PATH")
>>             (files '("lib/libdrmaa.so")))))
>
> If you want to match a regular file instead of a directory (the
> default), you must write:
>
>   (search-path-specification
>     (variable "DRMAA_LIBRARY_PATH")
>     (files '("lib/libdrmaa.so"))
>     (file-type 'regular))
>
> This will match all the lib/libdrmaa.so files found in the environment.
>
>> But after running:
>> $ guix environment --container --ad-hoc <the-package> bash coreutils
>>
>> ... the DRMAA_LIBRARY_PATH is not set.
>
> That’s because none of the packages listed after --ad-hoc contains a
> lib/libdrmaa.so file.
>
> You can do this experiment with GIT_SSL_CAINFO:
>
> --8<---------------cut here---------------start------------->8---
> $ guix environment -C --ad-hoc git coreutils -- env |grep GIT
> GIT_EXEC_PATH=/gnu/store/m5baadh2m4kgvzgxc5m3phw9f6pyhwnv-profile/libexec/git-core
> $ guix environment -C --ad-hoc git coreutils nss-certs -- env |grep GIT
> GIT_SSL_CAINFO=/gnu/store/x6f5ywznnjzwa81a3g7rcs5riippx2zh-profile/etc/ssl/certs/ca-certificates.crt
> GIT_EXEC_PATH=/gnu/store/x6f5ywznnjzwa81a3g7rcs5riippx2zh-profile/libexec/git-core
> --8<---------------cut here---------------end--------------->8---
>
> In the first run, there was no etc/ssl/ca-certificates.crt file, so
> GIT_SSL_CAINFO was undefined.
>
> HTH!
>
> Ludo’.

Thanks for explaining this!  Now I've got it working as I intended it,
indeed.

Thanks!

Kind regards,
Roel Janssen

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

end of thread, other threads:[~2017-10-09 20:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-09 10:43 Search paths in packages Roel Janssen
2017-10-09 16:31 ` Ludovic Courtès
2017-10-09 20:57   ` Roel Janssen

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).