all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Federico Beffa <beffa@ieee.org>
Cc: Guix-devel <guix-devel@gnu.org>,
	ericbavier@openmailbox.org,
	Myles English <mylesenglish@gmail.com>
Subject: Re: [PATCH 1/2] build: Generalize 'package-with-explicit-python'.
Date: Fri, 10 Feb 2017 17:18:19 +0100	[thread overview]
Message-ID: <87shnm9fzo.fsf@gnu.org> (raw)
In-Reply-To: <CAKrPhPMcc3ub4OTwNnvjfTsLTPS7Zn56CXcW0rwuEKXHvoo4jg@mail.gmail.com> (Federico Beffa's message of "Wed, 8 Feb 2017 19:17:37 +0100")

Hello!

Federico Beffa <beffa@ieee.org> skribis:

> +(define* (package-with-explicit-compiler compiler bs-name
> +                                         old-prefix new-prefix
> +                                         #:key variant-property)
> +  "Return a procedure of one argument, P.  The procedure creates a package
> +with the same fields as P, which is assumed a build-system named BS-NAME, such
> +that it is compiled with COMPILER instead.  The inputs are changed recursively
> +accordingly.  If the name of P starts with OLD-PREFIX, this is replaced by
> +NEW-PREFIX; otherwise, NEW-PREFIX is prepended to the name.
> +
> +When VARIANT-PROPERTY is present, it is used as a key to search for
> +pre-defined variants of this transformation recorded in the 'properties' field
> +of packages.  The property value must be the promise of a package.  This is a
> +convenient way for package writers to force the transformation to use
> +pre-defined variants."

Great idea, along with --with-compiler.

However, I think this:

> +  (define compiler-keyword
> +    (case bs-name
> +      ((haskell python emacs perl r ruby) (symbol->keyword bs-name))
> +      (else
> +       (leave (_ "Operation not supported by the build system: ~A~%") bs-name))))

and this:

> +         ;; Otherwise build the new package object graph.
> +         ((eq? (build-system-name (package-build-system p)) bs-name)

are kind of hacks (the build system name is supposed to be used for
debugging purposes only, and not for identification) and not very
extensible (we’d have to extend the ‘case’ above for every new build
system.)

What we’re trying to achieve here is similar to
‘package-input-rewriting’ and --with-input, except that it should
additionally take into account implicit inputs.

For that reason I’d suggest a new ‘package-input-rewriting*’ that would:

  1. Call ‘package-input-rewriting’;

  2. Change the ‘build-system’ field of the result and inject a “proxy”
     build system in order to be able to change the inputs of the bag
     (which includes the package’s implicit inputs).

Then we could change --with-input to use this new procedure, and
--with-input=r=my-r would DTRT.

WDYT?

Thanks!
Ludo’.

  parent reply	other threads:[~2017-02-10 16:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-08 18:17 [PATCH 1/2] build: Generalize 'package-with-explicit-python' Federico Beffa
2017-02-08 19:09 ` Ricardo Wurmus
2017-02-09  7:58   ` Federico Beffa
2017-02-09 10:24     ` Myles English
2017-02-10 16:18 ` Ludovic Courtès [this message]
2017-02-13  8:28   ` Federico Beffa

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=87shnm9fzo.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=beffa@ieee.org \
    --cc=ericbavier@openmailbox.org \
    --cc=guix-devel@gnu.org \
    --cc=mylesenglish@gmail.com \
    /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.