unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* (current-filename) behaves differently in environment|build
@ 2019-03-31 23:42 wldhx
  2019-04-08  9:14 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: wldhx @ 2019-03-31 23:42 UTC (permalink / raw)
  To: guix-devel

Hi guix,

Discovered following behaviour while setting up GNUnet CI:

Given

./gnu/packages/a.scm:
   ...
   (source (local-file (dirname (current-filename))))
   ...

export GUIX_PACKAGE_PATH=$PWD

`(current-filename)` returns `#f` when evaluated via `guix environment`,
while `guix build` does fine. Is this expected? Am I doing something wrong?

The usecase is like
https://lists.gnu.org/archive/html/help-guix/2017-04/msg00097.html.

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

* Re: (current-filename) behaves differently in environment|build
  2019-03-31 23:42 (current-filename) behaves differently in environment|build wldhx
@ 2019-04-08  9:14 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2019-04-08  9:14 UTC (permalink / raw)
  To: wldhx; +Cc: guix-devel

Hello,

wldhx <wldhx@wldhx.me> skribis:

> Discovered following behaviour while setting up GNUnet CI:
>
> Given
>
> ./gnu/packages/a.scm:
>    ...
>    (source (local-file (dirname (current-filename))))
>    ...

It’s enough to write:

  (local-file ".." #:recursive? #t)

since ‘local-file’ already takes care of resolving the file name
relative to the current source file.

Does that work for you?

> export GUIX_PACKAGE_PATH=$PWD
>
> `(current-filename)` returns `#f` when evaluated via `guix environment`,
> while `guix build` does fine. Is this expected? Am I doing something wrong?


No, there shouldn’t be any difference.

Thanks, and apologies for the delay!

Ludo’.

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

end of thread, other threads:[~2019-04-08  9:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-31 23:42 (current-filename) behaves differently in environment|build wldhx
2019-04-08  9:14 ` Ludovic Courtès

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