GNU bug report logs - #67877
[PATCH 0/7] Enable Elixir packages that depend on Erlang packages to build

Previous Next

Package: guix-patches;

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

Date: Mon, 18 Dec 2023 13:08:01 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 67877 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#67877; Package guix-patches. (Mon, 18 Dec 2023 13:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pierre-Henry Fröhring <contact <at> phfrohring.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 18 Dec 2023 13:08:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pierre-Henry Fröhring <contact <at> phfrohring.com>
To: guix-patches <at> gnu.org
Cc: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: [PATCH 0/7] Enable Elixir packages that depend on Erlang packages
 to build
Date: Mon, 18 Dec 2023 14:02:04 +0100
Hello lylip,

It's great to see progress!

I suggest the next objective is to enable Elixir packages that depend on Erlang
packages to build. For instance, the Elixir package [telemetry_metrics] depends on the
Erlang telemetry package and is a dependency of the Elixir Phoenix package.

While reviewing the code of the Rebar build system, we noticed the use of the
[skip_deps] Rebar flag, which is ignored by Rebar:
┌────
│ $ guix shell rebar3 -- rebar3 help compile
│ […]
│   -d, --deps_only  Only compile dependencies, no project apps will be
│                    built.
└────

So, to build Elixir packages that depend on Erlang, the necessary steps inlcude:
1) Updating the Rebar build system to align with the current usages of Rebar.
2) Allowing Elixir to access Erlang compiled libraries as discussed in [issue 66801].

If the following plan is agreed upon, then we will have an Elixir package that
depends on an Erlang package to build, specifically `telemetry_metrics'. Patches in the
series will have these objectives:

1. ☐ Update the Rebar build system to align with the current usages of Rebar.
2. ☐ Update the Erlang build system to install libraries under `lib/erlang/X.Y' as discussed in issue 66801.
3. ☐ Update the Erlang package so that `GUIX_ERL_LIBS' gather all libraries installed under `lib/erlang/X.Y'.
4. ☐ Update the Erlang package to wrap its binaires so that they have access to
   compiled libraries represented by `GUIX_ERL_LIBS'.
5. ☐ Add the Erlang Telemetry package.
6. ☐ Update the Elixir package so that it has access to Erlang packages represented by `GUIX_ERL_LIBS'.
7. ☐ Add the Elixir package `telemetry_metrics'.

If the corresponding patch series is merged, additional packages (whether Erlang,
Elixir, or other types) will be incorporated until Phoenix package builds.

What do you think of this plan?

–
Regards,
phf


[telemetry_metrics] <https://hex.pm/packages/telemetry_metrics>

[skip_deps] <https://git.savannah.gnu.org/cgit/guix.git/tree/guix/build-system/rebar.scm?id=f410d49eb24db4eecae054dfe136464bc92ba8a3#n103>

[issue 66801] <https://issues.guix.gnu.org/66801#75>




Information forwarded to guix-patches <at> gnu.org:
bug#67877; Package guix-patches. (Mon, 18 Dec 2023 14:50:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Pierre-Henry Fröhring <contact <at> phfrohring.com>, 
 guix-patches <at> gnu.org
Subject: Re: [PATCH 0/7] Enable Elixir packages that depend on Erlang
 packages to build
Date: Mon, 18 Dec 2023 15:49:22 +0100
Am Montag, dem 18.12.2023 um 14:02 +0100 schrieb Pierre-Henry Fröhring:
> Hello lylip,
> 
> It's great to see progress!
> 
> I suggest the next objective is to enable Elixir packages that depend
> on Erlang packages to build. For instance, the Elixir package
> [telemetry_metrics] depends on the Erlang telemetry package and is a
> dependency of the Elixir Phoenix package.
> 
> While reviewing the code of the Rebar build system, we noticed the
> use of the [skip_deps] Rebar flag, which is ignored by Rebar:
> ┌────
> │ $ guix shell rebar3 -- rebar3 help compile
> │ […]
> │   -d, --deps_only  Only compile dependencies, no project apps will
> be
> │                    built.
> └────
> 
> So, to build Elixir packages that depend on Erlang, the necessary
> steps inlcude:
> 1) Updating the Rebar build system to align with the current usages
> of Rebar.
> 2) Allowing Elixir to access Erlang compiled libraries as discussed
> in [issue 66801].
> 
> If the following plan is agreed upon, then we will have an Elixir
> package that depends on an Erlang package to build, specifically
> `telemetry_metrics'. Patches in the series will have these
> objectives:
> 
> 1. ☐ Update the Rebar build system to align with the current usages
> of Rebar.
> 2. ☐ Update the Erlang build system to install libraries under
> `lib/erlang/X.Y' as discussed in issue 66801.
> 3. ☐ Update the Erlang package so that `GUIX_ERL_LIBS' gather all
> libraries installed under `lib/erlang/X.Y'.
> 4. ☐ Update the Erlang package to wrap its binaires so that they have
> access to
>    compiled libraries represented by `GUIX_ERL_LIBS'.
> 5. ☐ Add the Erlang Telemetry package.
> 6. ☐ Update the Elixir package so that it has access to Erlang
> packages represented by `GUIX_ERL_LIBS'.
> 7. ☐ Add the Elixir package `telemetry_metrics'.
> 
> If the corresponding patch series is merged, additional packages
> (whether Erlang, Elixir, or other types) will be incorporated until
> Phoenix package builds.
> 
> What do you think of this plan?
Since we typically disable phoning home (including telemetry), I don't
think having a telemetry package in Guix would be good optics :)
Perhaps you can think of another example package but still follow the
steps laid out above?

Cheers




Information forwarded to guix-patches <at> gnu.org:
bug#67877; Package guix-patches. (Wed, 20 Dec 2023 11:01:02 GMT) Full text and rfc822 format available.

Message #11 received at 67877 <at> debbugs.gnu.org (full text, mbox):

From: Pierre-Henry Fröhring <contact <at> phfrohring.com>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: 67877 <at> debbugs.gnu.org
Subject: Re: [PATCH 0/7] Enable Elixir packages that depend on Erlang
 packages to build
Date: Wed, 20 Dec 2023 11:57:57 +0100
Dear lylip,

> Perhaps you can think of another example package but still follow the
> steps laid out above?

The [yaml_elixir] package should fit the bill as it calls [yamerl]. I have
got everything working here. I am in the process of crafting the various
patches. I have written a literate programming implementation of the rebar
build system to document the reasoning for future references. The code in
the post actually runs. Could you please review the reasoning? I will add
your remarks to the post.  Here is the post:

<https://phfrohring.com/867329cb-afbd-49d7-9c5c-f36ac07cd62c.html>

Thank you.

--

Regards,

-- phf


[yaml_elixir] <https://hex.pm/packages/yaml_elixir>

[yamerl] <https://hex.pm/packages/yamerl>




Information forwarded to guix-patches <at> gnu.org:
bug#67877; Package guix-patches. (Sat, 13 Jul 2024 11:46:01 GMT) Full text and rfc822 format available.

Message #14 received at 67877 <at> debbugs.gnu.org (full text, mbox):

From: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
To: 67877 <at> debbugs.gnu.org
Subject: [PATCH 0/7] Enable Elixir packages that depend on Erlang packages to
 build
Date: Sat, 13 Jul 2024 13:45:54 +0200
[Message part 1 (text/plain, inline)]
Another Elixir package depending on Erlang package is artificery. Here 
is a scratch of a package definition. Please let me know how I can help 
implementing the required things.


* gnu/packages/elixir-xyz.scm (elixir-artificery): New variable.
---
gnu/packages/elixir-xyz.scm | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/gnu/packages/elixir-xyz.scm b/gnu/packages/elixir-xyz.scm
index f08e07bb57..618c5afe8e 100644
--- a/gnu/packages/elixir-xyz.scm
+++ b/gnu/packages/elixir-xyz.scm
@@ -1,4 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2020, 2021 Hartmut Goebel <h.goebel <at> crazy-compilers.com>
;;; Copyright © 2023 Pierre-Henry Fröhring <phfrohring <at> deeplinks.com>
;;; Copyright © 2024 Igor Goryachev <igor <at> goryachev.org>
;;;
@@ -36,6 +37,24 @@ (define-module (gnu packages elixir-xyz)
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-26))

+(define-public elixir-artificery
+  (package
+    (name "elixir-artificery")
+    (version "0.4.3")
+    (source (origin
+              (method url-fetch)
+              (uri (hexpm-uri "artificery" version))
+              (sha256
+               (base32
+                "0105zjghn01zncvwza1bkih0apkz7vxbxgbsjd78h80flcrm7s8j"))))
+    (build-system elixir-build-system)
+    (inputs (list erlang-hex-core))
+    (home-page "https://github.com/bitwalker/artificery")
+    (synopsis "Toolkit for terminal user interfaces in Elixir")
+    (description "This package provides a toolkit for terminal user 
interfaces
+in Elixir.")
+    (license license:asl2.0)))
+
(define-public elixir-nimble-parsec
  (package
    (name "elixir-nimble-parsec")
-- 
2.41.1





-- 
Regards
Hartmut Goebel

| Hartmut Goebel          |h.goebel <at> crazy-compilers.com                |
|www.crazy-compilers.com  | compilers which you thought are impossible |
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#67877; Package guix-patches. (Sun, 14 Jul 2024 10:49:02 GMT) Full text and rfc822 format available.

Message #17 received at 67877 <at> debbugs.gnu.org (full text, mbox):

From: Pierre-Henry Fröhring <contact <at> phfrohring.com>
To: Hartmut Goebel <h.goebel <at> crazy-compilers.com>
Cc: 67877 <at> debbugs.gnu.org
Subject: [PATCH 0/7] Enable Elixir packages that depend on Erlang packages
 to build
Date: Sun, 14 Jul 2024 12:47:47 +0200
Hello Hartmut,

I have built a test case, which you can find here:

<https://phfrohring.com/page/7cbeef0f-6f18-41be-85fb-706ee226be2b/>

If `guix build -f test-package.scm` succeeds, there is a good chance that the issue is resolved.

Cheers,
--

Pierre-Henry FRÖHRING
- Tel: +33 7 88 17 15 73
- Email: contact <at> phfrohring.com
- Web: <https://www.phfrohring.com>




This bug report was last modified 335 days ago.

Previous Next


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