GNU bug report logs - #49946
[PATCH 00/31] Tree-sitter, node-gyp addon support and emacs-tree-sitter

Previous Next

Package: guix-patches;

Reported by: Pierre Langlois <pierre.langlois <at> gmx.com>

Date: Sun, 8 Aug 2021 23:27:01 UTC

Severity: normal

Tags: patch

Full log


Message #755 received at 49946 <at> debbugs.gnu.org (full text, mbox):

From: "(" <paren <at> disroot.org>
To: "Pierre Langlois" <pierre.langlois <at> gmx.com>, <49946 <at> debbugs.gnu.org>
Subject: Re: [bug#49946] [PATCH v7 05/32] gnu: Add tree-sitter-cli.
Date: Fri, 25 Nov 2022 06:52:59 +0000
On Fri Nov 25, 2022 at 1:21 AM GMT, Pierre Langlois wrote:
> * gnu/packages/tree-sitter.scm (tree-sitter-cli): New variable.

> --- a/gnu/packages/tree-sitter.scm
> +++ b/gnu/packages/tree-sitter.scm

> @@ -76,3 +79,80 @@ (define-public tree-sitter
> +              (snippet
> +               '(begin

Please use a gexp here.

> +                  (with-output-to-file "lib/binding_rust/build.rs"
> +                    (lambda _
> +                      (format #t "fn main() {~@
> +                              println!(\"cargo:rustc-link-lib=tree-sitter\");~@
> +                              }~%")))
> +                  #t))))

The #T is redundant.

> +    (arguments
> +     `(;; Running test requires downloading fixtures, see the

Please use LIST.

> +       ;; script/fetch-fixtures script.
> +       #:tests? #f

Couldn't we fetch the fixtures ourselves with a secondary origin,
like I did here? <https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/golang.scm#n10561>

> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-after 'unpack 'delete-cargo.lock
> +           (lambda _ (delete-file "Cargo.lock")))
> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (bin (string-append out "/bin"))
> +                    (lib (string-append out "/lib")))
> +               (mkdir-p bin)
> +               (install-file "target/release/tree-sitter" bin)))))))

Update this to modern Guix style, please:

  #~(modify-phases %standard-phases
      (add-after 'unpack 'delete-cargo-lock
        (lambda _
          (delete-file "Cargo.lock")))
      (replace 'install
        (lambda* (#:key outputs #:allow-other-keys)
          (let ((bin (string-append #$output "/bin")))
            (mkdir-p bin)
            (install-file "target/release/tree-sitter" bin)))))

    -- (




This bug report was last modified 2 years and 120 days ago.

Previous Next


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