[PATCH] [WIP] gnu: Add emacs-copilot.

  • Open
  • quality assurance status badge
Details
6 participants
  • Brian Cully
  • Giovanni Biscuolo
  • jgart
  • Liliana Marie Prikler
  • Nicolas Goaziou
  • Rostislav Svoboda
Owner
unassigned
Submitted by
Rostislav Svoboda
Severity
normal
R
R
Rostislav Svoboda wrote on 4 Apr 2023 16:30
(address . guix-patches@gnu.org)(name . Rostislav Svoboda)(address . Rostislav.Svoboda@gmail.com)
20230404143043.3202-1-Rostislav.Svoboda@gmail.com
---
gnu/packages/emacs-xyz.scm | 46 ++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)

Toggle diff (59 lines)
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 2b96c60057..d037fa9075 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -36689,6 +36689,52 @@ (define-public emacs-tintin-mode
(description "This major mode focuses on highlighting as many aspects of the TinTin++ scripting language as possible, organizing commands into functional categories and highlighting specific modes that many commands use to accomplish different tasks.")
(license license:asl2.0))))
+(define-public emacs-copilot
+ (let ((commit "e11847ab0c3b183a1e53fbc1ac587de82912b9cf")
+ (revision "0"))
+ (package
+ (name "emacs-copilot")
+ (version (git-version "0" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/zerolfx/copilot.el.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0gsxb268vqyim65ag8d7dlgdqyxqrjcjirlnbfbfq0pdr1y2158q"))))
+ (build-system emacs-build-system)
+ (arguments
+ (list
+ #:include #~(cons "^dist/" %default-include)
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'substitute-copilot-node-executable
+ (lambda* (#:key inputs #:allow-other-keys)
+ (emacs-substitute-variables "copilot.el"
+ ("copilot-node-executable"
+;;; Copilot requires Node 16+, however packaging v16 and/or v18 is not
+;;; trivial. See https://issues.guix.gnu.org/53414,
+;;; https://issues.guix.gnu.org/59188 .
+;;;
+;;; As a hack, download and compile recent Node version manually.
+ (format #f "%s/node-v18.15.0/out/Release/node" (getenv "dev")) ; Remove this line when Node 16+ becomes available as a Guix package.
+ ;; (search-input-file inputs "/bin/node") ; Activate this line when Node 16+ becomes available as a Guix package.
+ )))))))
+ ;; (inputs (list node)) ; Activate this line when Node 16+ becomes available as a Guix package.
+ (propagated-inputs
+ (list emacs-dash emacs-editorconfig emacs-s))
+ (home-page
+ "https://github.com/zerolfx/copilot.el.git")
+ (synopsis "An unofficial Copilot plugin for Emacs")
+ (description
+ "Copilot.el is an Emacs plugin for GitHub Copilot. This plugin is
+unofficial and based on binaries provided by copilot.vim. Note: You need
+access to GitHub Copilot to use this plugin.")
+ (license license:gpl3+))))
+
;;;
;;; Avoid adding new packages to the end of this file. To reduce the chances
;;; of a merge conflict, place them above by existing packages with similar
--
2.39.2
R
R
Rostislav Svoboda wrote on 4 Apr 2023 16:35
(address . guix-patches@gnu.org)(name . Nicolas Goaziou)(address . mail@nicolasgoaziou.fr)
CAEtmmeybBotuh2LxF6fFB-=ui04aQ7WJ8JW_he7WOyFm9yGbVQ@mail.gmail.com
As hinted in the commit message, this patch is Work-In-Progress,
waiting for Node v16+ to become available as a Guix package. I.e. this
patch is not ready for integration in the upstream, yet
However I assume some folks may benefit from it, anyway.

Cheers Bost

Le mar. 4 avr. 2023 à 16:31, Rostislav Svoboda
<rostislav.svoboda@gmail.com> a écrit :
Toggle quote (65 lines)
>
> ---
> gnu/packages/emacs-xyz.scm | 46 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 46 insertions(+)
>
> diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
> index 2b96c60057..d037fa9075 100644
> --- a/gnu/packages/emacs-xyz.scm
> +++ b/gnu/packages/emacs-xyz.scm
> @@ -36689,6 +36689,52 @@ (define-public emacs-tintin-mode
> (description "This major mode focuses on highlighting as many aspects of the TinTin++ scripting language as possible, organizing commands into functional categories and highlighting specific modes that many commands use to accomplish different tasks.")
> (license license:asl2.0))))
>
> +(define-public emacs-copilot
> + (let ((commit "e11847ab0c3b183a1e53fbc1ac587de82912b9cf")
> + (revision "0"))
> + (package
> + (name "emacs-copilot")
> + (version (git-version "0" revision commit))
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/zerolfx/copilot.el.git")
> + (commit commit)))
> + (file-name (git-file-name name version))
> + (sha256
> + (base32
> + "0gsxb268vqyim65ag8d7dlgdqyxqrjcjirlnbfbfq0pdr1y2158q"))))
> + (build-system emacs-build-system)
> + (arguments
> + (list
> + #:include #~(cons "^dist/" %default-include)
> + #:phases
> + #~(modify-phases %standard-phases
> + (add-after 'unpack 'substitute-copilot-node-executable
> + (lambda* (#:key inputs #:allow-other-keys)
> + (emacs-substitute-variables "copilot.el"
> + ("copilot-node-executable"
> +;;; Copilot requires Node 16+, however packaging v16 and/or v18 is not
> +;;; trivial. See https://issues.guix.gnu.org/53414,
> +;;; https://issues.guix.gnu.org/59188 .
> +;;;
> +;;; As a hack, download and compile recent Node version manually.
> + (format #f "%s/node-v18.15.0/out/Release/node" (getenv "dev")) ; Remove this line when Node 16+ becomes available as a Guix package.
> + ;; (search-input-file inputs "/bin/node") ; Activate this line when Node 16+ becomes available as a Guix package.
> + )))))))
> + ;; (inputs (list node)) ; Activate this line when Node 16+ becomes available as a Guix package.
> + (propagated-inputs
> + (list emacs-dash emacs-editorconfig emacs-s))
> + (home-page
> + "https://github.com/zerolfx/copilot.el.git")
> + (synopsis "An unofficial Copilot plugin for Emacs")
> + (description
> + "Copilot.el is an Emacs plugin for GitHub Copilot. This plugin is
> +unofficial and based on binaries provided by copilot.vim. Note: You need
> +access to GitHub Copilot to use this plugin.")
> + (license license:gpl3+))))
> +
> ;;;
> ;;; Avoid adding new packages to the end of this file. To reduce the chances
> ;;; of a merge conflict, place them above by existing packages with similar
> --
> 2.39.2
>
J
J
jgart wrote on 4 Apr 2023 16:54
(address . 62664@debbugs.gnu.org)(name . Rostislav Svoboda)(address . rostislav.svoboda@gmail.com)
46fc86f5b380b2f8deb87a9fdeab5bdd@dismail.de
Hi Rostislav,

Thanks for this patch. It builds fine for me. Linter complains about a few nitpicks regarding line lengths and article of synopsis.

I added your patch as a pre-release to Guix "R" Us:


I'll let you know if we run into any other issues when trying the package from Guix "R" Us.

all best,

jgart

https://whereis.???/
https://toys.whereis.???/
L
L
Liliana Marie Prikler wrote on 4 Apr 2023 21:19
27de0b74d4d374b606557890743383ef323b893b.camel@gmail.com
Am Dienstag, dem 04.04.2023 um 16:30 +0200 schrieb Rostislav Svoboda:
Toggle quote (6 lines)
> +       "Copilot.el is an Emacs plugin for GitHub Copilot. This
> plugin is
> +unofficial and based on binaries provided by copilot.vim. Note: You
> need
> +access to GitHub Copilot to use this plugin.")
> +      (license license:gpl3+))))
Given that this package is based on binaries, and the fact that Github
Copilot has attracted a wide variety of concerns regarding licensing,
privacy and autocompleted vulnerabilities, I think we can do better
without it :)

Cheers
G
G
Giovanni Biscuolo wrote on 5 Apr 2023 15:07
Re: [bug#62664] [PATCH] [WIP] gnu: Add emacs-copilot.
871qkysci9.fsf@xelera.eu
Liliana Marie Prikler <liliana.prikler@gmail.com> writes:

Toggle quote (9 lines)
> Am Dienstag, dem 04.04.2023 um 16:30 +0200 schrieb Rostislav Svoboda:
>> +       "Copilot.el is an Emacs plugin for GitHub Copilot. This
>> plugin is
>> +unofficial and based on binaries provided by copilot.vim. Note: You
>> need
>> +access to GitHub Copilot to use this plugin.")
>> +      (license license:gpl3+))))
> Given that this package is based on binaries,

binaries are wasm files in "dist" folder:

Toggle snippet (8 lines)
tree-sitter-go.wasm
tree-sitter-javascript.wasm
tree-sitter-python.wasm
tree-sitter-ruby.wasm
tree-sitter-typescript.wasm
tree-sitter.wasm

Toggle quote (5 lines)
> and the fact that Github
> Copilot has attracted a wide variety of concerns regarding licensing,
> privacy and autocompleted vulnerabilities, I think we can do better
> without it :)

For what it matters, I totally agree with Liliana

Thanks! Gio'

--
Giovanni Biscuolo

Xelera IT Infrastructures
-----BEGIN PGP SIGNATURE-----

iQJABAEBCgAqFiEERcxjuFJYydVfNLI5030Op87MORIFAmQtcq4MHGdAeGVsZXJh
LmV1AAoJENN9DqfOzDkSt9EP/2Z2jtKuQCSLvJf3bsGxglg51g5rN8mTliYC48KH
ttcNV+ygG2oj5QC8FLPoPMqwdtQC08JtwuTIWAr18Ba5oKJ5kwFbqFtc8kSQkhyv
yHNgOTia5SoSGuY5Pt13+TvE3DClxwiRXavQNT5/IKLdFGdRXRRUPEjL7oPqU8Ew
LdhONOXYhnbhsOkvjIIzjY7VQVzBbSqpY9RZINo98ju6IPAv62amNbvMqSawS/E8
LXVci+F8CFR+foqSTmLuRqbIpzjZt0fO8uFvEZt+0qzPJoBD22z0aRGP05uzYK5t
82JmmWj5oaZWBVoGJsU2vzMpcA4o9OkAZWYRuGIy/P6iR3E4J06jbaC60sVfjRgU
TDrNjalckBpUCa7vfwJhFHPgxokJ0xDA7VQK91dDpVwXmoYwm62a/aAh59dB5iOQ
2HR7h8kE4F9EpfcfnqAPBFQ3833CKvDWYFBTNepkqz69m/u1642WKUEFFzqYwV/0
b/x2iTowaDMN+d7gbGRP1ndStUeTwJ+StoUOIrrg2y4bwGQYyxa8UqTRBUzwYjzq
9/yCTuRuUyU5yhRpJuzcZy9jBI4KISyYLOymm0g9trz6X/Q4zhP//NjrzdCC978t
1YxVrVny8qWVbbO4teXfeXzsvtMT6ZsGW1u6d9GUii4AnPxGgP6xYfabE0ZZZid7
YTA3
=DEew
-----END PGP SIGNATURE-----

B
B
Brian Cully wrote on 6 Apr 2023 21:34
Re: bug#62664: [PATCH] [WIP] gnu: Add emacs-copilot.
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
87v8i8x0s9.fsf_-_@psyduck.jhoto.kublai.com
Toggle quote (5 lines)
> Given that this package is based on binaries, and the fact that Github
> Copilot has attracted a wide variety of concerns regarding licensing,
> privacy and autocompleted vulnerabilities, I think we can do better
> without it :)

I came to this ticket to make this same comment.
J
J
jgart wrote on 7 Apr 2023 07:00
(address . 62664@debbugs.gnu.org)
35a20d5adaf06b3c224ddecad86ed735@dismail.de
Hi,

The author is making an effort to prepare copilot.el for submission to MELPA:


This package is obviously not ready for GNU Guix at this moment given the vendored WASM, etc. but let's give the project maintainer a chance to see how they manage to prepare this Emacs package for inclusion in MELPA.
J
(address . 62664@debbugs.gnu.org)
87h69apdqo.fsf@dismail.de
Hi Guixers,

Here's a revised patch for emacs-copilot. Please review and let me know
if I can merge it.

This package has been cleaned of all binaries and is now being prepared
for submission to MELPA:


I believe it now complies with all requirements for inclusion in GNU
Guix.

I've added Rostislav as a co-author.

WDYT
--
all the best,
jgart
N
N
Nicolas Goaziou wrote on 27 Oct 11:39 +0100
Re: [bug#62664] [PATCH] [WIP] gnu: Add emacs-copilot.
(name . jgart via Guix-patches via)(address . guix-patches@gnu.org)
87wmhtltia.fsf@nicolasgoaziou.fr
Hello,

jgart via Guix-patches via <guix-patches@gnu.org> writes:

Toggle quote (3 lines)
> Here's a revised patch for emacs-copilot. Please review and let me know
> if I can merge it.

Did you forget to add the patch to your email?

Regards,
--
Nicolas Goaziou
J
[PATCH v2] gnu: Add emacs-copilot.
(address . 62664@debbugs.gnu.org)
345b7770e3f714e100b271ea3c7e71a7f2e5a6c7.1730083238.git.jgart@dismail.de
* gnu/packages/emacs-xyz.scm (emacs-copilot): New variable.
Co-authored-by: Rostislav Svoboda <rostislav.svoboda@gmail.com>

Change-Id: If2e32f5cc4df95ce99642b41a1df818a35b4343c
---
gnu/packages/emacs-xyz.scm | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)

Toggle diff (52 lines)
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 488b4cb5d7..76c9ed9947 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -4422,6 +4422,43 @@ (define-public emacs-carp
listing type errors via Flycheck, as well as REPL support for Carp.")
(license license:asl2.0))))
+(define-public emacs-copilot
+ (let ((commit "b5878d6a8c741138b5efbf4fe1c594f3fd69dbdd")
+ (revision "0"))
+ (package
+ (name "emacs-copilot")
+ (version (git-version "1.27.0" revision commit))
+ (source
+ (origin
+ (uri (git-reference
+ (url "https://github.com/copilot-emacs/copilot.el")
+ (commit commit)))
+ (method git-fetch)
+ (sha256
+ (base32 "1dgi3g2n57dv1a8hjjzgccrbl1bdf4xqwn9bmr453fz4qfab0v6k"))
+ (file-name (git-file-name name version))))
+ (build-system emacs-build-system)
+ (arguments
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'substitute-copilot-node-executable
+ (lambda* (#:key inputs #:allow-other-keys)
+ (emacs-substitute-variables "copilot.el"
+ ("copilot-node-executable"
+ (search-input-file inputs "/bin/node"))))))))
+ (inputs (list node-lts))
+ (propagated-inputs
+ (list emacs-dash
+ emacs-editorconfig
+ emacs-f
+ emacs-s))
+ (home-page "https://github.com/copilot-emacs/copilot.el")
+ (synopsis "Copilot plugin for Emacs")
+ (description
+ "This package provides an Emacs plugin for GitHub Copilot.")
+ (license license:expat))))
+
(define-public emacs-coterm
(package
(name "emacs-coterm")

base-commit: 0d15c6e46c5c3a14ae776bb98c293527ba8ad319
--
2.46.0
J
Re: [PATCH] [WIP] gnu: Add emacs-copilot.
(address . 62664@debbugs.gnu.org)
87jzdtc5jh.fsf@dismail.de
Toggle quote (2 lines)
> Did you forget to add the patch to your email?

Yes, I did ;()

Attached in previous email to this thread.
--
all the best,
jgart
J
J
jgart wrote 40 hours ago
[PATCH v3] gnu: Add emacs-copilot.
(address . 62664@debbugs.gnu.org)(name . jgart)(address . jgart@dismail.de)
3934658d0ee2bd28b35d1d0205a196275296863e.1734975879.git.jgart@dismail.de
* gnu/packages/emacs-xyz.scm (emacs-copilot): New variable.

Change-Id: I3d693e5a59a28f488663421e6b2948cf8b51e031
---
gnu/packages/emacs-xyz.scm | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)

Toggle diff (52 lines)
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 65563bec24..f5826a87aa 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -29992,6 +29992,43 @@ (define-public emacs-dired-preview
customisation options to control its behaviour.")
(license license:gpl3+)))
+(define-public emacs-copilot
+ (let ((commit "d2126f288cebd9cd7e768c53a4cbfa6eedcb0666")
+ (revision "0"))
+ (package
+ (name "emacs-copilot")
+ (version (git-version "1.27.0" revision commit))
+ (source
+ (origin
+ (uri (git-reference
+ (url "https://github.com/copilot-emacs/copilot.el")
+ (commit commit)))
+ (method git-fetch)
+ (sha256
+ (base32 "14qnhp9pzilkrkaz2w52ylanjg44idi41dg6g7lqqc4fk0ib12kj"))
+ (file-name (git-file-name name version))))
+ (build-system emacs-build-system)
+ (arguments
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'substitute-copilot-node-executable
+ (lambda* (#:key inputs #:allow-other-keys)
+ (emacs-substitute-variables "copilot.el"
+ ("copilot-node-executable"
+ (search-input-file inputs "/bin/node"))))))))
+ (inputs (list node-lts))
+ (propagated-inputs
+ (list emacs-dash
+ emacs-editorconfig
+ emacs-f
+ emacs-s))
+ (home-page "https://github.com/copilot-emacs/copilot.el")
+ (synopsis "Copilot plugin for Emacs")
+ (description
+ "This package provides an Emacs plugin for GitHub Copilot.")
+ (license license:expat))))
+
(define-public emacs-dired-launch
(package
(name "emacs-dired-launch")

base-commit: 64774d76869cd14712064d34f82f06c78ee796a6
--
2.46.0
J
J
jgart wrote 40 hours ago
Re: [PATCH] [WIP] gnu: Add emacs-copilot.
(address . 62664@debbugs.gnu.org)
87o712gukl.fsf@dismail.de
Hi Nicolas,

Here is a v3. Let me know if you still can't apply it.

I used mumi cli to send this.

emacs-copilot is now in melpa:


--
all the best,
jgart
J
J
jgart wrote 39 hours ago
(address . 62664@debbugs.gnu.org)
87o712gsey.fsf@dismail.de
Actually looking at this package more carefully, the reason it needs
node is to npm install copilot-node-server which has an unclear license:


Here's what nixpkgs did:


Will this be a problem for emacs-copilot since we should include
copilot-node-server as a required dependency instead of installing it
via the npm wrapper?

If yes, I can close this issue and put this in a Guix channel instead.

Would be unfortunate though, since this is becoming a popular package in
the Emacs ecosystem.
--
all the best,
jgart
L
L
Liliana Marie Prikler wrote 38 hours ago
8c9674d7dc27f87e2a14bd665f46d1d95bedf556.camel@gmail.com
Am Montag, dem 23.12.2024 um 12:34 -0600 schrieb jgart:
Toggle quote (17 lines)
>
> Actually looking at this package more carefully, the reason it needs
> node is to npm install copilot-node-server which has an unclear
> license:
>
> https://github.com/jfcherng/copilot-node-server
>
> Here's what nixpkgs did:
>
> https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/co/copilot-node-server/package.nix#L38
>
> Will this be a problem for emacs-copilot since we should include
> copilot-node-server as a required dependency instead of installing it
> via the npm wrapper?
>
> If yes, I can close this issue and put this in a Guix channel
> instead.
Unbundling would be nicer, but if you don't need to download the
internet as part of the build or on first start to fetch all the
dependencies (i.e. if you can properly package it with available
sources + node), then you may forgo that for now. That's a big if
however, one that rarely holds in JS ecosystems.

Toggle quote (2 lines)
> Would be unfortunate though, since this is becoming a popular package
> in the Emacs ecosystem.
Selling your data to Microsoft should be less popular, then.

Cheers
L
L
Liliana Marie Prikler wrote 25 hours ago
Re: [bug#62664] [PATCH v3] gnu: Add emacs-copilot.
335729535b39aacab052bfa566d04c9297288e96.camel@gmail.com
Am Montag, dem 23.12.2024 um 11:44 -0600 schrieb jgart:
Toggle quote (4 lines)
> * gnu/packages/emacs-xyz.scm (emacs-copilot): New variable.
>
> Change-Id: I3d693e5a59a28f488663421e6b2948cf8b51e031
> ---
Just had a look at it and `copilot-install-server` looks quite sus to
me.

Cheers
J
J
L
L
Liliana Marie Prikler wrote 15 hours ago
5967e5a799eb54ebcd61deb245cac8223bcc4ebf.camel@gmail.com
Am Dienstag, dem 24.12.2024 um 15:03 +0000 schrieb jgart:
Toggle quote (11 lines)
>
> > Just had a look at it and `copilot-install-server` looks quite sus
> > to me
>
>
> Which part looks sus besides the fact that the author says that they
> don't own the codes and that they are obfuscated and won't fix?
>
> https://github.com/jfcherng/copilot-node-server/issues/22#issuecomment-2560567220
>
> ?
Yeah, thanks for pointing that out. I feel like atm, since IIUC this
server is required to make the package work, you can not offer this as
"free software" in good conscience (said conscience being informed by
the literal letter of the FSDG saying "no").

Cheers
?
Your comment

Commenting via the web interface is currently disabled.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 62664
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch