unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#72925] Adding JPM package for Janet
@ 2024-09-01  8:31 Omar Bassam
  2024-09-04  8:22 ` [bug#72925] [PATCH] adding jpm package Omar Bassam
                   ` (6 more replies)
  0 siblings, 7 replies; 30+ messages in thread
From: Omar Bassam @ 2024-09-01  8:31 UTC (permalink / raw)
  To: 72925

[-- Attachment #1: Type: text/plain, Size: 3985 bytes --]

From 14fd8cafaebc27a00a4b198abe8e3759583c56b5 Mon Sep 17 00:00:00 2001
Message-ID: <
14fd8cafaebc27a00a4b198abe8e3759583c56b5.1725179146.git.omar.bassam88@gmail.com
>
From: Omar Bassam <omar.bassam88@gmail.com>
Date: Sun, 1 Sep 2024 08:17:08 +0000
Subject: [PATCH] adding jpm package

Change-Id: I730ef2f5c874c5142a580a42af76180e95d93ccd
---
 gnu/packages/lisp.scm | 52 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 5d4399f145..4d4748dcb4 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -29,6 +29,7 @@
 ;;; Copyright © 2024 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2024 bigbug <bigbookofbug@proton.me>
 ;;; Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se>
+;;; Copyright © 2024 Omar Bassam <omar.bassam88@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -917,6 +918,57 @@ (define-public janet
 assembler, PEG) is less than 1MB.")
     (license license:expat)))

+(define-public jpm
+  (package
+    (name "jpm")
+    (version "1.1.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/janet-lang/jpm.git")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256 (base32
"05rdxigmiy7vf93s16a8n2029lq33073jccz1rjl4iisxj6piw4l"))))
+    (build-system trivial-build-system)
+    (arguments
+     (list
+      #:modules `((guix build utils))
+      #:builder #~(begin
+                    (use-modules (guix build utils))
+                    (mkdir %output)
+                    (for-each (lambda (dir) (mkdir (string-append %output
"/" dir)))
+                              '("bin" "lib" "share" "share/man" "lib/janet"
+                                "lib/janet/jpm" "share/man/man1"))
+                    (copy-recursively (assoc-ref %build-inputs "source")
"source")
+                    (chdir "source")
+                    (substitute* "configs/linux_config.janet"
+                      (("auto-shebang true") "auto-shebang false"))
+                    (substitute* "configs/linux_config.janet"
+                      (("/usr/local") %output))
+                    (substitute* "jpm/shutil.janet"
+                      (("cp") (string-append #$coreutils "/bin/cp")))
+                    (substitute* "jpm/declare.janet"
+                      (("chmod") (string-append #$coreutils "/bin/chmod")))
+                    (setenv "PREFIX" %output)
+                    (setenv "JANET_PREFIX" %output)
+                    (setenv "JANET_LIBPATH" (string-append %output
"/lib/janet"))
+                    (setenv "JANET_MODPATH" (string-append %output
"/lib/janet"))
+                    (system* (string-append #$janet "/bin/janet")
+                             "bootstrap.janet"
"configs/linux_config.janet")
+                    (substitute* (string-append %output "/bin/jpm")
+                      (("/usr/bin/env janet")
+                       (string-append #$janet "/bin/janet")))
+                    (copy-recursively (string-append #$janet
"/include/janet")
+                                      (string-append %output
"/include/janet"))
+                    (copy-recursively (string-append #$janet "/lib")
+                                      (string-append %output "/lib")))))
+    (inputs (list janet coreutils))
+    (home-page "https://janet-lang.org/")
+    (synopsis "Janet Project Manager for the Janet programming language")
+    (description "JPM is the Janet Project Manager tool. It is for
automating
+builds and downloading dependencies of Janet projects.")
+    (license license:expat)))
+
 (define-public lisp-repl-core-dumper
   (package
     (name "lisp-repl-core-dumper")

base-commit: e05f0e9832326703fa90a02559f1a4b44e4401ad
-- 
2.45.2

[-- Attachment #2: Type: text/html, Size: 5528 bytes --]

^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH] adding jpm package
  2024-09-01  8:31 [bug#72925] Adding JPM package for Janet Omar Bassam
@ 2024-09-04  8:22 ` Omar Bassam
  2024-09-05 14:50 ` Omar Bassam
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 30+ messages in thread
From: Omar Bassam @ 2024-09-04  8:22 UTC (permalink / raw)
  To: 72925
  Cc: Omar Bassam, Guillaume Le Vaillant, Katherine Cox-Buday,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

Change-Id: I730ef2f5c874c5142a580a42af76180e95d93ccd
---
 gnu/packages/lisp.scm | 52 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 5d4399f145..4d4748dcb4 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -29,6 +29,7 @@
 ;;; Copyright © 2024 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2024 bigbug <bigbookofbug@proton.me>
 ;;; Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se>
+;;; Copyright © 2024 Omar Bassam <omar.bassam88@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -917,6 +918,57 @@ (define-public janet
 assembler, PEG) is less than 1MB.")
     (license license:expat)))
 
+(define-public jpm
+  (package
+    (name "jpm")
+    (version "1.1.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/janet-lang/jpm.git")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256 (base32 "05rdxigmiy7vf93s16a8n2029lq33073jccz1rjl4iisxj6piw4l"))))
+    (build-system trivial-build-system)
+    (arguments
+     (list
+      #:modules `((guix build utils))
+      #:builder #~(begin
+                    (use-modules (guix build utils))
+                    (mkdir %output)
+                    (for-each (lambda (dir) (mkdir (string-append %output "/" dir)))
+                              '("bin" "lib" "share" "share/man" "lib/janet"
+                                "lib/janet/jpm" "share/man/man1"))
+                    (copy-recursively (assoc-ref %build-inputs "source") "source")
+                    (chdir "source")
+                    (substitute* "configs/linux_config.janet"
+                      (("auto-shebang true") "auto-shebang false"))
+                    (substitute* "configs/linux_config.janet"
+                      (("/usr/local") %output))
+                    (substitute* "jpm/shutil.janet"
+                      (("cp") (string-append #$coreutils "/bin/cp")))
+                    (substitute* "jpm/declare.janet"
+                      (("chmod") (string-append #$coreutils "/bin/chmod")))
+                    (setenv "PREFIX" %output)
+                    (setenv "JANET_PREFIX" %output)
+                    (setenv "JANET_LIBPATH" (string-append %output "/lib/janet"))
+                    (setenv "JANET_MODPATH" (string-append %output "/lib/janet"))
+                    (system* (string-append #$janet "/bin/janet")
+                             "bootstrap.janet" "configs/linux_config.janet")
+                    (substitute* (string-append %output "/bin/jpm")
+                      (("/usr/bin/env janet")
+                       (string-append #$janet "/bin/janet")))
+                    (copy-recursively (string-append #$janet "/include/janet")
+                                      (string-append %output "/include/janet"))
+                    (copy-recursively (string-append #$janet "/lib")
+                                      (string-append %output "/lib")))))
+    (inputs (list janet coreutils))
+    (home-page "https://janet-lang.org/")
+    (synopsis "Janet Project Manager for the Janet programming language")
+    (description "JPM is the Janet Project Manager tool. It is for automating
+builds and downloading dependencies of Janet projects.")
+    (license license:expat)))
+
 (define-public lisp-repl-core-dumper
   (package
     (name "lisp-repl-core-dumper")

base-commit: e05f0e9832326703fa90a02559f1a4b44e4401ad
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH] adding jpm package
  2024-09-01  8:31 [bug#72925] Adding JPM package for Janet Omar Bassam
  2024-09-04  8:22 ` [bug#72925] [PATCH] adding jpm package Omar Bassam
@ 2024-09-05 14:50 ` Omar Bassam
  2024-09-18 13:18   ` [bug#72925] Adding JPM package for Janet Suhail Singh
  2024-09-30  8:12 ` [bug#72925] [PATCH v3] adding jpm package Omar Bassam
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 30+ messages in thread
From: Omar Bassam @ 2024-09-05 14:50 UTC (permalink / raw)
  To: 72925
  Cc: Omar Bassam, Guillaume Le Vaillant, Katherine Cox-Buday,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

Change-Id: I730ef2f5c874c5142a580a42af76180e95d93ccd
---
 gnu/packages/lisp.scm | 52 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 5d4399f145..96698d375d 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -29,6 +29,7 @@
 ;;; Copyright © 2024 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2024 bigbug <bigbookofbug@proton.me>
 ;;; Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se>
+;;; Copyright © 2024 Omar Bassam <omar.bassam88@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -917,6 +918,57 @@ (define-public janet
 assembler, PEG) is less than 1MB.")
     (license license:expat)))
 
+(define-public jpm
+  (package
+    (name "jpm")
+    (version "1.1.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/janet-lang/jpm.git")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256 (base32 "05rdxigmiy7vf93s16a8n2029lq33073jccz1rjl4iisxj6piw4l"))))
+    (build-system trivial-build-system)
+    (arguments
+     (list
+      #:modules `((guix build utils))
+      #:builder #~(begin
+                    (use-modules (guix build utils))
+                    (mkdir %output)
+                    (for-each (lambda (dir) (mkdir (string-append %output "/" dir)))
+                              '("bin" "lib" "share" "share/man" "lib/janet"
+                                "lib/janet/jpm" "share/man/man1"))
+                    (copy-recursively (assoc-ref %build-inputs "source") "source")
+                    (chdir "source")
+                    (substitute* "configs/linux_config.janet"
+                      (("auto-shebang true") "auto-shebang false"))
+                    (substitute* "configs/linux_config.janet"
+                      (("/usr/local") %output))
+                    (substitute* "jpm/shutil.janet"
+                      (("cp") (string-append #$coreutils "/bin/cp")))
+                    (substitute* "jpm/declare.janet"
+                      (("chmod") (string-append #$coreutils "/bin/chmod")))
+                    (setenv "PREFIX" %output)
+                    (setenv "JANET_PREFIX" %output)
+                    (setenv "JANET_LIBPATH" (string-append %output "/lib/janet"))
+                    (setenv "JANET_MODPATH" (string-append %output "/lib/janet"))
+                    (system* (string-append #$janet "/bin/janet")
+                             "bootstrap.janet" "configs/linux_config.janet")
+                    (substitute* (string-append %output "/bin/jpm")
+                      (("/usr/bin/env janet")
+                       (string-append #$janet "/bin/janet")))
+                    (copy-recursively (string-append #$janet "/include/janet")
+                                      (string-append %output "/include/janet"))
+                    (copy-recursively (string-append #$janet "/lib")
+                                      (string-append %output "/lib")))))
+    (inputs (list janet coreutils))
+    (home-page "https://janet-lang.org/")
+    (synopsis "Janet Project Manager for the Janet programming language")
+    (description "JPM is the Janet Project Manager tool.  It is for automating
+builds and downloading dependencies of Janet projects.")
+    (license license:expat)))
+
 (define-public lisp-repl-core-dumper
   (package
     (name "lisp-repl-core-dumper")

base-commit: e05f0e9832326703fa90a02559f1a4b44e4401ad
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [bug#72925] Adding JPM package for Janet
  2024-09-05 14:50 ` Omar Bassam
@ 2024-09-18 13:18   ` Suhail Singh
  2024-09-18 15:34     ` Omar Bassam
  0 siblings, 1 reply; 30+ messages in thread
From: Suhail Singh @ 2024-09-18 13:18 UTC (permalink / raw)
  To: Omar Bassam
  Cc: Sharlatan Hellseher, 72925, Munyoki Kilyungi, Katherine Cox-Buday,
	Guillaume Le Vaillant, jgart

Hi Omar,

Thank you for submitting this patch.  A few comments:

Omar Bassam <omar.bassam88@gmail.com> writes:

> Change-Id: I730ef2f5c874c5142a580a42af76180e95d93ccd
> ---
>  gnu/packages/lisp.scm | 52 +++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 52 insertions(+)
>
> diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
> index 5d4399f145..96698d375d 100644

Could you please update the reroll-count when you send amendments to the
patch?  IIUC, this version should have been v2.

> +(define-public jpm
> +  (package
> +    (name "jpm")
> +    (version "1.1.0")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/janet-lang/jpm.git")
> +                    (commit (string-append "v" version))))
> +              (file-name (git-file-name name version))
> +              (sha256 (base32 "05rdxigmiy7vf93s16a8n2029lq33073jccz1rjl4iisxj6piw4l"))))
> +    (build-system trivial-build-system)
> ...
> +                    (substitute* (string-append %output "/bin/jpm")
> +                      (("/usr/bin/env janet")
> +                       (string-append #$janet "/bin/janet")))

Is my understanding correct that you're updating the shebang line here?
If so, would it be better to use the copy-build-system instead?  If not,
could you please elaborate?  If copy-build-system does indeed turn out
to be better suited, could you please send v3 of the patch?

-- 
Suhail




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#72925] Adding JPM package for Janet
  2024-09-18 13:18   ` [bug#72925] Adding JPM package for Janet Suhail Singh
@ 2024-09-18 15:34     ` Omar Bassam
  2024-09-18 16:16       ` Suhail Singh
  0 siblings, 1 reply; 30+ messages in thread
From: Omar Bassam @ 2024-09-18 15:34 UTC (permalink / raw)
  To: Suhail Singh
  Cc: Sharlatan Hellseher, 72925, Munyoki Kilyungi, Katherine Cox-Buday,
	Guillaume Le Vaillant, jgart

[-- Attachment #1: Type: text/plain, Size: 2228 bytes --]

Thank you for taking the time to look into my patch. Sorry, I'm new to Guix
and to this workflow. So, forgive me if my questions look a bit naive:
1. What do you mean by reroll count for the patch?
2. I looked at the copy-build-system documentation. I'm not sure how it can
be used here. I'm not just updating the shebang. As you can already see in
the patch, I'm doing a lot of string substitutions in the source code
itself because some values are hard coded. That's why I preferred to use
the trivial-build-system to have more control of what I need to substitute.

Thanks,
Omar

On Wed, 18 Sept 2024 at 16:19, Suhail Singh <suhailsingh247@gmail.com>
wrote:

> Hi Omar,
>
> Thank you for submitting this patch.  A few comments:
>
> Omar Bassam <omar.bassam88@gmail.com> writes:
>
> > Change-Id: I730ef2f5c874c5142a580a42af76180e95d93ccd
> > ---
> >  gnu/packages/lisp.scm | 52 +++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 52 insertions(+)
> >
> > diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
> > index 5d4399f145..96698d375d 100644
>
> Could you please update the reroll-count when you send amendments to the
> patch?  IIUC, this version should have been v2.
>
> > +(define-public jpm
> > +  (package
> > +    (name "jpm")
> > +    (version "1.1.0")
> > +    (source (origin
> > +              (method git-fetch)
> > +              (uri (git-reference
> > +                    (url "https://github.com/janet-lang/jpm.git")
> > +                    (commit (string-append "v" version))))
> > +              (file-name (git-file-name name version))
> > +              (sha256 (base32
> "05rdxigmiy7vf93s16a8n2029lq33073jccz1rjl4iisxj6piw4l"))))
> > +    (build-system trivial-build-system)
> > ...
> > +                    (substitute* (string-append %output "/bin/jpm")
> > +                      (("/usr/bin/env janet")
> > +                       (string-append #$janet "/bin/janet")))
>
> Is my understanding correct that you're updating the shebang line here?
> If so, would it be better to use the copy-build-system instead?  If not,
> could you please elaborate?  If copy-build-system does indeed turn out
> to be better suited, could you please send v3 of the patch?
>
> --
> Suhail
>

[-- Attachment #2: Type: text/html, Size: 3129 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#72925] Adding JPM package for Janet
  2024-09-18 15:34     ` Omar Bassam
@ 2024-09-18 16:16       ` Suhail Singh
  0 siblings, 0 replies; 30+ messages in thread
From: Suhail Singh @ 2024-09-18 16:16 UTC (permalink / raw)
  To: Omar Bassam
  Cc: Sharlatan Hellseher, 72925, Munyoki Kilyungi, Katherine Cox-Buday,
	Guillaume Le Vaillant, jgart, Suhail Singh

Omar Bassam <omar.bassam88@gmail.com> writes:

> Thank you for taking the time to look into my patch. Sorry, I'm new to Guix
> and to this workflow. So, forgive me if my questions look a bit naive:
> 1. What do you mean by reroll count for the patch?

Please refer to the man page of git-format-patch and look for
--reroll-count :

#+begin_quote
       -v <n>, --reroll-count=<n>
           Mark the series as the <n>-th iteration of the topic. The output
           filenames have v<n> prepended to them, and the subject prefix
           ("PATCH" by default, but configurable via the --subject-prefix
           option) has ` v<n>` appended to it. E.g.  --reroll-count=4 may
           produce v4-0001-add-makefile.patch file that has "Subject: [PATCH
           v4 1/20] Add makefile" in it.  <n> does not have to be an integer
           (e.g. "--reroll-count=4.4", or "--reroll-count=4rev2" are allowed),
           but the downside of using such a reroll-count is that the
           range-diff/interdiff with the previous version does not state
           exactly which version the new iteration is compared against.
#+end_quote

> 2. I looked at the copy-build-system documentation. I'm not sure how it can
> be used here. I'm not just updating the shebang. As you can already see in
> the patch, I'm doing a lot of string substitutions in the source code
> itself because some values are hard coded. That's why I preferred to use
> the trivial-build-system to have more control of what I need to substitute.

Based on my understanding of the patch you are copying files, updating
some references in files, and setting environment variables.  I believe
all of these are possible via the copy-build-system as well which is
described as:

#+begin_quote
  ;; Standard build procedure for simple packages that don't require much
  ;; compilation, mostly just copying files around.  This is implemented as an
  ;; extension of `gnu-build-system'.
#+end_quote

If you'd like to learn more, you can grep under ./gnu/packages and look
at some instances where it's used.  I don't have experience with the
trivial-build-system, which is why I wondered.

> +                    (setenv "PREFIX" %output)
> +                    (setenv "JANET_PREFIX" %output)
> +                    (setenv "JANET_LIBPATH" (string-append %output "/lib/janet"))
> +                    (setenv "JANET_MODPATH" (string-append %output "/lib/janet"))

What would be a way to test that the above is doing the "correct" thing?
Is there a sequence of steps that I can evaluate which will yield a
different outcome depending on whether or not the above accomplishes
what it intends to?  Put another way, what breaks when the above aren't
set (and how do I observe that failure)?

-- 
Suhail




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH v3] adding jpm package
  2024-09-01  8:31 [bug#72925] Adding JPM package for Janet Omar Bassam
  2024-09-04  8:22 ` [bug#72925] [PATCH] adding jpm package Omar Bassam
  2024-09-05 14:50 ` Omar Bassam
@ 2024-09-30  8:12 ` Omar Bassam
  2024-10-01  0:06   ` Suhail Singh
  2024-10-02 14:36 ` [bug#72925] [PATCH v5] gnu: add " Omar Bassam
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 30+ messages in thread
From: Omar Bassam @ 2024-09-30  8:12 UTC (permalink / raw)
  To: 72925
  Cc: Omar Bassam, Guillaume Le Vaillant, Katherine Cox-Buday,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

Change-Id: I730ef2f5c874c5142a580a42af76180e95d93ccd
---
 gnu/packages/lisp.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 6c16d8ab71..7348ab5548 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -29,6 +29,7 @@
 ;;; Copyright © 2024 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2024 bigbug <bigbookofbug@proton.me>
 ;;; Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se>
+;;; Copyright © 2024 Omar Bassam <omar.bassam88@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -917,6 +918,41 @@ (define-public janet
 assembler, PEG) is less than 1MB.")
     (license license:expat)))
 
+(define-public jpm
+  (package
+    (name "jpm")
+    (version "1.1.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/janet-lang/jpm.git")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256 (base32 "05rdxigmiy7vf93s16a8n2029lq33073jccz1rjl4iisxj6piw4l"))))
+    (build-system copy-build-system)
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+		   (add-after 'unpack 'fix-prefix-path
+		     (lambda _
+		       (substitute* "configs/linux_config.janet"
+			 (("/usr/local") #$output))
+		       (setenv "PREFIX" #$output)))
+		   (replace 'install
+		     (lambda _ 
+		       (for-each (lambda (dir) (mkdir-p (string-append #$output "/" dir)))
+				 '("lib/janet/jpm" "share/man/man1"))
+		       (invoke "janet" "bootstrap.janet" "configs/linux_config.janet")
+		       (wrap-program (string-append #$output "/bin/jpm")
+			 `("JANET_HEADERPATH" ":" = (,(string-append #$janet "/include/janet")))
+			 `("JANET_LIBPATH" ":" = (,(string-append #$janet "/lib")))))))))
+    (inputs (list janet))
+    (home-page "https://janet-lang.org/")
+    (synopsis "Janet Project Manager for the Janet programming language")
+    (description "JPM is the Janet Project Manager tool. It is for automating
+builds and downloading dependencies of Janet projects.")
+    (license license:expat)))
+
 (define-public lisp-repl-core-dumper
   (package
     (name "lisp-repl-core-dumper")

base-commit: 093f2fb8722fafcc7c1555cd845289096849f4a2
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH v3] adding jpm package
  2024-09-30  8:12 ` [bug#72925] [PATCH v3] adding jpm package Omar Bassam
@ 2024-10-01  0:06   ` Suhail Singh
  2024-10-02 15:09     ` Omar Bassam
  0 siblings, 1 reply; 30+ messages in thread
From: Suhail Singh @ 2024-10-01  0:06 UTC (permalink / raw)
  To: Omar Bassam
  Cc: Sharlatan Hellseher, 72925, Munyoki Kilyungi, Katherine Cox-Buday,
	Guillaume Le Vaillant, jgart

Omar, thank you for sending a revised patch.  I have a few comments
relating to style and one unanswered question from our last exchange.

> Subject: [bug#72925] [PATCH v3] adding jpm package

In v4, could you please update the commit message to conform to the
ChangeLog format as noted in
<https://guix.gnu.org/manual/devel/en/html_node/Submitting-Patches.html>.
Please see
<https://www.gnu.org/prep/standards/html_node/Change-Logs.html#Change-Logs>
for additional details.  If you're using magit,
`magit-generate-changelog' can help with this.

In your case the commit will probably look something like:
#+begin_quote
  gnu: Add jpm.

  * gnu/packages/lisp.scm (jpm): New variable.
#+end_quote

Omar Bassam <omar.bassam88@gmail.com> writes:

> +(define-public jpm
> +  (package
> +    (name "jpm")
> +    (version "1.1.0")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/janet-lang/jpm.git")
> +                    (commit (string-append "v" version))))
> +              (file-name (git-file-name name version))
> +              (sha256 (base32 "05rdxigmiy7vf93s16a8n2029lq33073jccz1rjl4iisxj6piw4l"))))

There are no build errors with this, however, it's not clear how to
verify that the runtime behaviour of jpm is as expected.  After
installing janet and jpm in a guix profile, running a command such as:

#+begin_src sh
  jpm install sh
#+end_src

Results in the following:

#+begin_example
  $> jpm install sh
  error: Read-only file system: /gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/.cache
    in os/mkdir [src/core/os.c] on line 1981
    in download-bundle [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet] on line 200, column 3
    in bundle-install [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet] on line 217, column 13
    in resolve-bundle-name [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet] on line 118, column 20
    in resolve-bundle [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet] on line 148, column 9
    in bundle-install [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet] on line 216, column 4
    in install [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/commands.janet] (tail call) on line 190, column 20
    in run-main [boot.janet] on line 4432, column 16
    in cli-main [boot.janet] on line 4613, column 17
#+end_example

Could you please share an example code snippet which can be used to
verify correctness of the installation?

Additionally, it seems that the jpm repository comes with a test
(./test/installtest.janet and ./testinstall).  However, it doesn't seem
like we're running it during the build.  Could you please share the
reasons why?  If possible, we should enable and run these tests.

> +    (build-system copy-build-system)
> +    (arguments
> +     (list
> +      #:phases #~(modify-phases %standard-phases
> +		   (add-after 'unpack 'fix-prefix-path
> +		     (lambda _
> +		       (substitute* "configs/linux_config.janet"
> +			 (("/usr/local") #$output))
> +		       (setenv "PREFIX" #$output)))

> +		   (replace 'install
> +		     (lambda _ 

V3 doesn't cleanly apply due to whitespace issues on this (^) line.
Please fix.

On a related note, in case you're not aware, please observe all the
steps listed in
<https://guix.gnu.org/manual/devel/en/html_node/Submitting-Patches.html>.
Steps 3 and 4 recommend invoking guix lint and guix style which, unless
I'm mistaken, would've caught this issue.

-- 
Suhail




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH v5] gnu: add jpm package
  2024-09-01  8:31 [bug#72925] Adding JPM package for Janet Omar Bassam
                   ` (2 preceding siblings ...)
  2024-09-30  8:12 ` [bug#72925] [PATCH v3] adding jpm package Omar Bassam
@ 2024-10-02 14:36 ` Omar Bassam
  2024-10-02 14:50 ` [bug#72925] [PATCH v6] " Omar Bassam
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 30+ messages in thread
From: Omar Bassam @ 2024-10-02 14:36 UTC (permalink / raw)
  To: 72925
  Cc: Omar Bassam, Guillaume Le Vaillant, Katherine Cox-Buday,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/lisp.scm (jpm): New Variable

Change-Id: I730ef2f5c874c5142a580a42af76180e95d93ccd
---
 gnu/packages/lisp.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 6c16d8ab71..3f406c260a 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -29,6 +29,7 @@
 ;;; Copyright © 2024 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2024 bigbug <bigbookofbug@proton.me>
 ;;; Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se>
+;;; Copyright © 2024 Omar Bassam <omar.bassam88@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -917,6 +918,41 @@ (define-public janet
 assembler, PEG) is less than 1MB.")
     (license license:expat)))
 
+(define-public jpm
+  (package
+    (name "jpm")
+    (version "1.1.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/janet-lang/jpm.git")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256 (base32 "05rdxigmiy7vf93s16a8n2029lq33073jccz1rjl4iisxj6piw4l"))))
+    (build-system copy-build-system)
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (add-after 'unpack 'fix-prefix-path
+                     (lambda _
+                       (substitute* "configs/linux_config.janet"
+                         (("/usr/local") #$output))
+                       (setenv "PREFIX" #$output)))
+                   (replace 'install
+                     (lambda _
+                       (for-each (lambda (dir) (mkdir-p (string-append #$output "/" dir)))
+                                 '("lib/janet/jpm" "share/man/man1"))
+                       (invoke "janet" "bootstrap.janet" "configs/linux_config.janet")
+                       (wrap-program (string-append #$output "/bin/jpm")
+                         `("JANET_HEADERPATH" ":" = (,(string-append #$janet "/include/janet")))
+                         `("JANET_LIBPATH" ":" = (,(string-append #$janet "/lib")))))))))
+    (inputs (list janet))
+    (home-page "https://janet-lang.org/")
+    (synopsis "Janet Project Manager for the Janet programming language")
+    (description "JPM is the Janet Project Manager tool. It is for automating
+builds and downloading dependencies of Janet projects.")
+    (license license:expat)))
+
 (define-public lisp-repl-core-dumper
   (package
     (name "lisp-repl-core-dumper")

base-commit: 3d0668fe6667dabe71ee2840e75877f18399c1d9
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH v6] gnu: add jpm package
  2024-09-01  8:31 [bug#72925] Adding JPM package for Janet Omar Bassam
                   ` (3 preceding siblings ...)
  2024-10-02 14:36 ` [bug#72925] [PATCH v5] gnu: add " Omar Bassam
@ 2024-10-02 14:50 ` Omar Bassam
  2024-10-02 14:51 ` [bug#72925] [PATCH v7] " Omar Bassam
  2024-10-04 15:57 ` [bug#72925] [PATCH v8] " Omar Bassam
  6 siblings, 0 replies; 30+ messages in thread
From: Omar Bassam @ 2024-10-02 14:50 UTC (permalink / raw)
  To: 72925
  Cc: Omar Bassam, Guillaume Le Vaillant, Katherine Cox-Buday,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/lisp.scm (jpm): New Variable

Change-Id: I730ef2f5c874c5142a580a42af76180e95d93ccd
---
 gnu/packages/lisp.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 6c16d8ab71..3f406c260a 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -29,6 +29,7 @@
 ;;; Copyright © 2024 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2024 bigbug <bigbookofbug@proton.me>
 ;;; Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se>
+;;; Copyright © 2024 Omar Bassam <omar.bassam88@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -917,6 +918,41 @@ (define-public janet
 assembler, PEG) is less than 1MB.")
     (license license:expat)))
 
+(define-public jpm
+  (package
+    (name "jpm")
+    (version "1.1.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/janet-lang/jpm.git")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256 (base32 "05rdxigmiy7vf93s16a8n2029lq33073jccz1rjl4iisxj6piw4l"))))
+    (build-system copy-build-system)
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (add-after 'unpack 'fix-prefix-path
+                     (lambda _
+                       (substitute* "configs/linux_config.janet"
+                         (("/usr/local") #$output))
+                       (setenv "PREFIX" #$output)))
+                   (replace 'install
+                     (lambda _
+                       (for-each (lambda (dir) (mkdir-p (string-append #$output "/" dir)))
+                                 '("lib/janet/jpm" "share/man/man1"))
+                       (invoke "janet" "bootstrap.janet" "configs/linux_config.janet")
+                       (wrap-program (string-append #$output "/bin/jpm")
+                         `("JANET_HEADERPATH" ":" = (,(string-append #$janet "/include/janet")))
+                         `("JANET_LIBPATH" ":" = (,(string-append #$janet "/lib")))))))))
+    (inputs (list janet))
+    (home-page "https://janet-lang.org/")
+    (synopsis "Janet Project Manager for the Janet programming language")
+    (description "JPM is the Janet Project Manager tool. It is for automating
+builds and downloading dependencies of Janet projects.")
+    (license license:expat)))
+
 (define-public lisp-repl-core-dumper
   (package
     (name "lisp-repl-core-dumper")

base-commit: 3d0668fe6667dabe71ee2840e75877f18399c1d9
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH v7] gnu: add jpm package
  2024-09-01  8:31 [bug#72925] Adding JPM package for Janet Omar Bassam
                   ` (4 preceding siblings ...)
  2024-10-02 14:50 ` [bug#72925] [PATCH v6] " Omar Bassam
@ 2024-10-02 14:51 ` Omar Bassam
  2024-10-04 15:17   ` Omar Bassam
  2024-10-04 15:57 ` [bug#72925] [PATCH v8] " Omar Bassam
  6 siblings, 1 reply; 30+ messages in thread
From: Omar Bassam @ 2024-10-02 14:51 UTC (permalink / raw)
  To: 72925
  Cc: Omar Bassam, Guillaume Le Vaillant, Katherine Cox-Buday,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/lisp.scm (jpm): New Variable

Change-Id: I730ef2f5c874c5142a580a42af76180e95d93ccd
---
 gnu/packages/lisp.scm | 44 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 6c16d8ab71..f9ae0fe55a 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -29,6 +29,7 @@
 ;;; Copyright © 2024 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2024 bigbug <bigbookofbug@proton.me>
 ;;; Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se>
+;;; Copyright © 2024 Omar Bassam <omar.bassam88@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -917,6 +918,49 @@ (define-public janet
 assembler, PEG) is less than 1MB.")
     (license license:expat)))
 
+(define-public jpm
+  (package
+    (name "jpm")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/janet-lang/jpm.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "05rdxigmiy7vf93s16a8n2029lq33073jccz1rjl4iisxj6piw4l"))))
+    (build-system copy-build-system)
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (add-after 'unpack 'fix-prefix-path
+                     (lambda _
+                       (substitute* "configs/linux_config.janet"
+                         (("/usr/local")
+                          #$output))
+                       (setenv "PREFIX"
+                               #$output)))
+                   (replace 'install
+                     (lambda _
+                       (for-each (lambda (dir)
+                                   (mkdir-p (string-append #$output "/" dir)))
+                                 '("lib/janet/jpm" "share/man/man1"))
+                       (invoke "janet" "bootstrap.janet"
+                               "configs/linux_config.janet")
+                       (wrap-program (string-append #$output "/bin/jpm")
+                         `("JANET_HEADERPATH" ":" =
+                           (,(string-append #$janet "/include/janet")))
+                         `("JANET_LIBPATH" ":" =
+                           (,(string-append #$janet "/lib")))))))))
+    (inputs (list janet))
+    (home-page "https://janet-lang.org/")
+    (synopsis "Janet Project Manager for the Janet programming language")
+    (description "JPM is the Janet Project Manager tool.  It is for automating
+builds and downloading dependencies of Janet projects.")
+    (license license:expat)))
+
 (define-public lisp-repl-core-dumper
   (package
     (name "lisp-repl-core-dumper")

base-commit: 3d0668fe6667dabe71ee2840e75877f18399c1d9
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH v3] adding jpm package
  2024-10-01  0:06   ` Suhail Singh
@ 2024-10-02 15:09     ` Omar Bassam
  2024-10-02 18:21       ` Suhail Singh
  0 siblings, 1 reply; 30+ messages in thread
From: Omar Bassam @ 2024-10-02 15:09 UTC (permalink / raw)
  To: Suhail Singh
  Cc: Sharlatan Hellseher, 72925, Munyoki Kilyungi, Katherine Cox-Buday,
	Guillaume Le Vaillant, jgart

[-- Attachment #1: Type: text/plain, Size: 4798 bytes --]

Hi Suhail,
I just submitted a new patch (v7) applying your suggestions and running
guix lint and guix style.
regarding your questions. I'll try to answer them below:

On Tue, 1 Oct 2024 at 03:07, Suhail Singh <suhailsingh247@gmail.com> wrote:

> Omar, thank you for sending a revised patch.  I have a few comments
> relating to style and one unanswered question from our last exchange.
>
> > Subject: [bug#72925] [PATCH v3] adding jpm package
>
> In v4, could you please update the commit message to conform to the
> ChangeLog format as noted in
> <https://guix.gnu.org/manual/devel/en/html_node/Submitting-Patches.html>.
> Please see
> <https://www.gnu.org/prep/standards/html_node/Change-Logs.html#Change-Logs
> >
> for additional details.  If you're using magit,
> `magit-generate-changelog' can help with this.
>
> In your case the commit will probably look something like:
> #+begin_quote
>   gnu: Add jpm.
>
>   * gnu/packages/lisp.scm (jpm): New variable.
> #+end_quote
>
> Omar Bassam <omar.bassam88@gmail.com> writes:
>
> > +(define-public jpm
> > +  (package
> > +    (name "jpm")
> > +    (version "1.1.0")
> > +    (source (origin
> > +              (method git-fetch)
> > +              (uri (git-reference
> > +                    (url "https://github.com/janet-lang/jpm.git")
> > +                    (commit (string-append "v" version))))
> > +              (file-name (git-file-name name version))
> > +              (sha256 (base32
> "05rdxigmiy7vf93s16a8n2029lq33073jccz1rjl4iisxj6piw4l"))))
>
> There are no build errors with this, however, it's not clear how to
> verify that the runtime behaviour of jpm is as expected.  After
> installing janet and jpm in a guix profile, running a command such as:
>
> #+begin_src sh
>   jpm install sh
> #+end_src
>
> Results in the following:
>
> #+begin_example
>   $> jpm install sh
>   error: Read-only file system:
> /gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/.cache
>     in os/mkdir [src/core/os.c] on line 1981
>     in download-bundle
> [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet]
> on line 200, column 3
>     in bundle-install
> [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet]
> on line 217, column 13
>     in resolve-bundle-name
> [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet]
> on line 118, column 20
>     in resolve-bundle
> [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet]
> on line 148, column 9
>     in bundle-install
> [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet]
> on line 216, column 4
>     in install
> [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/commands.janet]
> (tail call) on line 190, column 20
>     in run-main [boot.janet] on line 4432, column 16
>     in cli-main [boot.janet] on line 4613, column 17
> #+end_example
>
> Could you please share an example code snippet which can be used to
> verify correctness of the installation?
>
>
This is expected as the jpm install command is meant to install janet
packages globally which would be impure.
To install janet packages to your local project directory, you need to add
the "-l" flag as follows:
jpm install -l sh

Alternatively you can also set the JPM_TREE environment variable to install
to a custom directory that you have access to.

Maybe in the future we can add a "janet-build-system" that will allow us to
add janet packages to the guix repository.


> Additionally, it seems that the jpm repository comes with a test
> (./test/installtest.janet and ./testinstall).  However, it doesn't seem
> like we're running it during the build.  Could you please share the
> reasons why?  If possible, we should enable and run these tests.
>
>
These tests are not testing the installation of jpm, they are only testing
the "jpm install" command which will not work as I explained above.


> > +    (build-system copy-build-system)
> > +    (arguments
> > +     (list
> > +      #:phases #~(modify-phases %standard-phases
> > +                (add-after 'unpack 'fix-prefix-path
> > +                  (lambda _
> > +                    (substitute* "configs/linux_config.janet"
> > +                      (("/usr/local") #$output))
> > +                    (setenv "PREFIX" #$output)))
>
> > +                (replace 'install
> > +                  (lambda _
>
> V3 doesn't cleanly apply due to whitespace issues on this (^) line.
> Please fix.
>
> On a related note, in case you're not aware, please observe all the
> steps listed in
> <https://guix.gnu.org/manual/devel/en/html_node/Submitting-Patches.html>.
> Steps 3 and 4 recommend invoking guix lint and guix style which, unless
> I'm mistaken, would've caught this issue.
>
> --
> Suhail
>

[-- Attachment #2: Type: text/html, Size: 6735 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH v3] adding jpm package
  2024-10-02 15:09     ` Omar Bassam
@ 2024-10-02 18:21       ` Suhail Singh
  2024-10-02 19:04         ` jgart via Guix-patches via
  2024-10-02 19:12         ` Omar Bassam
  0 siblings, 2 replies; 30+ messages in thread
From: Suhail Singh @ 2024-10-02 18:21 UTC (permalink / raw)
  To: Omar Bassam
  Cc: Sharlatan Hellseher, 72925, Munyoki Kilyungi, Katherine Cox-Buday,
	Guillaume Le Vaillant, jgart, Suhail Singh

Omar Bassam <omar.bassam88@gmail.com> writes:

> This is expected as the jpm install command is meant to install janet
> packages globally which would be impure.

It would help for this to be noted in some manner.  Be it in the
description or as comments in the package description.

> To install janet packages to your local project directory, you need to add
> the "-l" flag as follows:
> jpm install -l sh

Does this work for you (for jpm installed via guix)?  If so, could you
please confirm the set of dependencies you have installed in the guix
profile for the above to work?  If not, could you provide an example
invocation that I could test out which would allow me to install a janet
dependency in a local directory?

> Maybe in the future we can add a "janet-build-system" that will allow us to
> add janet packages to the guix repository.

That would be helpful.

-- 
Suhail




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH v3] adding jpm package
  2024-10-02 18:21       ` Suhail Singh
@ 2024-10-02 19:04         ` jgart via Guix-patches via
  2024-10-02 19:12         ` Omar Bassam
  1 sibling, 0 replies; 30+ messages in thread
From: jgart via Guix-patches via @ 2024-10-02 19:04 UTC (permalink / raw)
  To: Suhail Singh, Omar Bassam
  Cc: Sharlatan Hellseher, 72925, Munyoki Kilyungi, Katherine Cox-Buday,
	Guillaume Le Vaillant, Suhail Singh

[-- Attachment #1: Type: text/plain, Size: 561 bytes --]

(un)related to this,

what do people think of having language specific guides for using `guix shell` with particular programming languages?

not unlike this Nix guide that shows how to use Python in a `nix shell` to develop on a flask application:

https://nix.dev/guides/recipes/python-environment.html

would be cool to document the expected workflow for a Guix user using jpm and guix to develop on janet software, for example.

we can continue my thought on #guix-devel didn't mean to distract ;()

wdyt,

jgart

https://whereis.xn--q9jyb4c/

[-- Attachment #2: Type: text/html, Size: 1047 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH v3] adding jpm package
  2024-10-02 18:21       ` Suhail Singh
  2024-10-02 19:04         ` jgart via Guix-patches via
@ 2024-10-02 19:12         ` Omar Bassam
  2024-10-02 20:14           ` Suhail Singh
  1 sibling, 1 reply; 30+ messages in thread
From: Omar Bassam @ 2024-10-02 19:12 UTC (permalink / raw)
  To: Suhail Singh
  Cc: Sharlatan Hellseher, 72925, Munyoki Kilyungi, Katherine Cox-Buday,
	Guillaume Le Vaillant, jgart

[-- Attachment #1: Type: text/plain, Size: 2088 bytes --]

Hi Suhail,

Sorry if some of my instructions were not clear before. I'll try to explain
in more detail.

On Wed, 2 Oct 2024 at 21:21, Suhail Singh <suhailsingh247@gmail.com> wrote:

> Omar Bassam <omar.bassam88@gmail.com> writes:
>
> > This is expected as the jpm install command is meant to install janet
> > packages globally which would be impure.
>
> It would help for this to be noted in some manner.  Be it in the
> description or as comments in the package description.
>

I don't think this needs to be said because all package managers installed
via guix have this issue.
This is a common Nix/Guix issue that I struggled a lot to understand at the
beginning.
Also, there is no one way to solve this because jpm gives you the freedom
to install packages on a user level
or on a project only level.


> > To install janet packages to your local project directory, you need to
> add
> > the "-l" flag as follows:
> > jpm install -l sh
>
> Does this work for you (for jpm installed via guix)?  If so, could you
> please confirm the set of dependencies you have installed in the guix
> profile for the above to work?  If not, could you provide an example
> invocation that I could test out which would allow me to install a janet
> dependency in a local directory?
>

Do you still get the same error?
Yes, this does work for me without any other dependencies. I am using guix
on ubuntu with guix shell.
It should create a "jpm_tree" folder in the directory where you invoked the
command from.
Alternatively you can set the "JANET_TREE" environment variable before
invoking the command. For example:
JANET_TREE=~/.jpm jpm install sh

Also, note that janet is a lisp that compiles to C. So, if the library you
are trying to install has other dependencies,
you'll need to have those available in your profile/shell.



> > Maybe in the future we can add a "janet-build-system" that will allow us
> to
> > add janet packages to the guix repository.
>
> That would be helpful.
>
Yes, indeed. I don't have much experience about that yet. But I plan to do
so in the future.

> --
> Suhail
>

[-- Attachment #2: Type: text/html, Size: 3270 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH v3] adding jpm package
  2024-10-02 19:12         ` Omar Bassam
@ 2024-10-02 20:14           ` Suhail Singh
  2024-10-02 20:27             ` Omar Bassam
  2024-10-02 20:27             ` [bug#72925] [PATCH v3] adding jpm package jgart via Guix-patches via
  0 siblings, 2 replies; 30+ messages in thread
From: Suhail Singh @ 2024-10-02 20:14 UTC (permalink / raw)
  To: Omar Bassam
  Cc: Sharlatan Hellseher, 72925, Munyoki Kilyungi, Katherine Cox-Buday,
	Guillaume Le Vaillant, jgart, Suhail Singh

Omar Bassam <omar.bassam88@gmail.com> writes:

>> > This is expected as the jpm install command is meant to install janet
>> > packages globally which would be impure.
>>
>> It would help for this to be noted in some manner.  Be it in the
>> description or as comments in the package description.
>
> I don't think this needs to be said because all package managers installed
> via guix have this issue.

For me, someone familiar with Guix, but unfamiliar with Janet and JPM
defaults, it wasn't obvious that I needed to add "-l" to the invocation.

I don't believe such a message is necessary, but it would be helpful to
some (those individuals who aren't familiar with both JPM and Guix).

> Also, there is no one way to solve this because jpm gives you the freedom
> to install packages on a user level
> or on a project only level.

The fact that JPM doesn't install packages at a user level by default
was not something I knew previously.

>> > To install janet packages to your local project directory, you need to
>> add
>> > the "-l" flag as follows:
>> > jpm install -l sh
>>
>> Does this work for you (for jpm installed via guix)?  If so, could you
>> please confirm the set of dependencies you have installed in the guix
>> profile for the above to work?  If not, could you provide an example
>> invocation that I could test out which would allow me to install a janet
>> dependency in a local directory?
>
> Do you still get the same error?

No, a different one.

> Yes, this does work for me without any other dependencies. I am using guix
> on ubuntu with guix shell.

I am running guix-shell (--pure) with the following dependencies
installed:
- janet
- gcc-toolchain gcc-toolchain:static
- openssl
- git
- jpm
- bash coreutils
- curl nss-certs

With the above, when running "jpm --local install sh" I observe the
following error:

#+begin_example
  error: ( "cc"
    "-std=c99"
    "-I/gnu/store/rdlvs1p09brkk961lj3vncifb4xlsmm5-janet-1.36.0/include/janet"
    "-I/tmp/review-72925/jpm_tree/lib"
    "-O2"
    "-o"
    "build/_jmod_posix_spawn.so"
    "build/posix-spawn.o"
    "-shared"
    "-pthread"): No such file or directory
  error: build fail
    in pdag [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/dagbuild.janet] (tail call) on line 79, column 23
    in with-dyns [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet] on line 236, column 9
    in defer [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet] on line 221, column 5
    in bundle-install [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet] on line 219, column 3
    in with-dyns [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet] on line 234, column 13
    in defer [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet] on line 221, column 5
    in bundle-install [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet] on line 219, column 3
    in install [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/commands.janet] (tail call) on line 190, column 20
    in run-main [boot.janet] on line 4432, column 16
    in cli-main [boot.janet] on line 4613, column 17
#+end_example

When running "jpm --cc=gcc --local install sh" I get the same error.

I was finally able to get it to succeed by having cc symlink to gcc and
adding the directory containing the symlink to PATH.  So I believe that
the package definition you've submitted is correct.  However, I'm
wondering what (if anything) needs to be done about the issue I
encountered.

Specifically, it's unclear why passing "-cc=gcc" didn't work (nor did
setting "CC=gcc", but perhaps JPM ignores the latter?).  Is this an
upstream bug?  Were my expectations misplaced?  Should the JPM package
in Guix provide "cc" as well?

-- 
Suhail




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH v3] adding jpm package
  2024-10-02 20:14           ` Suhail Singh
@ 2024-10-02 20:27             ` Omar Bassam
  2024-10-02 20:33               ` jgart via Guix-patches via
  2024-10-02 21:39               ` Suhail Singh
  2024-10-02 20:27             ` [bug#72925] [PATCH v3] adding jpm package jgart via Guix-patches via
  1 sibling, 2 replies; 30+ messages in thread
From: Omar Bassam @ 2024-10-02 20:27 UTC (permalink / raw)
  To: Suhail Singh
  Cc: Sharlatan Hellseher, 72925, Munyoki Kilyungi, Katherine Cox-Buday,
	Guillaume Le Vaillant, jgart

[-- Attachment #1: Type: text/plain, Size: 4771 bytes --]

On Wed, 2 Oct 2024 at 23:14, Suhail Singh <suhailsingh247@gmail.com> wrote:

> Omar Bassam <omar.bassam88@gmail.com> writes:
>
> >> > This is expected as the jpm install command is meant to install janet
> >> > packages globally which would be impure.
> >>
> >> It would help for this to be noted in some manner.  Be it in the
> >> description or as comments in the package description.
> >
> > I don't think this needs to be said because all package managers
> installed
> > via guix have this issue.
>
> For me, someone familiar with Guix, but unfamiliar with Janet and JPM
> defaults, it wasn't obvious that I needed to add "-l" to the invocation.
>
> I don't believe such a message is necessary, but it would be helpful to
> some (those individuals who aren't familiar with both JPM and Guix).
>

This is where jgart suggestion would be really helpful. I am personally
working on a project
https://lisp-spectrum.org/ where I try to document all the struggles that I
had with the Lisp ecosystem
and try to make it more accessible to new users. (Any contributions are
welcomed of course).


>
> > Also, there is no one way to solve this because jpm gives you the freedom
> > to install packages on a user level
> > or on a project only level.
>
> The fact that JPM doesn't install packages at a user level by default
> was not something I knew previously.
>
> >> > To install janet packages to your local project directory, you need to
> >> add
> >> > the "-l" flag as follows:
> >> > jpm install -l sh
> >>
> >> Does this work for you (for jpm installed via guix)?  If so, could you
> >> please confirm the set of dependencies you have installed in the guix
> >> profile for the above to work?  If not, could you provide an example
> >> invocation that I could test out which would allow me to install a janet
> >> dependency in a local directory?
> >
> > Do you still get the same error?
>
> No, a different one.
>
> > Yes, this does work for me without any other dependencies. I am using
> guix
> > on ubuntu with guix shell.
>
> I am running guix-shell (--pure) with the following dependencies
> installed:
> - janet
> - gcc-toolchain gcc-toolchain:static
> - openssl
> - git
> - jpm
> - bash coreutils
> - curl nss-certs
>
> With the above, when running "jpm --local install sh" I observe the
> following error:
>
> #+begin_example
>   error: ( "cc"
>     "-std=c99"
>
> "-I/gnu/store/rdlvs1p09brkk961lj3vncifb4xlsmm5-janet-1.36.0/include/janet"
>     "-I/tmp/review-72925/jpm_tree/lib"
>     "-O2"
>     "-o"
>     "build/_jmod_posix_spawn.so"
>     "build/posix-spawn.o"
>     "-shared"
>     "-pthread"): No such file or directory
>   error: build fail
>     in pdag
> [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/dagbuild.janet]
> (tail call) on line 79, column 23
>     in with-dyns
> [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet]
> on line 236, column 9
>     in defer
> [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet]
> on line 221, column 5
>     in bundle-install
> [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet]
> on line 219, column 3
>     in with-dyns
> [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet]
> on line 234, column 13
>     in defer
> [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet]
> on line 221, column 5
>     in bundle-install
> [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/pm.janet]
> on line 219, column 3
>     in install
> [/gnu/store/ffmis4y6rld42biqx5lq4nvsjp0bqiq6-jpm-1.1.0/lib/janet/jpm/commands.janet]
> (tail call) on line 190, column 20
>     in run-main [boot.janet] on line 4432, column 16
>     in cli-main [boot.janet] on line 4613, column 17
> #+end_example
>
> When running "jpm --cc=gcc --local install sh" I get the same error.
>
> I was finally able to get it to succeed by having cc symlink to gcc and
> adding the directory containing the symlink to PATH.  So I believe that
> the package definition you've submitted is correct.  However, I'm
> wondering what (if anything) needs to be done about the issue I
> encountered.
>
> Specifically, it's unclear why passing "-cc=gcc" didn't work (nor did
> setting "CC=gcc", but perhaps JPM ignores the latter?).  Is this an
> upstream bug?  Were my expectations misplaced?  Should the JPM package
> in Guix provide "cc" as well?
>

No, this is not really a Janet or JPM issue but rather the fact that you
are overriding the gcc compiler with a symlinked binary
instead of the absolute path. I faced this issue as well with
LD_LIBRARY_PATH where you have to use "readlink" to point it
to the absolute path of the "lib" folder in your guix profile.


> --
> Suhail
>

[-- Attachment #2: Type: text/html, Size: 6244 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH v3] adding jpm package
  2024-10-02 20:14           ` Suhail Singh
  2024-10-02 20:27             ` Omar Bassam
@ 2024-10-02 20:27             ` jgart via Guix-patches via
  1 sibling, 0 replies; 30+ messages in thread
From: jgart via Guix-patches via @ 2024-10-02 20:27 UTC (permalink / raw)
  To: Suhail Singh, Omar Bassam
  Cc: Sharlatan Hellseher, 72925, Munyoki Kilyungi, Katherine Cox-Buday,
	Guillaume Le Vaillant, Suhail Singh

[-- Attachment #1: Type: text/plain, Size: 252 bytes --]

> 
> upstream bug? Were my expectations misplaced?
> 
Suhail,

These are all very good points.

Excuse the brevity as i am going on a hiking trip and need to prepare now,

jgart

PS. I'll be away till the 8th.

https://whereis.xn--q9jyb4c/

[-- Attachment #2: Type: text/html, Size: 610 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH v3] adding jpm package
  2024-10-02 20:27             ` Omar Bassam
@ 2024-10-02 20:33               ` jgart via Guix-patches via
  2024-10-02 21:39               ` Suhail Singh
  1 sibling, 0 replies; 30+ messages in thread
From: jgart via Guix-patches via @ 2024-10-02 20:33 UTC (permalink / raw)
  To: Omar Bassam, Suhail Singh
  Cc: 72925, Guillaume Le Vaillant, Munyoki Kilyungi,
	Katherine Cox-Buday, Sharlatan Hellseher

[-- Attachment #1: Type: text/plain, Size: 649 bytes --]

> 
> This is where jgart suggestion would be really helpful. I am personally working on a project
> https://lisp-spectrum.org/ where I try to document all the struggles that I had with the Lisp ecosystem
> and try to make it more accessible to new users. (Any contributions are welcomed of course).
>  
> 
> > 
> > 
> >
> 
That's a cool site. Let me get back to you on it once I am back from my hiking trip.

Thanks for sharing. I usually hang out at #whereiseveryone on irc.libera.chat.

Feel free to join me there or send me a personal email or I will once I am back on the 8th.

all best,

jgart

https://whereis.xn--q9jyb4c/

[-- Attachment #2: Type: text/html, Size: 1259 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH v3] adding jpm package
  2024-10-02 20:27             ` Omar Bassam
  2024-10-02 20:33               ` jgart via Guix-patches via
@ 2024-10-02 21:39               ` Suhail Singh
  2024-10-02 21:52                 ` Omar Bassam
  1 sibling, 1 reply; 30+ messages in thread
From: Suhail Singh @ 2024-10-02 21:39 UTC (permalink / raw)
  To: Omar Bassam
  Cc: Sharlatan Hellseher, 72925, Munyoki Kilyungi, Katherine Cox-Buday,
	Guillaume Le Vaillant, jgart, Suhail Singh

Omar Bassam <omar.bassam88@gmail.com> writes:

>> When running "jpm --cc=gcc --local install sh" I get the same error.
>>
>> I was finally able to get it to succeed by having cc symlink to gcc and
>> adding the directory containing the symlink to PATH.  So I believe that
>> the package definition you've submitted is correct.  However, I'm
>> wondering what (if anything) needs to be done about the issue I
>> encountered.
>>
>> Specifically, it's unclear why passing "-cc=gcc" didn't work (nor did
>> setting "CC=gcc", but perhaps JPM ignores the latter?).  Is this an
>> upstream bug?  Were my expectations misplaced?  Should the JPM package
>> in Guix provide "cc" as well?
>>
>
> No, this is not really a Janet or JPM issue but rather the fact that
> you are overriding the gcc compiler with a symlinked binary instead of
> the absolute path.

I don't understand.

All four variants below fail in exactly the same way:

#+begin_src sh
  jpm --cc=gcc -l install sh
#+end_src

#+begin_src sh
  jpm --cc=/home/user/.guix-profile/bin/gcc -l install sh
#+end_src

#+begin_src sh
  jpm --cc=/gnu/store/x2kv3zw2k7ql211m5kvb6yw401gab0x9-gcc-toolchain-14.2.0/bin/gcc -l install sh
#+end_src

#+begin_src sh
  jpm --cc=/gnu/store/lq9y7sd4mvffs4hqp3hkr9fnd384pnkj-gcc-14.2.0/bin/gcc -l install sh
#+end_src

Note that the last variant uses an absolute path.

Either I'm not using the "--cc" option correctly.  Or for some
dependency of "sh" (specifically, posix-spawn) the compiler has been
hardcoded to "cc" and it's not picking up the option being passed to
jpm.

Further, if the above work for you in a "--pure" guix shell (where it
doesn't for me), that's surprising.

It is _only_ when I provide a fake "cc" (which is simply a symlink to
gcc) that things work.

-- 
Suhail




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH v3] adding jpm package
  2024-10-02 21:39               ` Suhail Singh
@ 2024-10-02 21:52                 ` Omar Bassam
  2024-10-02 22:07                   ` Suhail Singh
  0 siblings, 1 reply; 30+ messages in thread
From: Omar Bassam @ 2024-10-02 21:52 UTC (permalink / raw)
  To: Suhail Singh
  Cc: Sharlatan Hellseher, 72925, Munyoki Kilyungi, Katherine Cox-Buday,
	Guillaume Le Vaillant, jgart

[-- Attachment #1: Type: text/plain, Size: 2357 bytes --]

On Thu, 3 Oct 2024 at 00:39, Suhail Singh <suhailsingh247@gmail.com> wrote:

> Omar Bassam <omar.bassam88@gmail.com> writes:
>
> >> When running "jpm --cc=gcc --local install sh" I get the same error.
> >>
> >> I was finally able to get it to succeed by having cc symlink to gcc and
> >> adding the directory containing the symlink to PATH.  So I believe that
> >> the package definition you've submitted is correct.  However, I'm
> >> wondering what (if anything) needs to be done about the issue I
> >> encountered.
> >>
> >> Specifically, it's unclear why passing "-cc=gcc" didn't work (nor did
> >> setting "CC=gcc", but perhaps JPM ignores the latter?).  Is this an
> >> upstream bug?  Were my expectations misplaced?  Should the JPM package
> >> in Guix provide "cc" as well?
> >>
> >
> > No, this is not really a Janet or JPM issue but rather the fact that
> > you are overriding the gcc compiler with a symlinked binary instead of
> > the absolute path.
>
> I don't understand.
>
> All four variants below fail in exactly the same way:
>
> #+begin_src sh
>   jpm --cc=gcc -l install sh
> #+end_src
>
> #+begin_src sh
>   jpm --cc=/home/user/.guix-profile/bin/gcc -l install sh
> #+end_src
>
> #+begin_src sh
>   jpm
> --cc=/gnu/store/x2kv3zw2k7ql211m5kvb6yw401gab0x9-gcc-toolchain-14.2.0/bin/gcc
> -l install sh
> #+end_src
>
> #+begin_src sh
>   jpm --cc=/gnu/store/lq9y7sd4mvffs4hqp3hkr9fnd384pnkj-gcc-14.2.0/bin/gcc
> -l install sh
> #+end_src
>
> Note that the last variant uses an absolute path.
>
> Either I'm not using the "--cc" option correctly.  Or for some
> dependency of "sh" (specifically, posix-spawn) the compiler has been
> hardcoded to "cc" and it's not picking up the option being passed to
> jpm.
>
> Further, if the above work for you in a "--pure" guix shell (where it
> doesn't for me), that's surprising.
>
> It is _only_ when I provide a fake "cc" (which is simply a symlink to
> gcc) that things work.
>
> --
> Suhail
>

I believe this is a library specific thing. I don't think this should be
related to this patch.
Also, if you are running a guix shell with --pure flag, try adding
coreutils to your shell because jpm calls the "cp" command when building
libraries.
I tried with "jpm install -l spork" and with "jpm install -l sh" and it
works fine. I believe the --cc flag is meant to be used for the jpm build
command.

[-- Attachment #2: Type: text/html, Size: 3228 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH v3] adding jpm package
  2024-10-02 21:52                 ` Omar Bassam
@ 2024-10-02 22:07                   ` Suhail Singh
  2024-10-03  1:40                     ` Suhail Singh
  0 siblings, 1 reply; 30+ messages in thread
From: Suhail Singh @ 2024-10-02 22:07 UTC (permalink / raw)
  To: Omar Bassam
  Cc: Sharlatan Hellseher, 72925, Munyoki Kilyungi, Katherine Cox-Buday,
	Guillaume Le Vaillant, jgart, Suhail Singh

Omar Bassam <omar.bassam88@gmail.com> writes:

> I don't think this should be related to this patch.

As I mentioned previously, I believe your packaging of "jpm" is
correctly done.  I was hoping to get some understanding as to why it
doesn't work as expected, however.

> Also, if you are running a guix shell with --pure flag, try adding
> coreutils to your shell because jpm calls the "cp" command when building
> libraries.

As noted previously, coreutils is included as a dependency in the
profile.

> I tried with "jpm install -l spork" and with "jpm install -l sh" and it
> works fine.

Both fail for me.

Is my understanding correct that you're not using a "--pure" shell and,
thus, have "cc" provided by the system?  Could you please share the
output of "type cc" in the environment where you ran the above jpm
commands?

> I believe the --cc flag is meant to be used for the jpm build command.

Even though it's listed under "Global options" for jpm?  Interesting.
If true, that would certainly explain why passing --cc didn't seem to
help.

-- 
Suhail




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH v3] adding jpm package
  2024-10-02 22:07                   ` Suhail Singh
@ 2024-10-03  1:40                     ` Suhail Singh
  2024-10-03  7:14                       ` Omar Bassam
  0 siblings, 1 reply; 30+ messages in thread
From: Suhail Singh @ 2024-10-03  1:40 UTC (permalink / raw)
  To: Suhail Singh
  Cc: Sharlatan Hellseher, 72925, Munyoki Kilyungi, Katherine Cox-Buday,
	Guillaume Le Vaillant, jgart, Omar Bassam

Suhail Singh <suhailsingh247@gmail.com> writes:

>> I don't think this should be related to this patch.
>
> As I mentioned previously, I believe your packaging of "jpm" is
> correctly done.

After having taken a look at the source of JPM, I believe I was
previously mistaken.  I don't believe the JPM packaging is correct.  And
I do believe that the issue I was observing is related to the patch.

Specifically, in the file "configs/linux_config.janet", among other
things, the below are set

#+begin_src janet
   :c++ "c++"
   :c++-link "c++"
   :cc "cc"
   :cc-link "cc"
#+end_src

Since Guix, as far as I know, doesn't have packages that provide c++ nor
cc, I believe the above need to be patched to refer to gcc and g++
respectively.

Further, I believe JPM should have a few propagated inputs:
- gcc-toolchain
- curl
- git
- nss-certs.

Please address the above two in v8 if you agree.  If not, please help me
understand where I may have erred in the analysis above.

-- 
Suhail




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH v3] adding jpm package
  2024-10-03  1:40                     ` Suhail Singh
@ 2024-10-03  7:14                       ` Omar Bassam
  2024-10-03 13:40                         ` [bug#72925] Adding JPM package for Janet Suhail Singh
  0 siblings, 1 reply; 30+ messages in thread
From: Omar Bassam @ 2024-10-03  7:14 UTC (permalink / raw)
  To: Suhail Singh
  Cc: Sharlatan Hellseher, 72925, Munyoki Kilyungi, Katherine Cox-Buday,
	Guillaume Le Vaillant, jgart

[-- Attachment #1: Type: text/plain, Size: 1634 bytes --]

Hi Suhail,
I just have some questions before submitting v8 if you don't mind. just to
make sure I understand correctly.

On Thu, 3 Oct 2024 at 04:40, Suhail Singh <suhailsingh247@gmail.com> wrote:

> Suhail Singh <suhailsingh247@gmail.com> writes:
>
> >> I don't think this should be related to this patch.
> >
> > As I mentioned previously, I believe your packaging of "jpm" is
> > correctly done.
>
> After having taken a look at the source of JPM, I believe I was
> previously mistaken.  I don't believe the JPM packaging is correct.  And
> I do believe that the issue I was observing is related to the patch.
>
> Specifically, in the file "configs/linux_config.janet", among other
> things, the below are set
>
> #+begin_src janet
>    :c++ "c++"
>    :c++-link "c++"
>    :cc "cc"
>    :cc-link "cc"
> #+end_src
>
> Since Guix, as far as I know, doesn't have packages that provide c++ nor
> cc, I believe the above need to be patched to refer to gcc and g++
> respectively.
>
> So we need to substitute the above "c++" and "cc" in the
"configs/linux_config.janet" to point to the absolute path for the gcc and
g++ packages?
Should we also replace other commands that are hard-coded like "cp" and
"chown" from coreutils the same way I did in my first initial patch?

Further, I believe JPM should have a few propagated inputs:
> - gcc-toolchain
> - curl
> - git
> - nss-certs.
>
> I understand why we need gcc-toolchain. But why do we need curl, git and
nss-certs?

Please address the above two in v8 if you agree.  If not, please help me
> understand where I may have erred in the analysis above.
>
> --
> Suhail
>

Thanks,
Omar

[-- Attachment #2: Type: text/html, Size: 2800 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#72925] Adding JPM package for Janet
  2024-10-03  7:14                       ` Omar Bassam
@ 2024-10-03 13:40                         ` Suhail Singh
  2024-10-03 19:45                           ` Omar Bassam
  0 siblings, 1 reply; 30+ messages in thread
From: Suhail Singh @ 2024-10-03 13:40 UTC (permalink / raw)
  To: Omar Bassam
  Cc: Sharlatan Hellseher, 72925, Guillaume Le Vaillant,
	Katherine Cox-Buday, Munyoki Kilyungi, jgart, Suhail Singh

Omar Bassam <omar.bassam88@gmail.com> writes:

> I just have some questions before submitting v8 if you don't mind. just to
> make sure I understand correctly.

Questions are always welcome :)

>> Specifically, in the file "configs/linux_config.janet", among other
>> things, the below are set
>>
>> #+begin_src janet
>>    :c++ "c++"
>>    :c++-link "c++"
>>    :cc "cc"
>>    :cc-link "cc"
>> #+end_src
>>
>> Since Guix, as far as I know, doesn't have packages that provide c++ nor
>> cc, I believe the above need to be patched to refer to gcc and g++
>> respectively.
>>
>> So we need to substitute the above "c++" and "cc" in the
> "configs/linux_config.janet" to point to the absolute path for the gcc and
> g++ packages?

I believe there are multiple ways to make this work.  I haven't tested
this, so take my opinions as speculative.

If we replace "cc" and "c++" with the _absolute path_ for "gcc" and
"g++" respectively from the Guix store, then I don't think we need to
specify gcc-toolchain as a propagated input.  Upon reflecting on this,
this is probably the better approach.

If, however, we replace "cc" and "c++" with the _strings_ "gcc" and
"g++", then I believe we may need to specify gcc-toolchain in the
propagated inputs.  IIUC, in this case we would replace the command that
JPM invokes when building.  By additionally having gcc-toolchain in the
propagated inputs we'll ensure that they're available in the PATH.

> Should we also replace other commands that are hard-coded like "cp" and
> "chown" from coreutils the same way I did in my first initial patch?

I don't believe this is necessary.  There's a question regd. whether or
not coreutils needs to be added to the propagated inputs, however.  I
don't have a definitive answer, but the way to test it would be to run
it in a pure container and see if things work without having to
explicitly specify coreutils.  If you're unable to test it, let me know
when you send v8 and I can test it on your behalf.

For reference, I use something like the below:
#+begin_src sh
  guix shell --pure -CPWN \
    -E '.*GTK.*|.*XDG.*|.*DISPLAY.*|TERM|INSIDE_EMACS' \
    -p /path/to/profile
#+end_src

> Further, I believe JPM should have a few propagated inputs:
>> - gcc-toolchain
>> - curl
>> - git
>> - nss-certs.
>>
>> I understand why we need gcc-toolchain. But why do we need curl, git and
> nss-certs?

linux_config.janet also specifies:

#+begin_src janet
   ...
   :curlpath "curl"
   ...
   :gitpath "git"
   ...
#+end_src

Whether Guix packaging picks these up automatically or not, I haven't
tested, but it seems for common usage of JPM these dependencies ought to
be available.  Similar to the case of "gcc" and "g++", it might be
better to replace these with references to the respective binaries in
the Guix store instead (as opposed to propagating them as I had
previously suggested).

Regarding nss-certs, it provides certificates for Certification
Authorities which, IIUC, would be relevant for HTTPS URLs (e.g. fetching
dependencies over git+https).

To summarize, here's what I believe is needed.  Add nss-certs to the
propagated inputs, and for the below replace their occurrence in
linux_config.janet with references to binaries in the store:
- cc -> absolute path of gcc
- c++ -> absolute path of g++
- curl -> absolute path of curl
- git -> absolute path of git

-- 
Suhail




^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#72925] Adding JPM package for Janet
  2024-10-03 13:40                         ` [bug#72925] Adding JPM package for Janet Suhail Singh
@ 2024-10-03 19:45                           ` Omar Bassam
  2024-10-03 22:04                             ` Omar Bassam
  0 siblings, 1 reply; 30+ messages in thread
From: Omar Bassam @ 2024-10-03 19:45 UTC (permalink / raw)
  To: Suhail Singh
  Cc: Sharlatan Hellseher, 72925, Guillaume Le Vaillant,
	Katherine Cox-Buday, Munyoki Kilyungi, jgart

[-- Attachment #1: Type: text/plain, Size: 4129 bytes --]

Hi Suhail,
I really need some help here.
I am having trouble using gcc-toolchain because when I add the (gnu
packages commencement) modules to the lisp.scm file I get a lot of errors
that I don't understand.
I was able to create a local manifest file with the definition of my
package and made the substitutions you suggested and added the propagated
input and it worked fine.
The issue that I'm having now is to include it in the lisp.scm file.
Can you tell what's the right use-module form I need to use?

On Thu, 3 Oct 2024 at 16:40, Suhail Singh <suhailsingh247@gmail.com> wrote:

> Omar Bassam <omar.bassam88@gmail.com> writes:
>
> > I just have some questions before submitting v8 if you don't mind. just
> to
> > make sure I understand correctly.
>
> Questions are always welcome :)
>
> >> Specifically, in the file "configs/linux_config.janet", among other
> >> things, the below are set
> >>
> >> #+begin_src janet
> >>    :c++ "c++"
> >>    :c++-link "c++"
> >>    :cc "cc"
> >>    :cc-link "cc"
> >> #+end_src
> >>
> >> Since Guix, as far as I know, doesn't have packages that provide c++ nor
> >> cc, I believe the above need to be patched to refer to gcc and g++
> >> respectively.
> >>
> >> So we need to substitute the above "c++" and "cc" in the
> > "configs/linux_config.janet" to point to the absolute path for the gcc
> and
> > g++ packages?
>
> I believe there are multiple ways to make this work.  I haven't tested
> this, so take my opinions as speculative.
>
> If we replace "cc" and "c++" with the _absolute path_ for "gcc" and
> "g++" respectively from the Guix store, then I don't think we need to
> specify gcc-toolchain as a propagated input.  Upon reflecting on this,
> this is probably the better approach.
>
> If, however, we replace "cc" and "c++" with the _strings_ "gcc" and
> "g++", then I believe we may need to specify gcc-toolchain in the
> propagated inputs.  IIUC, in this case we would replace the command that
> JPM invokes when building.  By additionally having gcc-toolchain in the
> propagated inputs we'll ensure that they're available in the PATH.
>
> > Should we also replace other commands that are hard-coded like "cp" and
> > "chown" from coreutils the same way I did in my first initial patch?
>
> I don't believe this is necessary.  There's a question regd. whether or
> not coreutils needs to be added to the propagated inputs, however.  I
> don't have a definitive answer, but the way to test it would be to run
> it in a pure container and see if things work without having to
> explicitly specify coreutils.  If you're unable to test it, let me know
> when you send v8 and I can test it on your behalf.
>
> For reference, I use something like the below:
> #+begin_src sh
>   guix shell --pure -CPWN \
>     -E '.*GTK.*|.*XDG.*|.*DISPLAY.*|TERM|INSIDE_EMACS' \
>     -p /path/to/profile
> #+end_src
>
> > Further, I believe JPM should have a few propagated inputs:
> >> - gcc-toolchain
> >> - curl
> >> - git
> >> - nss-certs.
> >>
> >> I understand why we need gcc-toolchain. But why do we need curl, git and
> > nss-certs?
>
> linux_config.janet also specifies:
>
> #+begin_src janet
>    ...
>    :curlpath "curl"
>    ...
>    :gitpath "git"
>    ...
> #+end_src
>
> Whether Guix packaging picks these up automatically or not, I haven't
> tested, but it seems for common usage of JPM these dependencies ought to
> be available.  Similar to the case of "gcc" and "g++", it might be
> better to replace these with references to the respective binaries in
> the Guix store instead (as opposed to propagating them as I had
> previously suggested).
>
> Regarding nss-certs, it provides certificates for Certification
> Authorities which, IIUC, would be relevant for HTTPS URLs (e.g. fetching
> dependencies over git+https).
>
> To summarize, here's what I believe is needed.  Add nss-certs to the
> propagated inputs, and for the below replace their occurrence in
> linux_config.janet with references to binaries in the store:
> - cc -> absolute path of gcc
> - c++ -> absolute path of g++
> - curl -> absolute path of curl
> - git -> absolute path of git
>
> --
> Suhail
>

[-- Attachment #2: Type: text/html, Size: 5346 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#72925] Adding JPM package for Janet
  2024-10-03 19:45                           ` Omar Bassam
@ 2024-10-03 22:04                             ` Omar Bassam
  2024-10-04 16:00                               ` Omar Bassam
  0 siblings, 1 reply; 30+ messages in thread
From: Omar Bassam @ 2024-10-03 22:04 UTC (permalink / raw)
  To: Suhail Singh
  Cc: Sharlatan Hellseher, 72925, Guillaume Le Vaillant,
	Katherine Cox-Buday, Munyoki Kilyungi, jgart

[-- Attachment #1: Type: text/plain, Size: 4400 bytes --]

It's OK I figured it out now. I'll be posting the patch soon.

On Thu, 3 Oct 2024 at 22:45, Omar Bassam <omar.bassam88@gmail.com> wrote:

> Hi Suhail,
> I really need some help here.
> I am having trouble using gcc-toolchain because when I add the (gnu
> packages commencement) modules to the lisp.scm file I get a lot of errors
> that I don't understand.
> I was able to create a local manifest file with the definition of my
> package and made the substitutions you suggested and added the propagated
> input and it worked fine.
> The issue that I'm having now is to include it in the lisp.scm file.
> Can you tell what's the right use-module form I need to use?
>
> On Thu, 3 Oct 2024 at 16:40, Suhail Singh <suhailsingh247@gmail.com>
> wrote:
>
>> Omar Bassam <omar.bassam88@gmail.com> writes:
>>
>> > I just have some questions before submitting v8 if you don't mind. just
>> to
>> > make sure I understand correctly.
>>
>> Questions are always welcome :)
>>
>> >> Specifically, in the file "configs/linux_config.janet", among other
>> >> things, the below are set
>> >>
>> >> #+begin_src janet
>> >>    :c++ "c++"
>> >>    :c++-link "c++"
>> >>    :cc "cc"
>> >>    :cc-link "cc"
>> >> #+end_src
>> >>
>> >> Since Guix, as far as I know, doesn't have packages that provide c++
>> nor
>> >> cc, I believe the above need to be patched to refer to gcc and g++
>> >> respectively.
>> >>
>> >> So we need to substitute the above "c++" and "cc" in the
>> > "configs/linux_config.janet" to point to the absolute path for the gcc
>> and
>> > g++ packages?
>>
>> I believe there are multiple ways to make this work.  I haven't tested
>> this, so take my opinions as speculative.
>>
>> If we replace "cc" and "c++" with the _absolute path_ for "gcc" and
>> "g++" respectively from the Guix store, then I don't think we need to
>> specify gcc-toolchain as a propagated input.  Upon reflecting on this,
>> this is probably the better approach.
>>
>> If, however, we replace "cc" and "c++" with the _strings_ "gcc" and
>> "g++", then I believe we may need to specify gcc-toolchain in the
>> propagated inputs.  IIUC, in this case we would replace the command that
>> JPM invokes when building.  By additionally having gcc-toolchain in the
>> propagated inputs we'll ensure that they're available in the PATH.
>>
>> > Should we also replace other commands that are hard-coded like "cp" and
>> > "chown" from coreutils the same way I did in my first initial patch?
>>
>> I don't believe this is necessary.  There's a question regd. whether or
>> not coreutils needs to be added to the propagated inputs, however.  I
>> don't have a definitive answer, but the way to test it would be to run
>> it in a pure container and see if things work without having to
>> explicitly specify coreutils.  If you're unable to test it, let me know
>> when you send v8 and I can test it on your behalf.
>>
>> For reference, I use something like the below:
>> #+begin_src sh
>>   guix shell --pure -CPWN \
>>     -E '.*GTK.*|.*XDG.*|.*DISPLAY.*|TERM|INSIDE_EMACS' \
>>     -p /path/to/profile
>> #+end_src
>>
>> > Further, I believe JPM should have a few propagated inputs:
>> >> - gcc-toolchain
>> >> - curl
>> >> - git
>> >> - nss-certs.
>> >>
>> >> I understand why we need gcc-toolchain. But why do we need curl, git
>> and
>> > nss-certs?
>>
>> linux_config.janet also specifies:
>>
>> #+begin_src janet
>>    ...
>>    :curlpath "curl"
>>    ...
>>    :gitpath "git"
>>    ...
>> #+end_src
>>
>> Whether Guix packaging picks these up automatically or not, I haven't
>> tested, but it seems for common usage of JPM these dependencies ought to
>> be available.  Similar to the case of "gcc" and "g++", it might be
>> better to replace these with references to the respective binaries in
>> the Guix store instead (as opposed to propagating them as I had
>> previously suggested).
>>
>> Regarding nss-certs, it provides certificates for Certification
>> Authorities which, IIUC, would be relevant for HTTPS URLs (e.g. fetching
>> dependencies over git+https).
>>
>> To summarize, here's what I believe is needed.  Add nss-certs to the
>> propagated inputs, and for the below replace their occurrence in
>> linux_config.janet with references to binaries in the store:
>> - cc -> absolute path of gcc
>> - c++ -> absolute path of g++
>> - curl -> absolute path of curl
>> - git -> absolute path of git
>>
>> --
>> Suhail
>>
>

[-- Attachment #2: Type: text/html, Size: 5795 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH v7] gnu: add jpm package
  2024-10-02 14:51 ` [bug#72925] [PATCH v7] " Omar Bassam
@ 2024-10-04 15:17   ` Omar Bassam
  0 siblings, 0 replies; 30+ messages in thread
From: Omar Bassam @ 2024-10-04 15:17 UTC (permalink / raw)
  To: 72925
  Cc: Omar Bassam, Guillaume Le Vaillant, Katherine Cox-Buday,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/lisp.scm (jpm): New Variable

Change-Id: I730ef2f5c874c5142a580a42af76180e95d93ccd
---
 gnu/packages/lisp.scm | 44 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 6c16d8ab71..f9ae0fe55a 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -29,6 +29,7 @@
 ;;; Copyright © 2024 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2024 bigbug <bigbookofbug@proton.me>
 ;;; Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se>
+;;; Copyright © 2024 Omar Bassam <omar.bassam88@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -917,6 +918,49 @@ (define-public janet
 assembler, PEG) is less than 1MB.")
     (license license:expat)))
 
+(define-public jpm
+  (package
+    (name "jpm")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/janet-lang/jpm.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "05rdxigmiy7vf93s16a8n2029lq33073jccz1rjl4iisxj6piw4l"))))
+    (build-system copy-build-system)
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (add-after 'unpack 'fix-prefix-path
+                     (lambda _
+                       (substitute* "configs/linux_config.janet"
+                         (("/usr/local")
+                          #$output))
+                       (setenv "PREFIX"
+                               #$output)))
+                   (replace 'install
+                     (lambda _
+                       (for-each (lambda (dir)
+                                   (mkdir-p (string-append #$output "/" dir)))
+                                 '("lib/janet/jpm" "share/man/man1"))
+                       (invoke "janet" "bootstrap.janet"
+                               "configs/linux_config.janet")
+                       (wrap-program (string-append #$output "/bin/jpm")
+                         `("JANET_HEADERPATH" ":" =
+                           (,(string-append #$janet "/include/janet")))
+                         `("JANET_LIBPATH" ":" =
+                           (,(string-append #$janet "/lib")))))))))
+    (inputs (list janet))
+    (home-page "https://janet-lang.org/")
+    (synopsis "Janet Project Manager for the Janet programming language")
+    (description "JPM is the Janet Project Manager tool.  It is for automating
+builds and downloading dependencies of Janet projects.")
+    (license license:expat)))
+
 (define-public lisp-repl-core-dumper
   (package
     (name "lisp-repl-core-dumper")

base-commit: 3d0668fe6667dabe71ee2840e75877f18399c1d9
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [bug#72925] [PATCH v8] gnu: add jpm package
  2024-09-01  8:31 [bug#72925] Adding JPM package for Janet Omar Bassam
                   ` (5 preceding siblings ...)
  2024-10-02 14:51 ` [bug#72925] [PATCH v7] " Omar Bassam
@ 2024-10-04 15:57 ` Omar Bassam
  6 siblings, 0 replies; 30+ messages in thread
From: Omar Bassam @ 2024-10-04 15:57 UTC (permalink / raw)
  To: 72925
  Cc: Omar Bassam, Guillaume Le Vaillant, Katherine Cox-Buday,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/lisp.scm (jpm): New Variable

Change-Id: I92cf244ab23062ae3448099506d1b068394d7094
---
 gnu/packages/lisp.scm | 72 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 6c16d8ab71..ee9913f14e 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -29,6 +29,7 @@
 ;;; Copyright © 2024 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2024 bigbug <bigbookofbug@proton.me>
 ;;; Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se>
+;;; Copyright © 2024 Omar Bassam <omar.bassam88@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -70,6 +71,7 @@ (define-module (gnu packages lisp)
   #:use-module (gnu packages bdw-gc)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages certs)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
@@ -917,6 +919,76 @@ (define-public janet
 assembler, PEG) is less than 1MB.")
     (license license:expat)))
 
+(define-public jpm
+  (package
+    (name "jpm")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/janet-lang/jpm.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "05rdxigmiy7vf93s16a8n2029lq33073jccz1rjl4iisxj6piw4l"))))
+    (build-system copy-build-system)
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (add-after 'unpack 'fix-paths
+                     (lambda* (#:key inputs #:allow-other-keys)
+                       (substitute* "configs/linux_config.janet"
+                         (("/usr/local")
+                          #$output)
+                         (("\"cc\"")
+                          (string-append "\""
+                                         (assoc-ref inputs "gcc-toolchain")
+                                         "/bin/gcc" "\""))
+                         (("\"c++\"")
+                          (string-append "\""
+                                         (assoc-ref inputs "gcc-toolchain")
+                                         "/bin/g++" "\""))
+                         (("\"git\"")
+                          (string-append "\""
+                                         #$git "/bin/git" "\""))
+                         (("\"curl\"")
+                          (string-append "\""
+                                         #$curl "/bin/curl" "\"")))
+                       (substitute* "jpm/shutil.janet"
+                         (("cp")
+                          (string-append #$coreutils "/bin/cp")))
+                       (setenv "PREFIX"
+                               #$output)))
+                   (replace 'install
+                     (lambda _
+                       (for-each (lambda (dir)
+                                   (mkdir-p (string-append #$output "/" dir)))
+                                 '("lib/janet/jpm" "share/man/man1"))
+                       (invoke "janet" "bootstrap.janet"
+                               "configs/linux_config.janet")
+                       (wrap-program (string-append #$output "/bin/jpm")
+                         `("JANET_HEADERPATH" ":" =
+                           (,(string-append #$janet "/include/janet")))
+                         `("JANET_LIBPATH" ":" =
+                           (,(string-append #$janet "/lib")))))))))
+    (inputs (list bash-minimal janet))
+    (propagated-inputs (list janet
+                             coreutils
+                             git
+                             curl
+                             nss-certs
+                             ;; Lazily resolve the gcc-toolchain to avoid
+                             ;; a circular dependency.
+                             (module-ref (resolve-interface '(gnu packages
+                                                              commencement))
+                                         'gcc-toolchain)))
+    (home-page "https://janet-lang.org/")
+    (synopsis "Janet Project Manager for the Janet programming language")
+    (description "JPM is the Janet Project Manager tool.  It is for automating
+builds and downloading dependencies of Janet projects.")
+    (license license:expat)))
+
 (define-public lisp-repl-core-dumper
   (package
     (name "lisp-repl-core-dumper")

base-commit: ebb715aabfc4e59ed14b964ac7fdd2a9f9f44526
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 30+ messages in thread

* [bug#72925] Adding JPM package for Janet
  2024-10-03 22:04                             ` Omar Bassam
@ 2024-10-04 16:00                               ` Omar Bassam
  0 siblings, 0 replies; 30+ messages in thread
From: Omar Bassam @ 2024-10-04 16:00 UTC (permalink / raw)
  To: Suhail Singh
  Cc: Sharlatan Hellseher, 72925, Guillaume Le Vaillant,
	Katherine Cox-Buday, Munyoki Kilyungi, jgart

[-- Attachment #1: Type: text/plain, Size: 4913 bytes --]

Hi Suhail,

I just submitted a new path v8. I tested in a pure container shell and it
worked for me for the following commands:

- "jpm install -l sh"
- "jpm install -l spork"
- "jpm build" : for a basic hello world project

Can you please have another look and let me know if you have any comments

Thanks,
*Omar*

On Fri, 4 Oct 2024 at 01:04, Omar Bassam <omar.bassam88@gmail.com> wrote:

> It's OK I figured it out now. I'll be posting the patch soon.
>
> On Thu, 3 Oct 2024 at 22:45, Omar Bassam <omar.bassam88@gmail.com> wrote:
>
>> Hi Suhail,
>> I really need some help here.
>> I am having trouble using gcc-toolchain because when I add the (gnu
>> packages commencement) modules to the lisp.scm file I get a lot of errors
>> that I don't understand.
>> I was able to create a local manifest file with the definition of my
>> package and made the substitutions you suggested and added the propagated
>> input and it worked fine.
>> The issue that I'm having now is to include it in the lisp.scm file.
>> Can you tell what's the right use-module form I need to use?
>>
>> On Thu, 3 Oct 2024 at 16:40, Suhail Singh <suhailsingh247@gmail.com>
>> wrote:
>>
>>> Omar Bassam <omar.bassam88@gmail.com> writes:
>>>
>>> > I just have some questions before submitting v8 if you don't mind.
>>> just to
>>> > make sure I understand correctly.
>>>
>>> Questions are always welcome :)
>>>
>>> >> Specifically, in the file "configs/linux_config.janet", among other
>>> >> things, the below are set
>>> >>
>>> >> #+begin_src janet
>>> >>    :c++ "c++"
>>> >>    :c++-link "c++"
>>> >>    :cc "cc"
>>> >>    :cc-link "cc"
>>> >> #+end_src
>>> >>
>>> >> Since Guix, as far as I know, doesn't have packages that provide c++
>>> nor
>>> >> cc, I believe the above need to be patched to refer to gcc and g++
>>> >> respectively.
>>> >>
>>> >> So we need to substitute the above "c++" and "cc" in the
>>> > "configs/linux_config.janet" to point to the absolute path for the gcc
>>> and
>>> > g++ packages?
>>>
>>> I believe there are multiple ways to make this work.  I haven't tested
>>> this, so take my opinions as speculative.
>>>
>>> If we replace "cc" and "c++" with the _absolute path_ for "gcc" and
>>> "g++" respectively from the Guix store, then I don't think we need to
>>> specify gcc-toolchain as a propagated input.  Upon reflecting on this,
>>> this is probably the better approach.
>>>
>>> If, however, we replace "cc" and "c++" with the _strings_ "gcc" and
>>> "g++", then I believe we may need to specify gcc-toolchain in the
>>> propagated inputs.  IIUC, in this case we would replace the command that
>>> JPM invokes when building.  By additionally having gcc-toolchain in the
>>> propagated inputs we'll ensure that they're available in the PATH.
>>>
>>> > Should we also replace other commands that are hard-coded like "cp" and
>>> > "chown" from coreutils the same way I did in my first initial patch?
>>>
>>> I don't believe this is necessary.  There's a question regd. whether or
>>> not coreutils needs to be added to the propagated inputs, however.  I
>>> don't have a definitive answer, but the way to test it would be to run
>>> it in a pure container and see if things work without having to
>>> explicitly specify coreutils.  If you're unable to test it, let me know
>>> when you send v8 and I can test it on your behalf.
>>>
>>> For reference, I use something like the below:
>>> #+begin_src sh
>>>   guix shell --pure -CPWN \
>>>     -E '.*GTK.*|.*XDG.*|.*DISPLAY.*|TERM|INSIDE_EMACS' \
>>>     -p /path/to/profile
>>> #+end_src
>>>
>>> > Further, I believe JPM should have a few propagated inputs:
>>> >> - gcc-toolchain
>>> >> - curl
>>> >> - git
>>> >> - nss-certs.
>>> >>
>>> >> I understand why we need gcc-toolchain. But why do we need curl, git
>>> and
>>> > nss-certs?
>>>
>>> linux_config.janet also specifies:
>>>
>>> #+begin_src janet
>>>    ...
>>>    :curlpath "curl"
>>>    ...
>>>    :gitpath "git"
>>>    ...
>>> #+end_src
>>>
>>> Whether Guix packaging picks these up automatically or not, I haven't
>>> tested, but it seems for common usage of JPM these dependencies ought to
>>> be available.  Similar to the case of "gcc" and "g++", it might be
>>> better to replace these with references to the respective binaries in
>>> the Guix store instead (as opposed to propagating them as I had
>>> previously suggested).
>>>
>>> Regarding nss-certs, it provides certificates for Certification
>>> Authorities which, IIUC, would be relevant for HTTPS URLs (e.g. fetching
>>> dependencies over git+https).
>>>
>>> To summarize, here's what I believe is needed.  Add nss-certs to the
>>> propagated inputs, and for the below replace their occurrence in
>>> linux_config.janet with references to binaries in the store:
>>> - cc -> absolute path of gcc
>>> - c++ -> absolute path of g++
>>> - curl -> absolute path of curl
>>> - git -> absolute path of git
>>>
>>> --
>>> Suhail
>>>
>>

[-- Attachment #2: Type: text/html, Size: 6661 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2024-10-04 16:06 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-01  8:31 [bug#72925] Adding JPM package for Janet Omar Bassam
2024-09-04  8:22 ` [bug#72925] [PATCH] adding jpm package Omar Bassam
2024-09-05 14:50 ` Omar Bassam
2024-09-18 13:18   ` [bug#72925] Adding JPM package for Janet Suhail Singh
2024-09-18 15:34     ` Omar Bassam
2024-09-18 16:16       ` Suhail Singh
2024-09-30  8:12 ` [bug#72925] [PATCH v3] adding jpm package Omar Bassam
2024-10-01  0:06   ` Suhail Singh
2024-10-02 15:09     ` Omar Bassam
2024-10-02 18:21       ` Suhail Singh
2024-10-02 19:04         ` jgart via Guix-patches via
2024-10-02 19:12         ` Omar Bassam
2024-10-02 20:14           ` Suhail Singh
2024-10-02 20:27             ` Omar Bassam
2024-10-02 20:33               ` jgart via Guix-patches via
2024-10-02 21:39               ` Suhail Singh
2024-10-02 21:52                 ` Omar Bassam
2024-10-02 22:07                   ` Suhail Singh
2024-10-03  1:40                     ` Suhail Singh
2024-10-03  7:14                       ` Omar Bassam
2024-10-03 13:40                         ` [bug#72925] Adding JPM package for Janet Suhail Singh
2024-10-03 19:45                           ` Omar Bassam
2024-10-03 22:04                             ` Omar Bassam
2024-10-04 16:00                               ` Omar Bassam
2024-10-02 20:27             ` [bug#72925] [PATCH v3] adding jpm package jgart via Guix-patches via
2024-10-02 14:36 ` [bug#72925] [PATCH v5] gnu: add " Omar Bassam
2024-10-02 14:50 ` [bug#72925] [PATCH v6] " Omar Bassam
2024-10-02 14:51 ` [bug#72925] [PATCH v7] " Omar Bassam
2024-10-04 15:17   ` Omar Bassam
2024-10-04 15:57 ` [bug#72925] [PATCH v8] " Omar Bassam

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).