GNU bug report logs - #66801
[PATCH] mix-build-system: draft 1

Previous Next

Package: guix-patches;

Reported by: Pierre-Henry Fröhring <phfrohring <at> deeplinks.com>

Date: Sat, 28 Oct 2023 20:21:02 UTC

Severity: normal

Tags: patch

Done: Liliana Marie Prikler <liliana.prikler <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pierre-Henry Fröhring <phfrohring <at> deeplinks.com>
To: 66801 <at> debbugs.gnu.org
Cc: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: [bug#66801] ['PATCH v2' 01/14] build-system: Add mix-build-system.
Date: Tue, 14 Nov 2023 11:37:10 +0100
[Message part 1 (text/plain, inline)]
> > +(define-module (guix build-system mix)
> > +  #:use-module (gnu packages base)
> > +  #:use-module (gnu packages elixir)
> > +  #:use-module (gnu packages elixir-xyz)
> > +  #:use-module (gnu packages erlang)
> You probably want to resolve those imports rather than use-modules
> them.

You mean something like this?
#+begin_src scheme
(define-module (guix build-system mix)
  #:use-module ((gnu packages base) #:select (glibc
make-glibc-utf8-locales))
  #:use-module ((gnu packages elixir) #:select (elixir elixir-hex))
  #:use-module ((gnu packages erlang) #:select (rebar3))
#+end_src

I have moved `elixir-hex' to elixir.scm to avoid a circular dependency.


> > +(define (input=? input1 input2)
> > +  "Tell whether inputs INPUT1 and INPUT2 are equal."
> > +  (define pkg1 (match input1 ((_ pkg) pkg)))
> > +  (define pkg2 (match input2 ((_ pkg) pkg)))
> > +  (string=? (package-name pkg1) (package-name pkg2)))
> Again, checking for label equivalence is a bad idea.

OK, after reading a bit more about Guile, I understand that `equal?'
is what should be used here, right? The intent is to remove duplicated
inputs in the code below:

#+begin_src scheme
(define all-propagated-inputs
    ((compose
      (cut delete-duplicates <> equal?) ;<-- Here
      (cut filter erlang-or-elixir-input? <>)
      (cut append-map package-transitive-propagated-inputs <>)
      (cut map cadr <>))
     (append inputs native-inputs)))
#+end_src


> > +(define (elixir-input? X.Y input)
> > +  "Determines if the given INPUT is an Elixir input."
> > +  (match input
> > +    ((label . path)
> > +     ;; XXX: The second condition may be enough.
> > +     (and (elixir-name? label)
> > +          (directory-exists? (path->elixir-lib path X.Y))))))
> Ahem, search-path-as-list.
> Also, leaking the version is kinda bad, API-wise.

Does this mean that build artifacts should be installed under
`$out/lib/elixir/$libname` instead of `$out/lib/elixir/X.Y/$libname`?


Cheers
[Message part 2 (text/html, inline)]

This bug report was last modified 1 year and 249 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.