From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id mI/0EALpVGU2nAAAauVa8A:P1 (envelope-from ) for ; Wed, 15 Nov 2023 16:51:30 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id mI/0EALpVGU2nAAAauVa8A (envelope-from ) for ; Wed, 15 Nov 2023 16:51:30 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0877123107 for ; Wed, 15 Nov 2023 16:51:30 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=deeplinks-com.20230601.gappssmtp.com header.s=20230601 header.b=wSY+nfEB; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1700063490; a=rsa-sha256; cv=none; b=pKVb3f6Ok9IwJE7ipLZS+/Oh9CMB1R4T7o4pGCz5vgTtwlELlk/9sd8h6PHd6d5MkgV/5W mQr1o2X8AtV38F4a9j2Ad8eFAyC4brg7lzorLwzCOhbNe34IiEEaIgYAUYTt9IWSpqBUHi lX1V6tWk8NphpREd6K+bZmGFIR+fbkaBzLcJR+gKETLyvJsEQJL3WEY4s7q+rhyoSZXL5g 4cm/HY93bS5AxrepY2UtOhwAZ2GUEsJDCpAdyYWtsgBP1Z+PuTfr09vob1rByuxWu41Oqn ap+zJVbN/tikdCsTwJHDDiABC9+omlCum+GAwXKupp/uCEiiGjbm88doyyvn1w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=deeplinks-com.20230601.gappssmtp.com header.s=20230601 header.b=wSY+nfEB; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1700063490; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=OwyFVX9dClUci6pPwslrVgZSlz1DvnH/falfg/kJoT8=; b=ezQdJprAJW2k0upAkOIzAU9B/Xw9G3Hm254Ja1F26WpA4j1t8qyg59sqT0vMJBLqUQgsvE /wFUXyAeHx34HOV2so+KNZkclGdqPfwB84+eI+ri2681Vnc28/FQh3/RcMdn3qAZrp0cZP 5sKOYSKGIYoK+K2kESv+rv6dsYUakfCSVm2dfcmF+jy4kFlr0SZXu3WKUhQXhJn4CzsvNN okou8CSoD5oG+NEDVwvdZdTAB60hZGxAA5Pnw1+e1wJN1wA4Sx9H9M9Q69GcUm4g6GGoBA XxTNkvpuiw3WXoQgtphu4G6QLqh78gb5xpbJv57oQP65pmVrYcHbC7D+icN2VA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3IAV-0000eV-UA; Wed, 15 Nov 2023 10:51:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r3IAS-0000ZX-14 for guix-patches@gnu.org; Wed, 15 Nov 2023 10:51:06 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r3IAR-00046g-CW for guix-patches@gnu.org; Wed, 15 Nov 2023 10:51:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r3IAQ-0000yP-4p for guix-patches@gnu.org; Wed, 15 Nov 2023 10:51:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#66801] Fwd: ['PATCH v2' 01/14] build-system: Add mix-build-system. Resent-From: Pierre-Henry =?UTF-8?Q?Fr=C3=B6hring?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 15 Nov 2023 15:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66801 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66801@debbugs.gnu.org Received: via spool by 66801-submit@debbugs.gnu.org id=B66801.17000634583727 (code B ref 66801); Wed, 15 Nov 2023 15:51:02 +0000 Received: (at 66801) by debbugs.gnu.org; 15 Nov 2023 15:50:58 +0000 Received: from localhost ([127.0.0.1]:52949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3IAL-0000y2-Ca for submit@debbugs.gnu.org; Wed, 15 Nov 2023 10:50:57 -0500 Received: from mail-yb1-xb34.google.com ([2607:f8b0:4864:20::b34]:50236) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3IAH-0000xm-OK for 66801@debbugs.gnu.org; Wed, 15 Nov 2023 10:50:55 -0500 Received: by mail-yb1-xb34.google.com with SMTP id 3f1490d57ef6-daf2eda7efaso5447201276.0 for <66801@debbugs.gnu.org>; Wed, 15 Nov 2023 07:50:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=deeplinks-com.20230601.gappssmtp.com; s=20230601; t=1700063448; x=1700668248; darn=debbugs.gnu.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=OwyFVX9dClUci6pPwslrVgZSlz1DvnH/falfg/kJoT8=; b=wSY+nfEB3ys2c1REj6IcrCDnjAygSebWO0fifafGgtwUr0uZRjUuKj8rZxAfbZxGcX +uF4fAKfBKzBv4Ky76CBRJkWugmspW5Cfhfk3fWPtkrEgK2/g3gVaVAPIbXldLSICA/W Al6Q9x7ozVGBLaTl4XdSYJ2e59avReTMhdqYDHYJWWSmGFWMeB9dDsbekt2DW230J9DK BLJWS4llu4i0WKUwpTI3MkfFQNYW7AHQwMyrXBCbz84DHKUm0nn6GvAjlb64UPG4p4o8 nPBx2ISz3bzC9sD+Wit9UM467KJoYq8n818TyC8GXDGyKlFQqgVASkdIEXTIxXSrT60P w3fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700063448; x=1700668248; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OwyFVX9dClUci6pPwslrVgZSlz1DvnH/falfg/kJoT8=; b=H3LV9wrNVYpyvbraCGAnj8aNwAea3K6sJQZFgEkynG1BKOTYrK93rjJQaAExXWtfex aPpLUJ3z6YKpeervQaXKaDVUWaim2+Jx5GF+1zH1Otp4foPLU/E/2lQJcyoZaUPhlDCS HjKk5Yya73rwkrV0n+7U3LCGw2b/CtKgRQC5holR50O+nAmmuBzBadXe/VRC3JfkhCyw R19valxJA6xgAWDkOSrRi9FSkERl1XZU1WwebXHClxMIMvbBcrO8509K+Ofl63R4xL+G Q1R1ViPUNOZvi1oAf9Qz2z4NAcRR+f3xAe8bXXUTykzF7/HZjE+nUpSra+VKI8LGtHTv Sn8w== X-Gm-Message-State: AOJu0YwlmGtrlYJ15SqAdz59hWPeYciHqf4yLnSdMgCemtP+1jQrj0RQ TsoOeuItvcKTV3c99E3oMUQ0IWTaTcI4krIQ9zxS4iILOOs5V9YM X-Google-Smtp-Source: AGHT+IE6iHciMOm8hBm/mMapoSRSd0B9dxNpiQlvRkFLM+AqznQb+2xS2JCF805lLNieIMGrbX22Rk7r17MtSv6ikKU= X-Received: by 2002:a25:ac26:0:b0:d9b:f737:2d2f with SMTP id w38-20020a25ac26000000b00d9bf7372d2fmr13269898ybi.45.1700052063005; Wed, 15 Nov 2023 04:41:03 -0800 (PST) MIME-Version: 1.0 References: <26ef9c0f4bf2ff942ba2b42e1fadeb6174bbaa6a.1699906775.git.phfrohring@deeplinks.com> In-Reply-To: From: Pierre-Henry =?UTF-8?Q?Fr=C3=B6hring?= Date: Wed, 15 Nov 2023 13:40:51 +0100 Message-ID: Content-Type: multipart/alternative; boundary="00000000000050c427060a3037f9" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 0877123107 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -5.09 X-Spam-Score: -5.09 X-TUID: GhXR0jaabNZL --00000000000050c427060a3037f9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > No. Look at all the other build systems. None of them use submodules of (gnu > packages), for a good reason. Ok, I see. It would introduce circular dependencies. By "resolve," you mean something like: ~(resolve-interface '(gnu packages yyy))~. So, in our case it means: #+begin_src scheme (define (default-glibc-utf8-locales) (let* ((base (resolve-interface '(gnu packages base))) (glibc (module-ref base 'glibc)) (make-glibc-utf8-locales (module-ref base 'make-glibc-utf8-locales))) (make-glibc-utf8-locales glibc #:locales (list "en_US")))) (define (default-elixir-hex) (let ((elixir (resolve-interface '(gnu packages elixir)))) (module-ref elixir 'elixir-hex))) (define (default-rebar3) (let ((erlang (resolve-interface '(gnu packages erlang)))) (module-ref erlang 'rebar3))) #+end_src Then: #+begin_src scheme (define* (lower name #:key (elixir (default-elixir)) (elixir-hex (default-elixir-hex)) (glibc-utf8-locales (default-glibc-utf8-locales)) (rebar3 (default-rebar3)) =E2=80=A6 #:allow-other-keys #:rest arguments) =E2=80=A6) #+end_src Is this correct? > Not necessarily, but you want a different way of building $out/lib/elixir/X.Y/ > that doesn't leak through the function signature. Following ~python-build-system.scm~, it means something like: #+begin_src scheme (define (elixir-version elixir) (let* ((version (last (string-split elixir #\-))) (components (string-split version #\.)) (major+minor (take components 2))) (string-join major+minor "."))) (define (install-dir inputs outputs) "Return the path of the current output's Elixir library." (let ((out (assoc-ref outputs "out")) (elixir (assoc-ref inputs "elixir"))) (string-append out "/lib/elixir/" (elixir-version elixir)))) #+end_src Is this correct? > Btw. I think that you're resolving transitive inputs twice; once on the build > system code and once by fattening the outputs. You probably only need either > of those, not both. Ah. Propagated inputs are propagated. Who would have thought? So, this is not necessary: #+begin_src scheme (define* (lower =E2=80=A6) =E2=80=A6 (define all-propagated-inputs ((compose (cut delete-duplicates <> equal?) (cut filter erlang-or-elixir-input? <>) (cut append-map package-transitive-propagated-inputs <>) (cut map cadr <>)) (append inputs native-inputs))) (define build-inputs `(=E2=80=A6 ,@all-propagated-inputs ,@inputs ,@native-inputs)) (bag =E2=80=A6 (build-inputs build-inputs) =E2=80=A6)) #+end_src I've just removed ~all-propagated-inputs~ and all packages build just fine. Is this what you meant? > Yep, that would work. Note that delete-duplicates is O(n^2), though. We have > a little bit of code where it's done in (I assume) O(n*log(n)) with vhashes. If ~all-propagated-inputs~ is removed, then the discussion of this comment is closed. --00000000000050c427060a3037f9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> No.=C2=A0= Look at all the other build systems.=C2=A0 None of them use submodules of = (gnu
> packages), for a good reason.

Ok, I see. It would intro= duce circular dependencies. By "resolve," you
mean something l= ike: ~(resolve-interface '(gnu packages yyy))~. So, in
our case it m= eans:
#+begin_src scheme
(define (default-gl= ibc-utf8-locales)
=C2=A0 (let* ((base (resolve-interface '(gnu packa= ges base)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(glibc (module-ref base &#= 39;glibc))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(make-glibc-utf8-locales (m= odule-ref base 'make-glibc-utf8-locales)))
=C2=A0 =C2=A0 (make-glibc= -utf8-locales glibc #:locales (list "en_US"))))

(define (d= efault-elixir-hex)
=C2=A0 (let ((elixir (resolve-interface '(gnu pac= kages elixir))))
=C2=A0 =C2=A0 (module-ref elixir 'elixir-hex)))
=
(define (default-rebar3)
=C2=A0 (let ((erlang (resolve-interface = 9;(gnu packages erlang))))
=C2=A0 =C2=A0 (module-ref erlang 'rebar3)= ))

#+end_src

Then:
#+begin_src scheme
(define* (lower name
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 #:key
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 (elixir (default-elixir))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (elixir-hex (default-elixir-hex))
=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (glibc-utf8-locales (default-glibc-utf8= -locales))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (reba= r3 (default-rebar3))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =E2=80=A6
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= #:allow-other-keys #:rest arguments)
=C2=A0 =E2=80=A6)

#+end_= src

Is this correct?


> Not necessarily, but you want a= different way of building $out/lib/elixir/X.Y/
> that doesn't le= ak through the function signature.

Following ~python-build-system.sc= m~, it means something like:
#+begin_src scheme=
(define (elixir-version elixir)
=C2=A0 (let* ((version =C2=A0 =C2=A0= (last (string-split elixir #\-)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(co= mponents =C2=A0(string-split version #\.))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(major+minor (take components 2)))
=C2=A0 =C2=A0 (string-join majo= r+minor ".")))

(define (install-dir inputs outputs)
=C2= =A0 "Return the path of the current output's Elixir library."=
=C2=A0 (let ((out (assoc-ref outputs "out"))
=C2=A0 =C2=A0= =C2=A0 =C2=A0 (elixir (assoc-ref inputs "elixir")))
=C2=A0 = =C2=A0 (string-append out "/lib/elixir/" (elixir-version elixir))= ))

#+end_src

Is this correct?


> Btw. I think= that you're resolving transitive inputs twice; once on the build
&g= t; system code and once by fattening the outputs.=C2=A0 You probably only n= eed either
> of those, not both.

Ah. Propagated inputs are pro= pagated. Who would have thought? So, this is not necessary:
#+begin_src = scheme
(define* (lower =E2=80=A6)
=C2=A0 =E2= =80=A6
=C2=A0 (define all-propagated-inputs
=C2=A0 =C2=A0 ((compose=C2=A0 =C2=A0 =C2=A0 (cut delete-duplicates <> equal?)
=C2=A0 = =C2=A0 =C2=A0 (cut filter erlang-or-elixir-input? <>)
=C2=A0 =C2= =A0 =C2=A0 (cut append-map package-transitive-propagated-inputs <>)=C2=A0 =C2=A0 =C2=A0 (cut map cadr <>))
=C2=A0 =C2=A0 =C2=A0(app= end inputs native-inputs)))

=C2=A0 (define build-inputs
=C2=A0 = =C2=A0 `(=E2=80=A6
=C2=A0 =C2=A0 =C2=A0 ,@all-propagated-inputs
=C2= =A0 =C2=A0 =C2=A0 ,@inputs
=C2=A0 =C2=A0 =C2=A0 ,@native-inputs))
=C2=A0 (bag =E2=80=A6
=C2=A0 =C2=A0 =C2=A0 =C2=A0(build-inputs build-in= puts)
=C2=A0 =C2=A0 =C2=A0 =C2=A0=E2=80=A6))

#+end_src
I= 9;ve just removed ~all-propagated-inputs~ and all packages build just fine.=

Is this what you meant?


> Yep, that would work.=C2=A0= Note that delete-duplicates is O(n^2), though.=C2=A0 We have
> a lit= tle bit of code where it's done in (I assume) O(n*log(n)) with vhashes.=

If ~all-propagated-inputs~ is removed, then the discussion of this = comment is
closed.

--00000000000050c427060a3037f9--