all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chris Marusich <cmmarusich@gmail.com>
To: ison <ison@airmail.cc>, 白い熊 <help-guix_gnu.org@sumou.com>
Cc: help-guix@gnu.org
Subject: Re: Building and installing packages with modifications
Date: Tue, 26 Feb 2019 01:26:19 -0800	[thread overview]
Message-ID: <87sgwa99z8.fsf@gmail.com> (raw)
In-Reply-To: <20190224184620.w2xqvaw5byjk7bnb@cf0> (ison's message of "Sun, 24 Feb 2019 11:46:20 -0700")

[-- Attachment #1: Type: text/plain, Size: 5887 bytes --]

Hi,

ison <ison@airmail.cc> writes:

> Since this hasn't received any replies I'll give my solution, although I
> apologize in advance if this isn't the "best" way to do it.

No need to apologize!  There are many ways to solve problems, and often
I find it very helpful to see the different ways others have solved the
same problem.  Thank you for taking the time to share your example!

> (package
>   (inherit curl)
>   (substitute-keyword-arguments (package-arguments curl)
>     ((#:tests? #f #f)
>       #f)))

That's a great example!  Unfortunately, I'm not sure it will work out of
the box.  I think you would need to write it like this (note the
"arguments" field):

  (package
    (inherit curl)
    (arguments
      (substitute-keyword-arguments (package-arguments curl)
      ((#:tests? #f #f)
        #f))))

Furthermore, although that will successfully disable tests for the curl
package because it lacks a #:tests? package argument, I don't think it
will work in general.  For example, suppose you try the same trick for
the emacs-dash package, which has the following arguments:

--8<---------------cut here---------------start------------->8---
scheme@(guix-user)> ,pp (package-arguments emacs-dash)
$12 = (#:tests? #t #:test-command '("./run-tests.sh"))
scheme@(guix-user)> (define emacs-dash-no-tests (package (inherit emacs-dash) (arguments (substitute-keyword-arguments (package-arguments emacs-dash) ((#:tests? #f #f) #f)))))
scheme@(guix-user)> ,pp (package-arguments emacs-dash-no-tests)
$13 = (#:tests? #t #:test-command '("./run-tests.sh"))
scheme@(guix-user)> 
--8<---------------cut here---------------end--------------->8---

The arguments are unchanged.  I think this happens because the
substitute-keyword-arguments form you've used looks specifically for a
#:tests? keyword argument with value #f (the Guile manual explains that
the #f pattern will match only #f, in (guile) Pattern Matching), so it
doesn't match in the case where #:tests? is given the value #t
explicitly.  This results in no substitution.

My understanding is that you intended to disable the tests.  I think you
can still accomplish that if you change the (#:tests? #f #f) part to
(#:tests? _ #f), like this:

  (package
    (inherit curl)
    (arguments
      (substitute-keyword-arguments (package-arguments curl)
      ((#:tests? _ #f)
        #f))))

Here, the underscore in (#:tests? _ #f) is a variable that will be bound
to the existing value of #:tests? (and then ignored).  This _will_ match
#t, so the substitution will occur even when #:tests? was originally set
to #t.

> [...] if you save that to a file called my-curl.scm you could install
> it to your guix profile with "guix package -f my-curl.scm"

Maybe you already know about this, bu one can also use GUIX_PACKAGE_PATH
or set up a local channel (i.e., a channel for which the url is simply a
path to a local Git repository, such as
"/home/marusich/my-guix-channel").  I've found that putting custom
package definitions in a single place makes it much easier to manage,
especially because then I can install any of the custom packages in a
manifest file via "guix package -m my-manifest.scm".

Wayne <waynedpj@ingiro.xyz> writes:

>   my follow up question is whether there is (or a plan for) any
> support for sharing these derived custom build binaries with other
> users

Yes!  For starters, see (guix) Channels in the manual.  Here's an online
copy:

https://www.gnu.org/software/guix/manual/en/html_node/Channels.html

Basically, channels provide an easy way for people to share custom
package definitions - but not binaries.  It's very nice!  Here's a blog
post showcasing them in more detail:

https://www.gnu.org/software/guix/blog/2018/multi-dimensional-transactions-and-rollbacks-oh-my/

>   thus basically are there any plans for sharing custom package
> definition binaries, perhaps even peer-to-peer?  i thought that i had
> read something about this on this list but cannot find it currently in
> the archives.

The task of sharing package definitions is orthogonal to the task of
sharing pre-built binaries (called "substitutes" in the Guix world).
Sharing package definitions is easy to do now, in a decentralized
fashion, thanks to channels and the distributed nature of Git.

Sharing substitutes is also possible, but less practical.  To start
with, you can manually ship around binaries with "guix copy" or "guix
archive".  And anyone (with root access) can publish substitutes on a
network for others to use with the "--substitute-urls" build option
simply by invoking "guix publish".  You can even set up a build farm
like the one running at berlin.guixsd.org if you want.  For details on
how to do that, see the Guix maintenance repository here:

https://savannah.gnu.org/git/?group=guix

However, getting people to trust your Guix server's key, providing the
substitutes with high availability, and continuously building all the
packages is a non-trivial task.  Ultimately, it still feels pretty
centralized.  In the future, we hope people will be interested in
contributing to and using a more distributed solution.  For example,
integration with something like IPFS or Gnunet would be great!  But we
need help from you and others to make it a reality.

For more information, you can check the email lists.  I found a few
likely results via the following searches:

https://lists.gnu.org/archive/cgi-bin/namazu.cgi?query=ipfs&submit=Search%21&idxname=guix-devel&max=20&result=normal&sort=score

https://lists.gnu.org/archive/cgi-bin/namazu.cgi?query=gnunet+publish&submit=Search%21&idxname=guix-devel&max=20&result=normal&sort=score

If you're interested in helping out or know people who might be
interested, please let us know.

Happy hacking,

-- 
Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  parent reply	other threads:[~2019-02-26  9:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-16 15:12 Building and installing packages with modifications 白い熊
2019-02-24 18:46 ` ison
2019-02-24 19:06   ` 白い熊@相撲道
2019-02-24 23:17     ` ison
2019-02-26  9:34       ` Chris Marusich
2019-02-24 19:30   ` Wayne
2019-02-26  9:26   ` Chris Marusich [this message]
2019-03-12  3:37     ` Wayne
2019-02-24 20:01 ` Gábor Boskovits

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=87sgwa99z8.fsf@gmail.com \
    --to=cmmarusich@gmail.com \
    --cc=help-guix@gnu.org \
    --cc=help-guix_gnu.org@sumou.com \
    --cc=ison@airmail.cc \
    /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.