From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 sAmZB9wPVWU7IAAA9RJhRA:P1 (envelope-from ) for ; Wed, 15 Nov 2023 19:37:16 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id sAmZB9wPVWU7IAAA9RJhRA (envelope-from ) for ; Wed, 15 Nov 2023 19:37:16 +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 94A19633AA for ; Wed, 15 Nov 2023 19:37:15 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=EF+z5bn8; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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=1700073436; a=rsa-sha256; cv=none; b=F5er6SR9h2afGEX6NIjFWY8mGh2/BIaWk5K0eVP04hVfs8Cq7MnbdZcYcIhsq2vI4nI3sy m/095OZ952oIr/478Fg8a+Gedf0n2ZVzifOVhSuXQ6DyBVg2U1+F/q3X2Y9aG7m0dwsYlG Mz7Hm5X63rKPVxUuyGZb41P4Rq2OPEbNmlXKnRFJxcd/UZYF0lGBgkpvDhzOIZ55QLSbfQ EY8ynBKLMvEDQPQA+nKt7xXtWTjCLTfdLIiVKkZxlUvtuppan5qYOsCeT8ipKITKsLu/AC Z/IAL1mPIMSAAEREOIVq4P5RXC0TTXIM82kyak7RD5JkzQOccfxDnhJkcXPJTQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=EF+z5bn8; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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=1700073436; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: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=dMylZFY5B7hGDZLRzOaMtkBJxom9qeLm/RFMCJ7YlMw=; b=djWRlxuyDlaal2T9SwYKjTOdQcQtNpifi/r11ZwJRl0ihD08H4NJMmj5GZIHofkI8HnfEl OrY1aCFqFwcthFDjCVs69gZhl2N4qbUzl4TJ1tggR0uGr7qAYmFMCRXogHskWdHPr/blao GGWBFgyMbBUENY1DUofI46nBwa22DSpywfkGaFiUBF6s2YtghL/jY8TRS2+Kz+5guU9wLO 7rMWCq6Cr9DO8GboJb9qWWrbDCioNq625N2ykw9PjXDsQQUf/IgpV1U6avIu/mjAo7jNl6 /eixKEnty1sgJamvoqigEf0fZpYPFai4hQKXYZ/rpMlalbJPQzrmnpm+GEYJ9g== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3KlB-0001gk-C2; Wed, 15 Nov 2023 13:37:09 -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 1r3Kl6-0001Y8-1v for guix-patches@gnu.org; Wed, 15 Nov 2023 13:37:05 -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 1r3Kl5-00045q-Ph for guix-patches@gnu.org; Wed, 15 Nov 2023 13:37:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r3Kl4-0005e2-Ji for guix-patches@gnu.org; Wed, 15 Nov 2023 13:37:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#66801] ['PATCH v2' 01/14] build-system: Add mix-build-system. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 15 Nov 2023 18:37: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: Pierre-Henry =?UTF-8?Q?Fr=C3=B6hring?= Cc: 66801@debbugs.gnu.org Received: via spool by 66801-submit@debbugs.gnu.org id=B66801.170007338421650 (code B ref 66801); Wed, 15 Nov 2023 18:37:02 +0000 Received: (at 66801) by debbugs.gnu.org; 15 Nov 2023 18:36:24 +0000 Received: from localhost ([127.0.0.1]:53781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3KkS-0005d8-E2 for submit@debbugs.gnu.org; Wed, 15 Nov 2023 13:36:24 -0500 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:47330) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3KkP-0005ct-3l for 66801@debbugs.gnu.org; Wed, 15 Nov 2023 13:36:22 -0500 Received: by mail-wm1-x344.google.com with SMTP id 5b1f17b1804b1-407c3adef8eso61070055e9.2 for <66801@debbugs.gnu.org>; Wed, 15 Nov 2023 10:36:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700073376; x=1700678176; darn=debbugs.gnu.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=dMylZFY5B7hGDZLRzOaMtkBJxom9qeLm/RFMCJ7YlMw=; b=EF+z5bn8O9C5dh5EewqkppryxIdg43Kst4ohlUDj7SwuPpcT0MmfO0IYi45/J+DsKw ORn7RUqwvo0I2WtAlGl7CzFhL2/wb0LUc3CYNG+wUAaAEnonHG/xnvdhp7hp0YLmDBsr FNJX6D4Fct85kzKMCMD2cHJ8N+qOUb2jKwZOjD9JYHw1mxVlr8Yz8ZB694Utg5pqONKh Qq04yhIo4dK5+uRkNY0HFBitAh1187OIua5BFpnCxl/y391/rh7PwmBtf/fTIzVluEWi gyMy4fIZDknHsWdamWguTssutLLHNwbRW7g5yakPPOu7XvdoScJk0OHZlWVQv1GykJp4 rS6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700073376; x=1700678176; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=dMylZFY5B7hGDZLRzOaMtkBJxom9qeLm/RFMCJ7YlMw=; b=oAN22wDXgHC+A6ulmB2bx59mZWDlWUyxfL/Wm09sIphxMsxTr0TwucTwPuBzvVTI4D wSp/pCN1hbCtlAWOdosrRdU9ktX0G6Xm7yp9qN9NWWNXcgKobEWLyhSvzRz68lCs8Uef AQG3wy7ZEp+NLoQyi5+1+rS9hyw6p3LTXTHszINVSTGxb8eIrakouOP0ZgHiZbFnppHn oa45yCFzponGKVJcM+6cvol/BbMWEO876N4Kl96EetQxn0S2elT6lxMVzJBhy+0pBLg0 Bpv942A70RoeCsHNzbPx/iHusvRlw9byt7WlccU/31XnAQ8xGKPkHZwpT8zIS2cvshe6 iAfA== X-Gm-Message-State: AOJu0Yx6ef1C/cwv5QVF0Fvd3HJ7ZP62wzaR70aZcgR+jh4MZJ/pwX69 SR+6/Z72EI10JgPQqaYjW9dnRS7Two6+Ng== X-Google-Smtp-Source: AGHT+IH3AqKyu/yBqGngoxnjrpQopoxfWSk/y23+dbvryELZZFb7rZY4bd9NGFaZBjq/uSLRSqavjg== X-Received: by 2002:a05:600c:4e0d:b0:409:101e:234d with SMTP id b13-20020a05600c4e0d00b00409101e234dmr11412288wmq.12.1700073375594; Wed, 15 Nov 2023 10:36:15 -0800 (PST) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id q2-20020a056000136200b003313a1e0ba1sm11178423wrz.89.2023.11.15.10.36.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 10:36:13 -0800 (PST) Message-ID: From: Liliana Marie Prikler Date: Wed, 15 Nov 2023 19:36:12 +0100 In-Reply-To: References: <26ef9c0f4bf2ff942ba2b42e1fadeb6174bbaa6a.1699906775.git.phfrohring@deeplinks.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 MIME-Version: 1.0 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: 94A19633AA X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -4.99 X-Spam-Score: -4.99 X-TUID: 2mwTBAyBZtGq Am Mittwoch, dem 15.11.2023 um 10:57 +0100 schrieb Pierre-Henry Fr=C3=B6hring: > > No.=C2=A0 Look at all the other build systems.=C2=A0 None of them use > > submodules of (gnu > > packages), for a good reason. >=20 > 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) > =C2=A0 (let* ((base (resolve-interface '(gnu packages base))) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(glibc (module-ref base 'glibc)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(make-glibc-utf8-locales (module-ref ba= se 'make-glibc-utf8- > locales))) > =C2=A0 =C2=A0 (make-glibc-utf8-locales glibc #:locales (list "en_US")))) >=20 > (define (default-elixir-hex) > =C2=A0 (let ((elixir (resolve-interface '(gnu packages elixir)))) > =C2=A0 =C2=A0 (module-ref elixir 'elixir-hex))) >=20 > (define (default-rebar3) > =C2=A0 (let ((erlang (resolve-interface '(gnu packages erlang)))) > =C2=A0 =C2=A0 (module-ref erlang 'rebar3))) > #+end_src >=20 > 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 (defa= ult-elixir-hex)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (glibc-utf8-local= es (default-glibc-utf8-locales)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (rebar3 (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-key= s #:rest arguments) > =C2=A0 =E2=80=A6) > #+end_src >=20 > Is this correct? You shouldn't need to provide glibc-utf8-locales this way (there's already a variable for it IIRC), but yeah. > > Not necessarily, but you want a different way of building > > $out/lib/elixir/X.Y/ > > that doesn't leak through the function signature. >=20 > Following ~python-build-system.scm~, 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(components =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 major+minor "."))) >=20 > (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) "= /site- > packages"))) > #+end_src >=20 > Is this correct? LGTM. > > Btw. I think that you're resolving transitive inputs twice; once on > > the build system code and once by fattening the outputs.=C2=A0 You > > probably only need either of those, not both. >=20 > Ah. Propagated inputs are propagated. 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(append inputs native-inputs))) >=20 > =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)) >=20 > =C2=A0 (bag =E2=80=A6 > =C2=A0 =C2=A0 =C2=A0 =C2=A0(build-inputs build-inputs) > =C2=A0 =C2=A0 =C2=A0 =C2=A0=E2=80=A6)) > #+end_src > I've just removed ~all-propagated-inputs~ and all packages build just > fine. >=20 > Is this what you meant? Yep. I assume this makes your packages way lighter. Note that propagated inputs have become a (not great) default for interpreted languages such as Python or Emacs Lisp. > > Yep, that would work.=C2=A0 Note that delete-duplicates is O(n^2), > > though.=C2=A0 We have a little bit of code where it's done in (I assume= ) > > O(n*log(n)) with vhashes. >=20 > If ~all-propagated-inputs~ is removed, then the discussion of this > comment is closed. Sure.