[PATCH 0/1] Add emacs-bfuture

DoneSubmitted by Fredrik Salomonsson.
Details
3 participants
  • Ludovic Courtès
  • Maxime Devos
  • Fredrik Salomonsson
Owner
unassigned
Severity
normal
F
F
Fredrik Salomonsson wrote on 15 May 01:52 +0200
(address . guix-patches@gnu.org)(name . Fredrik Salomonsson)(address . plattfot@posteo.net)
20220514235216.34268-1-plattfot@posteo.net
Simple elisp library with similar functionality as emacs-pfuture but with
tramp support. And the caveat that it cannot distinguish stdout and stderr.

Fredrik Salomonsson (1):
gnu: Add emacs-bfuture.

gnu/packages/emacs-xyz.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)


base-commit: 3935451f63c078cae9a928d87c6838ec3138abc0
--
2.36.0
F
F
Fredrik Salomonsson wrote on 15 May 01:54 +0200
[PATCH 1/1] gnu: Add emacs-bfuture.
(address . 55421@debbugs.gnu.org)(name . Fredrik Salomonsson)(address . plattfot@posteo.net)
20220514235429.34539-1-plattfot@posteo.net
* gnu/packages/emacs-xyz.scm (emacs-bfuture): New variable.
---
gnu/packages/emacs-xyz.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)

Toggle diff (44 lines)
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index c18505a681..eff6e76423 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -24706,6 +24706,37 @@ (define-public emacs-dap-mode
 Debug server.")
     (license license:gpl3+)))
 
+(define-public emacs-bfuture
+  (package
+   (name "emacs-bfuture")
+   (version "1.0.1")
+   (source
+    (origin
+     (method git-fetch)
+     (uri (git-reference
+           (url "https://git.sr.ht/~plattfot/bfuture")
+           (commit (string-append "v" version))))
+     (sha256
+      (base32
+       "1m4v4xbsvg26z7nvg2c8q7x1nvv7v4ajm56l0nbkwcbdbrgahpva"))
+     (file-name (git-file-name name version))))
+   (build-system emacs-build-system)
+   (arguments
+    `(#:tests? #t
+      #:test-command '("ert-runner")))
+   (propagated-inputs `())
+   (native-inputs (list emacs-ert-runner))
+   (inputs `())
+   (home-page "https://github.com/plattfot/bfuture.el")
+   (synopsis "Basic future concept for @code{emacs} with @code{tramp} support")
+   (description
+    "This package provides basic functions for spawning processes
+asynchronous in @code{emacs} and retrieving the output. It is similar
+to @code{emacs-pfuture} except that this works over @code{tramp} but
+the feature set is more limited. For example it cannot tell stdout and
+stderr apart.")
+   (license license:gpl3+)))
+
 (define-public emacs-pfuture
   (package
     (name "emacs-pfuture")
-- 
2.36.0
M
M
Maxime Devos wrote on 15 May 10:41 +0200
b3a4b715e3120e40f842b4e94641ecc0eabf5238.camel@telenet.be
Fredrik Salomonsson schreef op za 14-05-2022 om 23:54 [+0000]:
Toggle quote (4 lines)
> +   (arguments
> +    `(#:tests? #t
> +      #:test-command '("ert-runner")))

Tests cannot be run when cross-compiling(*), try

(arguments
(list #:tests? (not (%current-target-system))
#:test-command #~'("ert-runner")))

instead.

(*) unfortunately emacs-build-system does not support cross-compilation
yet, so this cannot yet be tested for emacs packages.

Toggle quote (4 lines)
> +   (propagated-inputs `())
> +   (native-inputs (list emacs-ert-runner))
> +   (inputs `())

If there are no inputs or native-inputs, these fields can be ommitted.

(Only a partial review, I did not look at anything else)

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYoC80BccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7sNOAP0VSdIuRhDLgSeDeIaunigWaEgl
8zQ/r93bMxLYTiuIKAEAyMWOaDu+k7C1GtyPwPoG4Lr7+khzy8OkUhLG45rnnAQ=
=J41m
-----END PGP SIGNATURE-----


F
F
Fredrik Salomonsson wrote on 15 May 21:05 +0200
874k1qzkdn.fsf@posteo.net
Maxime Devos <maximedevos@telenet.be> writes:

Toggle quote (17 lines)
> Fredrik Salomonsson schreef op za 14-05-2022 om 23:54 [+0000]:
>> +   (arguments
>> +    `(#:tests? #t
>> +      #:test-command '("ert-runner")))
>
> Tests cannot be run when cross-compiling(*), try
>
> (arguments
> (list #:tests? (not (%current-target-system))
> #:test-command #~'("ert-runner")))
>
> instead.
>
> (*) unfortunately emacs-build-system does not support cross-compilation
> yet, so this cannot yet be tested for emacs packages.
>

Got it, thanks.

This is probably some sort of user error. But when I apply that patch
and run:

./pre-inst-env guix build emacs-bfuture

I get the following error:

---8<---------------------------------------------------------------------------
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
substitute: updating substitutes from 'https://bordeaux.guix.gnu.org'... 100.0%
The following derivation will be built:
/gnu/store/8bgw51gsyya5a84bvqj02l6i3g5nk6k1-emacs-bfuture-1.0.1.drv
building /gnu/store/8bgw51gsyya5a84bvqj02l6i3g5nk6k1-emacs-bfuture-1.0.1.drv...
Backtrace:
9 (primitive-load "/gnu/store/scwqnvkmyxiq5v8dlh4wy2132p5?")
In ice-9/eval.scm:
214:21 8 (_ #f)
217:50 7 (lp (#<procedure 7ffff0037480 at ice-9/eval.scm:282:?> ?))
217:50 6 (lp (#<procedure 7ffff0037460 at ice-9/eval.scm:282:?> ?))
217:50 5 (lp (#<procedure 7ffff0037440 at ice-9/eval.scm:282:?> ?))
217:50 4 (lp (#<procedure 7ffff0037420 at ice-9/eval.scm:282:?> ?))
217:33 3 (lp (#<procedure 7ffff0037300 at ice-9/eval.scm:191:?> ?))
191:27 2 (_ #f)
223:20 1 (proc #<directory (guile-user) 7fffeffcfc80>)
In unknown file:
0 (%resolve-variable (7 . gexp) #<directory (guile-user) ?>)

ERROR: In procedure %resolve-variable:
Unbound variable: gexp
builder for `/gnu/store/8bgw51gsyya5a84bvqj02l6i3g5nk6k1-emacs-bfuture-1.0.1.drv' failed with exit code 1
build of /gnu/store/8bgw51gsyya5a84bvqj02l6i3g5nk6k1-emacs-bfuture-1.0.1.drv failed
View build log at '/var/log/guix/drvs/8b/gw51gsyya5a84bvqj02l6i3g5nk6k1-emacs-bfuture-1.0.1.drv.gz'.
guix build: error: build of `/gnu/store/8bgw51gsyya5a84bvqj02l6i3g5nk6k1-emacs-bfuture-1.0.1.drv' failed
--------------------------------------------------------------------------->8---

I'm using the following steps to setup my environment:

guix shell -D guix -- sh -c './bootstrap && ./configure --localstatedir=/var && make -j16'
guix shell -D guix --pure -E LANG
./pre-inst-env guix build emacs-bfuture

This is what guix describe --format=channels outputs:

---8<---------------------------------------------------------------------------
(list (channel
(name 'guix)
(branch "master")
(commit
"ebb43029506d994bee0c2b890881fd61a0b0c202")
(introduction
(make-channel-introduction
"9edb3f66fd807b096b48283debdcddccfea34bad"
(openpgp-fingerprint
"BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"))))
(channel
(name 'flat)
(branch "master")
(commit
"094746c1e2e90f2df1e598ab1fd0abb4d75ce84d")
(introduction
(make-channel-introduction
"33f86a4b48205c0dc19d7c036c85393f0766f806"
(openpgp-fingerprint
"736A C00E 1254 378B A982 7AF6 9DBE 8265 81B6 4490"))))
(channel
(name 'plt)
(branch "master")
(commit
"926c6155b5dc64daad68e02c4620ff60e9de44bd")))
--------------------------------------------------------------------------->8---

Toggle quote (9 lines)
>> +   (propagated-inputs `())
>> +   (native-inputs (list emacs-ert-runner))
>> +   (inputs `())
>
> If there are no inputs or native-inputs, these fields can be ommitted.
>
> (Only a partial review, I did not look at anything else)
>

Thank you for taking the time to review it.

--
s/Fred[re]+i[ck]+/Fredrik/g
M
M
Maxime Devos wrote on 15 May 21:38 +0200
51dbdd594dfc5e1760eca0064921e9fe4f5dcbb1.camel@telenet.be
Fredrik Salomonsson schreef op zo 15-05-2022 om 19:05 [+0000]:
Toggle quote (3 lines)
> ERROR: In procedure %resolve-variable:
> Unbound variable: gexp

Make sure it's

(arguments
(list #:tests? (not (%current-target-system))
#:test-command #~'("ert-runner")))

and not

(arguments
`(#:tests? (not (%current-target-system))
#:test-command #~'("ert-runner"))) ; <-- won't work

. The latter won't work as-is as the #~ needs to be unquoted with
,#~'("ert-runner"). I recommend the first method ('list' instead of `
aka quasiquote) for having less complicated syntax.

If that wasn't the case or it still fails please send a copy of the
package definition.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYoFWzhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7sBcAQD81ZhLsYd8o/51fuofviGmz6NV
O0BT3JhJ4fTbMpYjMwD/UoJ3WAARRJFOaAviq1erKhtdOc4h6hivfNw3xxaVYQE=
=ohOG
-----END PGP SIGNATURE-----


F
F
Fredrik Salomonsson wrote on 15 May 21:41 +0200
[PATCH v1] gnu: Add emacs-bfuture.
(address . 55421@debbugs.gnu.org)(name . Fredrik Salomonsson)(address . plattfot@posteo.net)
20220515194133.70347-1-plattfot@posteo.net
* gnu/packages/emacs-xyz.scm (emacs-bfuture): New variable.
---
gnu/packages/emacs-xyz.scm | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)

Toggle diff (44 lines)
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 8a319fc0ff..ccc0dcd988 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -24716,6 +24716,35 @@ (define-public emacs-dap-mode
 Debug server.")
     (license license:gpl3+)))
 
+(define-public emacs-bfuture
+  (package
+   (name "emacs-bfuture")
+   (version "1.0.1")
+   (source
+    (origin
+     (method git-fetch)
+     (uri (git-reference
+           (url "https://git.sr.ht/~plattfot/bfuture")
+           (commit (string-append "v" version))))
+     (sha256
+      (base32
+       "1m4v4xbsvg26z7nvg2c8q7x1nvv7v4ajm56l0nbkwcbdbrgahpva"))
+     (file-name (git-file-name name version))))
+   (build-system emacs-build-system)
+   (arguments
+    (list #:tests? (not (%current-target-system))
+          #:test-command #~'("ert-runner")))
+   (native-inputs (list emacs-ert-runner))
+   (home-page "https://github.com/plattfot/bfuture.el")
+   (synopsis "Basic future concept for @code{emacs} with @code{tramp} support")
+   (description
+    "This package provides basic functions for spawning processes
+asynchronous in @code{emacs} and retrieving the output. It is similar
+to @code{emacs-pfuture} except that this works over @code{tramp} but
+the feature set is more limited. For example it cannot tell stdout and
+stderr apart.")
+   (license license:gpl3+)))
+
 (define-public emacs-pfuture
   (package
     (name "emacs-pfuture")

base-commit: ebb43029506d994bee0c2b890881fd61a0b0c202
-- 
2.36.0
F
F
Fredrik Salomonsson wrote on 15 May 21:43 +0200
Re: [bug#55421] [PATCH 1/1] gnu: Add emacs-bfuture.
871qwuzima.fsf@posteo.net
Fredrik Salomonsson <plattfot@posteo.net> writes:

Toggle quote (23 lines)
> Maxime Devos <maximedevos@telenet.be> writes:
>
>> Fredrik Salomonsson schreef op za 14-05-2022 om 23:54 [+0000]:
>>> +   (arguments
>>> +    `(#:tests? #t
>>> +      #:test-command '("ert-runner")))
>>
>> Tests cannot be run when cross-compiling(*), try
>>
>> (arguments
>> (list #:tests? (not (%current-target-system))
>> #:test-command #~'("ert-runner")))
>>
>> instead.
>>
>> (*) unfortunately emacs-build-system does not support cross-compilation
>> yet, so this cannot yet be tested for emacs packages.
>>
>
> Got it, thanks.
>
> This is probably some sort of user error.

Yup, definetly user error. I missed the list part in the diff and had
written:

Toggle quote (4 lines)
>> (arguments
>> `(#:tests? (not (%current-target-system))
>> #:test-command #~'("ert-runner")))

So the gexpression wasn't evaluated at the right time.

Should be all fixed in v1 patch I just sent.

--
s/Fred[re]+i[ck]+/Fredrik/g
L
L
Ludovic Courtès wrote on 1 Jun 22:43 +0200
Re: bug#55421: [PATCH 0/1] Add emacs-bfuture
(name . Fredrik Salomonsson)(address . plattfot@posteo.net)(address . 55421-done@debbugs.gnu.org)
875ylkt8qq.fsf_-_@gnu.org
Hi,

Fredrik Salomonsson <plattfot@posteo.net> skribis:

Toggle quote (2 lines)
> * gnu/packages/emacs-xyz.scm (emacs-bfuture): New variable.

[...]

Toggle quote (5 lines)
> + (synopsis "Basic future concept for @code{emacs} with @code{tramp} support")
> + (description
> + "This package provides basic functions for spawning processes
> +asynchronous in @code{emacs} and retrieving the output. It is similar

I removed @code here because Emacs and Tramp are regular proper names.
:-)

Applied, thanks!

Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 55421@debbugs.gnu.org