all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nigko Yerden <nigko.yerden@gmail.com>
To: "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de>
Cc: Attila Lendvai <attila@lendvai.name>, guix-devel@gnu.org
Subject: Re: Cookbook recipe from "The Repository as a Channel" section does not work for Guix with properly configured GUILE_LOAD_PATH
Date: Thu, 22 Aug 2024 14:53:57 +0500	[thread overview]
Message-ID: <26f24821-13e6-4afe-82a4-57cf60bf2064@gmail.com> (raw)
In-Reply-To: <87bk1l88sx.fsf@pelzflorian.de>

Hello Florian,

I am sure you have nothing to apologize for. I have been
thinking about your suggestion to submit `absolute-dirname' patch. In the
Guix manual at the end of the section 6.7 Creating a channel [1] there is the
following statement about Guix policy on changing API, not to mention ABI:

"We, Guix developers, never change APIs gratuitously, but we do not
commit to freezing APIs either. When you maintain package definitions
outside Guix, we consider that the compatibility burden is on you."

So it is okay to change the behavior of some procedures if it will improve
Guix. But does changing the 'current-source-directory' to follow symlinks
improve Guix? This change would adjust Guix in accordance with the
documentation... What? Sounds very wrong. Should be the other way round,
shouldn't it? Maybe this change would make Guix API more powerful and
convenient? I assume that generally there is a practical necessity in
determining current source directory both with and without following
symlinks, 50/50. If I need to follow symlinks I still may use
'current-source-directory' not following symlinks this way:

(dirname
  (canonicalize-path
   (string-append (current-source-directory) (current-filename))))

But what should I do if I need not to follow symlinks and
'current-source-directory' follows symlinks. There is no simple way.


pelzflorian (Florian Pelz) wrote:
> Would you send a patch doing implementing another option to
> guix-patches?  However, I would ask of you to send a patch to
> guix-patches first and not to guile, since guile takes longer and
> guix-patches would in my hope get others’ opinions involved.
Yes, I could. I wonder which alternative should I implement? One,
discussed earlier, adds an intermediate directory to the channel
relative path in the repository. This is simple, but somewhat
limited solution. Also changing directory structure may require
additional (and undesirable) modifications to other files in guile
repository.

Thanks to Attila there is another variant [2] which leaves the
directory structure intact:

(define checkout-dir
   ;; search %load-path for module filename,
   ;; follow symlink and return checkout directory
   (string-append (dirname (canonicalize-path
                            (search-path %load-path
                                         (module-filename (current-module)))))
                  "/../.."))

(define vcs-file?
   ;; Return true if the given file is under version control.
   (or (git-predicate checkout-dir)
       (const #t)))

(define-public guile
   (package
    ...
    (source (local-file checkout-dir "guile-checkout"
                        #:recursive? #t
                        #:select? vcs-file?))

What do you think?


Regards,
Nigko

[1] https://guix.gnu.org/en/manual/devel/en/html_node/Creating-a-Channel.html
[2] https://gitlab.com/anigko/test-channel/-/blob/ef07ce6904c16533f0fc21fda74216ce0a38bafd/.guix/modules/test-repo-package.scm
('channel-dir' is a macro instead of a variable, but I don't see any
real benefits in using macro here)


  reply	other threads:[~2024-08-22  9:54 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-13 12:45 Cookbook recipe from "The Repository as a Channel" section does not work for Guix with properly configured GUILE_LOAD_PATH Nigko Yerden
2024-08-13 14:38 ` pelzflorian (Florian Pelz)
2024-08-13 15:06   ` Nigko Yerden
2024-08-13 17:25     ` pelzflorian (Florian Pelz)
2024-08-13 17:49       ` Nigko Yerden
2024-08-14 15:35         ` pelzflorian (Florian Pelz)
2024-08-14 16:40           ` pelzflorian (Florian Pelz)
2024-08-14 19:29           ` pelzflorian (Florian Pelz)
2024-08-15  4:11             ` Nigko Yerden
2024-08-18 21:33               ` pelzflorian (Florian Pelz)
2024-08-19  7:43                 ` Nigko Yerden
2024-08-19 19:28                   ` pelzflorian (Florian Pelz)
2024-08-20  7:18                     ` Nigko Yerden
2024-08-20 16:49                       ` pelzflorian (Florian Pelz)
2024-08-22  4:45                         ` pelzflorian (Florian Pelz)
2024-08-22  9:53                           ` Nigko Yerden [this message]
2024-08-22 13:22                             ` Nigko Yerden
2024-08-22 16:00                             ` pelzflorian (Florian Pelz)
2024-08-23  5:07                               ` Nigko Yerden
2024-08-23 15:47                                 ` pelzflorian (Florian Pelz)
2024-08-23 16:25                                   ` pelzflorian (Florian Pelz)
2024-08-24 14:47                                   ` Nigko Yerden
2024-08-26  8:50                                     ` pelzflorian (Florian Pelz)
2024-08-28 12:36                                       ` Nigko Yerden
2024-08-28 16:40                                         ` pelzflorian (Florian Pelz)
2024-08-29  6:17                                           ` Nigko Yerden
2024-08-19  9:30                 ` Nigko Yerden
2024-08-19 16:17                 ` Nigko Yerden
2024-08-14 14:00 ` Attila Lendvai
2024-08-15 16:34   ` Nigko Yerden

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=26f24821-13e6-4afe-82a4-57cf60bf2064@gmail.com \
    --to=nigko.yerden@gmail.com \
    --cc=attila@lendvai.name \
    --cc=guix-devel@gnu.org \
    --cc=pelzflorian@pelzflorian.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.