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

  • Open
  • quality assurance status badge
Details
5 participants
  • Brian Cully
  • Giovanni Biscuolo
  • jgart
  • Liliana Marie Prikler
  • 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.
?
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