GNU bug report logs - #73458
Fix mix-build-system bugs (73453 , 73454)

Previous Next

Package: guix-patches;

Reported by: paul <goodoldpaul <at> autistici.org>

Date: Tue, 24 Sep 2024 17:33:02 UTC

Severity: normal

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Giacomo Leidi <goodoldpaul <at> autistici.org>
To: 73458 <at> debbugs.gnu.org
Cc: Giacomo Leidi <goodoldpaul <at> autistici.org>
Subject: [bug#73458] [PATCH v2 2/2] build-system: mix: Fix decoding of package names with git versions.
Date: Wed, 25 Sep 2024 23:39:18 +0200
* guix/build/mix-build-system.scm (%git-version-rx): New variable,
(package-name->elixir-name): use %git-version-rx to discriminate git
versions from regular ones.

Fixes <https://issues.guix.gnu.org/73454>
Change-Id: Icc6dc56c3db62dfbc17c7c71354a7a7e3d2e5b2a

Change-Id: I99ad5e36680928e50c0cba5beb85f34c7bfa12df
---
 guix/build/mix-build-system.scm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/guix/build/mix-build-system.scm b/guix/build/mix-build-system.scm
index 73af575b10..6b7541cf56 100644
--- a/guix/build/mix-build-system.scm
+++ b/guix/build/mix-build-system.scm
@@ -40,6 +40,9 @@ (define-module (guix build mix-build-system)
 ;; minor version number of the Elixir used in the build.
 (define %elixir-version (make-parameter "X.Y"))
 
+(define %git-version-rx
+  (make-regexp "^(.*)-[0-9]+(\\.[0-9]+)?(\\.[0-9]+)?-[0-9]+\\..+$"))
+
 (define* (elixir-libdir path #:optional (version (%elixir-version)))
   "Return the path where all libraries under PATH for a specified Elixir
 VERSION are installed."
@@ -133,10 +136,12 @@ (define* (remove-mix-dirs . _)
 
 (define (package-name->elixir-name name+ver)
   "Convert the Guix package NAME-VER to the corresponding Elixir name-version
-format.  Example: elixir-a-pkg-1.2.3 -> a_pkg"
+format.  Example: elixir-a-pkg-1.2.3 -> a_pkg or elixir-a-pkg-0.0.0-0.e51e36e
+-> a_pkg"
+  (define git-version? (regexp-exec %git-version-rx name+ver))
   ((compose
     (cute string-join <> "_")
-    (cute drop-right <> 1)
+    (cute drop-right <> (if git-version? 2 1))
     (cute string-split <> #\-))
    (strip-prefix name+ver)))
 
-- 
2.46.0





This bug report was last modified 281 days ago.

Previous Next


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