all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#25762: bug#25772: [PATCH] guix package: Remove trailing slash from profile path.
       [not found]   ` <87d1ee2y8p.fsf@gmail.com>
@ 2017-07-20 13:31       ` Ludovic Courtès
  0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2017-07-20 13:31 UTC (permalink / raw)
  To: Alex Kost; +Cc: 25772-done, 25762-done

Hello!

Alex Kost <alezost@gmail.com> skribis:

> Ricardo Wurmus (2017-02-17 23:38 +0100) wrote:
>
> [...]
>>>    (let* ((profiles (match (filter-map (match-lambda
>>> -                                        (('profile . p) p)
>>> -                                        (_              #f))
>>> +                                        (('profile . p)
>>> +                                         (readlink (string-trim-right p #\/)))
>>> +                                        (_ #f))
>>>                                        opts)
>>>                       (() (list %current-profile))
>>>                       (lst lst)))
>>
>> I don’t know if this is the right place for this change or if this
>> should be further upstream.
>
> I think it is not the right place: you modify only 'process-query'
> procedure, but there is also 'process-actions', so the following command
> will still fail:
>
>   guix package -p /tmp/test-profile/ -i hello
>
> while the following succeeds:
>
>   guix package -p /tmp/test-profile -i hello
>
> So I would rather modify 'canonicalize-profile' procedure in that
> module.  I think it will be a general solution for --profile option.

Indeed.  I pushed something along these lines as
edbe07cd67d6050d94fe8ac1af15ab15e857b61d, and a related fix as
561f4e450078a06c707d3dcda2cf0e7d6eb5ebae.

Thanks!

Ludo’.

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

* bug#25772: [PATCH] guix package: Remove trailing slash from profile path.
@ 2017-07-20 13:31       ` Ludovic Courtès
  0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2017-07-20 13:31 UTC (permalink / raw)
  To: Alex Kost; +Cc: Ricardo Wurmus, 25772-done, 25762-done

Hello!

Alex Kost <alezost@gmail.com> skribis:

> Ricardo Wurmus (2017-02-17 23:38 +0100) wrote:
>
> [...]
>>>    (let* ((profiles (match (filter-map (match-lambda
>>> -                                        (('profile . p) p)
>>> -                                        (_              #f))
>>> +                                        (('profile . p)
>>> +                                         (readlink (string-trim-right p #\/)))
>>> +                                        (_ #f))
>>>                                        opts)
>>>                       (() (list %current-profile))
>>>                       (lst lst)))
>>
>> I don’t know if this is the right place for this change or if this
>> should be further upstream.
>
> I think it is not the right place: you modify only 'process-query'
> procedure, but there is also 'process-actions', so the following command
> will still fail:
>
>   guix package -p /tmp/test-profile/ -i hello
>
> while the following succeeds:
>
>   guix package -p /tmp/test-profile -i hello
>
> So I would rather modify 'canonicalize-profile' procedure in that
> module.  I think it will be a general solution for --profile option.

Indeed.  I pushed something along these lines as
edbe07cd67d6050d94fe8ac1af15ab15e857b61d, and a related fix as
561f4e450078a06c707d3dcda2cf0e7d6eb5ebae.

Thanks!

Ludo’.

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

* [bug#25772] [PATCH] guix package: Remove trailing slash from profile path.
  2017-07-20 13:31       ` Ludovic Courtès
  (?)
@ 2017-07-21 19:51       ` Alex Kost
  -1 siblings, 0 replies; 3+ messages in thread
From: Alex Kost @ 2017-07-21 19:51 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Ricardo Wurmus, 25772

Ludovic Courtès (2017-07-20 15:31 +0200) wrote:

> Hello!
>
> Alex Kost <alezost@gmail.com> skribis:
[...]
>> So I would rather modify 'canonicalize-profile' procedure in that
>> module.  I think it will be a general solution for --profile option.
>
> Indeed.  I pushed something along these lines as
> edbe07cd67d6050d94fe8ac1af15ab15e857b61d, and a related fix as
> 561f4e450078a06c707d3dcda2cf0e7d6eb5ebae.
>
> Thanks!

Thank you!  BTW regarding "trailing slash" problem, there is a similar
issue in defining patch names ('%patch-path' variable in (gnu packages)
module).  I described it here:

  https://github.com/alezost/guix.el/issues/4#issuecomment-315888298

And here is a full report.  In short, if you use Guix from a git
checkout and use it with a trailing slash, Guix will not find patches!
You can reproduce it like this ("$HOME/devel/guix/" is my guix
checkout):

--8<---------------cut here---------------start------------->8---
$ GUILE_LOAD_PATH="$HOME/devel/guix/" GUILE_LOAD_COMPILED_PATH="$HOME/devel/guix/" guile
GNU Guile 2.2.2
Copyright (C) 1995-2017 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> ,use(gnu packages)
scheme@(guile-user)> (search-patch "acl-hurd-path-max.patch")
ERROR: Throw to key `srfi-34' with args `(#<condition &message [message: "acl-hurd-path-max.patch: patch not found"] 1a32b40>)'.

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]>
--8<---------------cut here---------------end--------------->8---

The above works as expected if the guix directory is specified without a
trailing slash.

TBH I think this is a Guile problem: such issues wouldn't appear at all,
if there was a general function to work with file names (analogous to
'expand-file-name' in Emacs, for example).  But since we have to use
'string-append' for file names, we have to deal with trailing slashes
all the time.

After writing this, I realized that it should probably have been
reported as a separate bug :-)

-- 
Alex

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

end of thread, other threads:[~2017-07-21 19:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20170217100054.25464-1-rekado@elephly.net>
     [not found] ` <8737fctpc4.fsf@elephly.net>
     [not found]   ` <87d1ee2y8p.fsf@gmail.com>
2017-07-20 13:31     ` bug#25762: bug#25772: [PATCH] guix package: Remove trailing slash from profile path Ludovic Courtès
2017-07-20 13:31       ` Ludovic Courtès
2017-07-21 19:51       ` [bug#25772] " Alex Kost

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.