all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Xinglu Chen <public@yoctocell.xyz>
To: zimoun <zimon.toutoune@gmail.com>, 51655@debbugs.gnu.org
Cc: Lars-Dominik Braun <lars@6xq.net>
Subject: [bug#51655] [PATCH] build-system: haskell: Add ‘package-with-explicit-haskell’ procedure.
Date: Sun, 19 Dec 2021 09:47:22 +0100	[thread overview]
Message-ID: <878rwhouat.fsf@disroot.org> (raw)
In-Reply-To: <86bl2lbgvd.fsf@gmail.com>

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

Hi,

On Mo, Nov 15 2021, zimoun wrote:

> Hi,
>
> On Sun, 07 Nov 2021 at 11:55, Xinglu Chen <public@yoctocell.xyz> wrote:
>> * guix/packages.scm (package-with-explicit-compiler): New procedure;
>> factorized from ‘package-with-explicit-python’.
>> * guix/build-system/python.scm (package-with-explicit-python): Use
>> ‘package-with-explicit-compiler’.
>> * guix/build-system/haskell.scm (package-with-explicit-haskell): New procedure.
>> * doc/guix.texi (Defining Package Variants): Document it.
>> ---
>>  doc/guix.texi                 | 37 ++++++++++++++++++
>>  guix/build-system/haskell.scm |  8 ++++
>>  guix/build-system/python.scm  | 71 +++++++----------------------------
>>  guix/packages.scm             | 55 +++++++++++++++++++++++++++
>>  4 files changed, 113 insertions(+), 58 deletions(-)
>
> Neat refactoring! :-)  It is something discussing several times and I do
> not know if ’package-with-explicit-ocaml’ could not be added too.  The
> issue is that it depends on more than only one element for “compiling”:
> ocaml, findlib and dune.

Ah, yes, I forgot about OCaml.  :-)

> On the other hand, guix/build-system/gnu.scm contains
> ’package-with-explicit-inputs*’ which is more or less the same idea.
> And ’transform-package-toolchain’ is another instance.

I didn’t about ‘package-with-explicit-inputs*’, but I will look into it. 

> This ’package-with-explicit-{ocaml,python}’ pre-dates the
> transformations and deep rewriting.
>
> Therefore, maybe refactor could revisit the complete story.
>
> Well, I had headaches last time I gave a look at transformations.  And I
> do not know if it is possible to have a generic transformation for
> rewriting implicit inputs of all build systems.  That’s something that
> could be nice to nice: ’package-with-explicit-python’ based on a
> “generic” ’package-with-explicit-compiler’ (compiler or toolchain
> though) and provides ’package-with-explicit-*’ for all build systems
> (ocaml, ghc, emacs, guile, etc.).

Yeah, that would be nice to have.  I currently have some other things I
would like to focus on, but I should look more into package
transformations, and hopefully come up with a good solution to this.
:-)

>> +@lisp
>> +(use-modules (guix build-system haskell))
>> +
>> +(define (default-haskell-8.8)
>> +  ;; Lazily resolve the binding to avoid a circular dependency.
>> +  (let ((haskell (resolve-interface '(gnu packages haskell))))
>> +    (module-ref haskell 'ghc-8.8)))
>> +
>> +(define package-with-haskell-8.8
>> +  (package-with-explicit-haskell (delay (default-haskell-8.8))
>> +                                 "ghc-" "ghc-8.8-"
>> +                                 #:variant-property 'ghc-8.8-variant))
>> +@end lisp
>
> As Lars said, an instance is missing, IMHO.

Not sure what you are referring to here, what exactly do you mean with
“instance”?

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

  reply	other threads:[~2021-12-19  8:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-07 10:55 [bug#51655] [PATCH] build-system: haskell: Add ‘package-with-explicit-haskell’ procedure Xinglu Chen
2021-11-12 10:34 ` Lars-Dominik Braun
2021-11-15 15:03 ` zimoun
2021-12-19  8:47   ` Xinglu Chen [this message]
2021-12-19  9:23     ` zimoun

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=878rwhouat.fsf@disroot.org \
    --to=public@yoctocell.xyz \
    --cc=51655@debbugs.gnu.org \
    --cc=lars@6xq.net \
    --cc=zimon.toutoune@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.