GNU bug report logs - #41219
Enforce "files" directive in node build system

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: goodoldpaul@HIDDEN; dated Tue, 12 May 2020 21:27:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 41219 <at> debbugs.gnu.org:


Received: (at 41219) by debbugs.gnu.org; 12 May 2020 21:31:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 12 17:31:55 2020
Received: from localhost ([127.0.0.1]:56705 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jYcVG-0001hE-Vt
	for submit <at> debbugs.gnu.org; Tue, 12 May 2020 17:31:55 -0400
Received: from latitanza.investici.org ([82.94.249.234]:23603)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <goodoldpaul@HIDDEN>) id 1jYcVC-0001c8-2r
 for 41219 <at> debbugs.gnu.org; Tue, 12 May 2020 17:31:51 -0400
Received: from mx3.investici.org (unknown [127.0.0.1])
 by latitanza.investici.org (Postfix) with ESMTP id 0AE471201B0;
 Tue, 12 May 2020 21:31:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org;
 s=stigmate; t=1589319109;
 bh=UgCtPwH+n1lUBmpaMidDDXgeqikVfNBOw4zW+dCZnr8=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=gFAzov8y05KEndP43PytNhexY+uQ4t/aWiAatwAhy+AAi6JuvquZ7nzY94k4bJJrj
 8scYp/Z/PILqWPKiLGg7F9/ZoQfcZ1GA4xCNMo0wUQI9od5NqcP4tddhlqI5tGAOFs
 7wmXjsEHv/cPujKtVbnVoOIrWWBoe6gBWXUEGOZU=
Received: from [82.94.249.234] (mx3.investici.org [82.94.249.234])
 (Authenticated sender: goodoldpaul@HIDDEN) by localhost (Postfix) with
 ESMTPSA id CEA6012016F; Tue, 12 May 2020 21:31:48 +0000 (UTC)
From: Giacomo Leidi <goodoldpaul@HIDDEN>
To: 41219 <at> debbugs.gnu.org
Subject: [PATCH 2/2] guix: Enforce package.json "files" directive.
Date: Tue, 12 May 2020 23:31:31 +0200
Message-Id: <20200512213131.28873-2-goodoldpaul@HIDDEN>
X-Mailer: git-send-email 2.26.2
In-Reply-To: <20200512213131.28873-1-goodoldpaul@HIDDEN>
References: <20200512213131.28873-1-goodoldpaul@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 41219
Cc: Giacomo Leidi <goodoldpaul@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

This fixes https://issues.guix.gnu.org/40710 by implementing support for the
"files" directive from https://docs.npmjs.com/files/package.json#files .

* guix/build/node-build-system.scm (install): Enforce package.json
"files" directive.
* guix/build-system/node.scm (%node-build-system-modules)
(node-build)[modules]: Add (guix glob).
---
 guix/build-system/node.scm       |  4 +-
 guix/build/node-build-system.scm | 68 ++++++++++++++++++++++++++------
 2 files changed, 58 insertions(+), 14 deletions(-)

diff --git a/guix/build-system/node.scm b/guix/build-system/node.scm
index 05c24c47d5..05bc9f2087 100644
--- a/guix/build-system/node.scm
+++ b/guix/build-system/node.scm
@@ -42,6 +42,7 @@ registry."
   `((guix build node-build-system)
     (guix build json)
     (guix build union)
+    (guix glob)
     ,@%gnu-build-system-modules)) ;; TODO: Might be not needed
 
 (define (default-node)
@@ -90,7 +91,8 @@ registry."
                      (modules '((guix build node-build-system)
 				(guix build json)
 				(guix build union)
-                                (guix build utils))))
+                                (guix build utils)
+                                (guix glob))))
   "Build SOURCE using NODE and INPUTS."
   (define builder
     `(begin
diff --git a/guix/build/node-build-system.scm b/guix/build/node-build-system.scm
index 7799f03595..befcbbeb75 100644
--- a/guix/build/node-build-system.scm
+++ b/guix/build/node-build-system.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 David Thompson <davet@HIDDEN>
 ;;; Copyright © 2016 Jelle Licht <jlicht@HIDDEN>
+;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -22,6 +23,7 @@
   #:use-module (guix build json)
   #:use-module (guix build union)
   #:use-module (guix build utils)
+  #:use-module (guix glob)
   #:use-module (ice-9 match)
   #:use-module (ice-9 popen)
   #:use-module (ice-9 regex)
@@ -110,18 +112,60 @@ the @file{bin} directory."
 				 (#f #f)))
          (dependencies (match (assoc-ref data "dependencies")
                          (('@ deps ...) deps)
-                         (#f #f))))
+                         (#f #f)))
+         (patterns (match (assoc-ref data "files")
+                     (() #f)
+                     ((? list? patrn-list) patrn-list)
+                     (#f #f)))
+         (main (match (assoc-ref data "main")
+                     ("" #f)
+                     ((? string? main-module) main-module)
+                     (#f #f)))
+         (install-dir (string-append target "/node_modules/" modulename))
+         (install-files (lambda (files directory)
+                          (for-each (lambda (file)
+                                      (install-file
+                                       file
+                                       (string-append directory "/"
+                                                      (dirname file))))
+                                    files))))
     (mkdir-p target)
-    (copy-recursively "." (string-append target "/node_modules/" modulename))
-    ;; Remove references to dependencies
-    (delete-file-recursively
-      (string-append target "/node_modules/" modulename "/node_modules"))
+    (if patterns
+        (install-files
+         (filter (lambda (file)
+                   (any (lambda (pattern)
+                          (glob-match?
+                           (string->compiled-sglob pattern)
+                           file))
+                        (append
+                         patterns
+                         '("package.json"
+                           ;; These files get installed no
+                           ;; matter the case or extension.
+                           "[rR][eE][aA][dD][mM][eE]*"
+                           "[cC][hH][aA][nN][gG][eE][sS]*"
+                           "[cC][hH][aA][nN][gG][eE][lL][oO][gG]*"
+                           "[hH][iI][sS][tT][oO][rR][yY]*"
+                           "[nN][oO][tT][iI][cC][eE]*"))))
+                 (map (lambda (path)
+                        (string-drop path 2))
+                      (find-files ".")))
+         install-dir)
+        (begin
+          (copy-recursively "." install-dir)
+          ;; Remove references to dependencies
+          (delete-file-recursively
+           (string-append install-dir "/node_modules"))))
+    (if (and main
+             (not (file-exists?
+                   (string-append
+                    install-dir "/" (dirname main)))))
+        (install-files (list main) install-dir))
     (cond
       ((string? binary-configuration)
        (begin
          (mkdir-p binaries)
-         (symlink (string-append target "/node_modules/" modulename "/"
-				 binary-configuration)
+         (symlink (string-append install-dir "/" binary-configuration)
                   (string-append binaries "/" modulename))))
       ((list? binary-configuration)
        (for-each
@@ -130,21 +174,19 @@ the @file{bin} directory."
              ((key . value)
               (begin
                 (mkdir-p (dirname (string-append binaries "/" key)))
-                (symlink (string-append target "/node_modules/" modulename "/"
-					value)
+                (symlink (string-append install-dir "/" value)
                          (string-append binaries "/" key))))))
-         binary-configuration)))
+        binary-configuration)))
     (when dependencies
       (mkdir-p
-        (string-append target "/node_modules/" modulename "/node_modules"))
+        (string-append install-dir "/node_modules"))
       (for-each
         (lambda (dependency)
           (let ((dependency (car dependency)))
             (symlink
               (string-append (assoc-ref inputs (string-append "node-" dependency))
                              "/lib/node_modules/" dependency)
-              (string-append target "/node_modules/" modulename
-                             "/node_modules/" dependency))))
+              (string-append install-dir "/node_modules/" dependency))))
         dependencies))
     #t))
 
-- 
2.26.2





Information forwarded to guix-patches@HIDDEN:
bug#41219; Package guix-patches. Full text available.

Message received at 41219 <at> debbugs.gnu.org:


Received: (at 41219) by debbugs.gnu.org; 12 May 2020 21:31:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 12 17:31:52 2020
Received: from localhost ([127.0.0.1]:56703 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jYcVD-0001dv-L1
	for submit <at> debbugs.gnu.org; Tue, 12 May 2020 17:31:51 -0400
Received: from latitanza.investici.org ([82.94.249.234]:62765)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <goodoldpaul@HIDDEN>) id 1jYcVC-0001c0-3S
 for 41219 <at> debbugs.gnu.org; Tue, 12 May 2020 17:31:50 -0400
Received: from mx3.investici.org (unknown [127.0.0.1])
 by latitanza.investici.org (Postfix) with ESMTP id B46F7120184;
 Tue, 12 May 2020 21:31:48 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org;
 s=stigmate; t=1589319108;
 bh=VumB0vjbeUS19YPIePpDLetCbxqDRy5iSc5eeZMLqgw=;
 h=From:To:Cc:Subject:Date:From;
 b=kJKq/HVDTOpx82dmXk3Uc3wn9rB8GU0D7zZh+igxJ1NszIj1c2Prqs5lm19J0hLLV
 GoZtsEav2yqEl69P3dBOc2VBlxIUjiPe/iLBGLAT4PQUfCVWGOPY2X+DvK58a+mbw4
 xR6+DzWKZpn944SNCXSLDNP352L1YQM1ENCjh2Sk=
Received: from [82.94.249.234] (mx3.investici.org [82.94.249.234])
 (Authenticated sender: goodoldpaul@HIDDEN) by localhost (Postfix) with
 ESMTPSA id 823D812016F; Tue, 12 May 2020 21:31:48 +0000 (UTC)
From: Giacomo Leidi <goodoldpaul@HIDDEN>
To: 41219 <at> debbugs.gnu.org
Subject: [PATCH 1/2] guix: Add globstar support.
Date: Tue, 12 May 2020 23:31:30 +0200
Message-Id: <20200512213131.28873-1-goodoldpaul@HIDDEN>
X-Mailer: git-send-email 2.26.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 41219
Cc: Giacomo Leidi <goodoldpaul@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* guix/glob.scm (string->sglob)
(glob-match?): Add globstar support.
* tests/glob.scm: Update accordingly.
---
 guix/glob.scm  | 15 +++++++++++++++
 tests/glob.scm |  8 ++++++--
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/guix/glob.scm b/guix/glob.scm
index a9fc744802..d73783cd30 100644
--- a/guix/glob.scm
+++ b/guix/glob.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -61,6 +62,11 @@ STR, a glob pattern such as \"foo*\" or \"foo??bar\"."
        (flatten (reverse (if (null? pending)
                              result
                              (cons-string pending result)))))
+      ((#\* #\* #\/ . rest)
+       (if (zero? brackets)
+           (loop rest '() 0
+                 (cons* '**/ (cons-string pending result)))
+           (loop rest (cons '**/ pending) brackets result)))
       (((and chr (or #\? #\*)) . rest)
        (let ((wildcard (match chr
                          (#\? '?)
@@ -121,6 +127,15 @@ STR, a glob pattern such as \"foo*\" or \"foo??bar\"."
       (string-null? str))
      (('*)
       #t)
+     (('**/)
+      #t)
+     (('**/ suffix . rest)
+      (let ((rest (if (eq? '* suffix) (cdr rest) rest))
+            (suffix (if (eq? '* suffix) (car rest) suffix)))
+        (match (string-contains str suffix)
+          (#f    #f)
+          (index (loop rest (string-drop str
+                                         (+ index (string-length suffix))))))))
      (('* suffix . rest)
       (match (string-contains str suffix)
         (#f    #f)
diff --git a/tests/glob.scm b/tests/glob.scm
index 3134069789..2a5a40c3c6 100644
--- a/tests/glob.scm
+++ b/tests/glob.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -53,7 +54,8 @@
  "foo[abc]bar" => '("foo" (set #\a #\b #\c) "bar")
  "foo[a[b]c]bar" => '("foo" (set #\a #\[ #\b #\] #\c) "bar")
  "[123]x" => '((set #\1 #\2 #\3) "x")
- "[a-z]" => '((range #\a #\z)))
+ "[a-z]" => '((range #\a #\z))
+ "**/*.scm" => '(**/ * ".scm"))
 
 (test-glob-match
  ("foo" matches "foo" (and not "foobar" "barfoo"))
@@ -64,6 +66,8 @@
  ("ab[0-9]c" matches "ab0c" "ab7c" "ab9c"
   (and not "ab-c" "ab00c" "ab3"))
  ("ab[cdefg]" matches "abc" "abd" "abg"
-  (and not "abh" "abcd" "ab[")))
+  (and not "abh" "abcd" "ab["))
+ ("foo/**/*.scm" matches "foo/bar/baz.scm" "foo/bar.scm" "foo/bar/baz/zab.scm"
+  (and not "foo/bar/baz.java" "foo/bar.smc")))
 
 (test-end "glob")
-- 
2.26.2





Information forwarded to guix-patches@HIDDEN:
bug#41219; Package guix-patches. Full text available.

Message received at 41219 <at> debbugs.gnu.org:


Received: (at 41219) by debbugs.gnu.org; 12 May 2020 21:30:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 12 17:30:52 2020
Received: from localhost ([127.0.0.1]:56698 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jYcUG-0000pK-AU
	for submit <at> debbugs.gnu.org; Tue, 12 May 2020 17:30:52 -0400
Received: from confino.investici.org ([212.103.72.250]:31591)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <goodoldpaul@HIDDEN>) id 1jYcUE-0000md-S3
 for 41219 <at> debbugs.gnu.org; Tue, 12 May 2020 17:30:51 -0400
Received: from 1.mail-backend.investici.org (unknown [10.0.0.11])
 by confino.investici.org (Postfix) with ESMTP id 1458A20FA4
 for <41219 <at> debbugs.gnu.org>; Tue, 12 May 2020 21:30:49 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org;
 s=stigmate; t=1589319049;
 bh=nSN96N9jkGv/Lx3SWKy/Suag5cJdjxQCXxvuh94W7Is=;
 h=Date:From:To:Subject:In-Reply-To:References:From;
 b=Oy3OSGCCQDOhyarBNSDVejWZq1k2Iv+bdh++0r5HL+Lkd8R57DeBS68TF6g3FrH+G
 PQvWXHUmMVh5sKrj/22lVYFRYzgk6o0/t8MUapxborlcsHypfO/c92Pk3ePC5Ij3dh
 yPont96/SrG56tFUFIZBtYqFdIIdmu7HlCj2qKYk=
Received: from 1.webmail.investici.org (localhost [127.0.0.1])
 (Authenticated sender: goodoldpaul@HIDDEN)
 by 1.mail-backend.investici.org (Postfix) with ESMTPA id E0BA7BEE39
 for <41219 <at> debbugs.gnu.org>; Tue, 12 May 2020 21:30:48 +0000 (UTC)
MIME-Version: 1.0
Date: Tue, 12 May 2020 21:30:48 +0000
From: goodoldpaul@HIDDEN
To: 41219 <at> debbugs.gnu.org
Subject: Re: [bug#41219] Enforce "files" directive in node build system
In-Reply-To: <5ec7ac973bb248a3cca0197836d35459@HIDDEN>
References: <5ec7ac973bb248a3cca0197836d35459@HIDDEN>
User-Agent: Roundcube Webmail
Message-ID: <f5d2082ad387f7547fa2f143b742559b@HIDDEN>
X-Sender: goodoldpaul@HIDDEN
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 41219
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 2020-05-12 21:26, goodoldpaul@HIDDEN wrote:
> Hi,
> 
> I'm sending a couple of patches to fix
> https://issues.guix.gnu.org/40710, I tried to base my implementation
> on [0].
> 
> The first patch adds "globstar" support to (guix glob), namely the
> ability of recursively matching subdirectories in a glob pattern (i.e.
> "foo/**/bar.scm" matches both "foo/bar.scm" and "foo/baz/bar.scm").
> 
> The second patch adds (guix glob) to the imported modules of
> node-build-system and uses that to parse glob patterns in the "files"
> array of a package.json and then install all the matching files.
> 
> I tested the patches by verifying that
> 
> ./pre-inst-env guix build -K node-semver node-util-deprecate
> node-statsd-parser node-stack-trace node-oop node-mersenne
> node-long-stack-traces node-far node-env-variable node-color-name
> 
> runs without error and   and by running make check 
> TESTS="tests/glob.scm" .

I apologize I sent by error without finishing.

Anyway I verified that the installed files match the "files" directive 
when present, otherwise we fall back to the original behavior of 
installing everything. I'm not really sure i added enough test cases in 
"tests/glob.scm", please do tell me if you believe I should add more.

Thank for your patience in reviewing this.

Giacomo




Information forwarded to guix-patches@HIDDEN:
bug#41219; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 12 May 2020 21:26:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 12 17:26:41 2020
Received: from localhost ([127.0.0.1]:56688 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jYcQD-0008KZ-IU
	for submit <at> debbugs.gnu.org; Tue, 12 May 2020 17:26:41 -0400
Received: from lists.gnu.org ([209.51.188.17]:43516)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <goodoldpaul@HIDDEN>) id 1jYcQB-0008KR-Py
 for submit <at> debbugs.gnu.org; Tue, 12 May 2020 17:26:40 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:35382)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <goodoldpaul@HIDDEN>)
 id 1jYcQB-0005nX-K0
 for guix-patches@HIDDEN; Tue, 12 May 2020 17:26:39 -0400
Received: from confino.investici.org ([212.103.72.250]:51501)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <goodoldpaul@HIDDEN>)
 id 1jYcQ9-0007u0-SB
 for guix-patches@HIDDEN; Tue, 12 May 2020 17:26:39 -0400
Received: from 1.mail-backend.investici.org (unknown [10.0.0.11])
 by confino.investici.org (Postfix) with ESMTP id 7FE3420F9F
 for <guix-patches@HIDDEN>; Tue, 12 May 2020 21:26:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org;
 s=stigmate; t=1589318782;
 bh=1XC2nQgzwEqHSrwwqLHWS0nyvP4PeC2NGmAg6K3CjV8=;
 h=Date:From:To:Subject:From;
 b=eLidAU8k//mG6oqpR2iFF7Iy+hRKiocKDIdjcLZyLKCCjOWuAHHEeu4N/6++tvt/C
 KpOlUZRN/cVYXTWrKIRs6H5eUZCbSF9ihL7NTHXL1duZJuXWIbYy4Q6hHXi9/ngVEr
 NgybGONDt14ZLipEyHhN+T9K+bULMbbnrwPmA5PM=
Received: from 1.webmail.investici.org (localhost [127.0.0.1])
 (Authenticated sender: goodoldpaul@HIDDEN)
 by 1.mail-backend.investici.org (Postfix) with ESMTPA id 52B8BBEE39
 for <guix-patches@HIDDEN>; Tue, 12 May 2020 21:26:22 +0000 (UTC)
MIME-Version: 1.0
Date: Tue, 12 May 2020 21:26:22 +0000
From: goodoldpaul@HIDDEN
To: guix-patches@HIDDEN
Subject: Enforce "files" directive in node build system
User-Agent: Roundcube Webmail
Message-ID: <5ec7ac973bb248a3cca0197836d35459@HIDDEN>
X-Sender: goodoldpaul@HIDDEN
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=212.103.72.250;
 envelope-from=goodoldpaul@HIDDEN; helo=confino.investici.org
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/12 17:12:46
X-ACL-Warn: Detected OS   = Linux 2.2.x-3.x [generic]
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001,
 URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

Hi,

I'm sending a couple of patches to fix 
https://issues.guix.gnu.org/40710, I tried to base my implementation on 
[0].

The first patch adds "globstar" support to (guix glob), namely the 
ability of recursively matching subdirectories in a glob pattern (i.e. 
"foo/**/bar.scm" matches both "foo/bar.scm" and "foo/baz/bar.scm").

The second patch adds (guix glob) to the imported modules of 
node-build-system and uses that to parse glob patterns in the "files" 
array of a package.json and then install all the matching files.

I tested the patches by verifying that

./pre-inst-env guix build -K node-semver node-util-deprecate 
node-statsd-parser node-stack-trace node-oop node-mersenne 
node-long-stack-traces node-far node-env-variable node-color-name

runs without error and   and by running make check 
TESTS="tests/glob.scm" .




Acknowledgement sent to goodoldpaul@HIDDEN:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#41219; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 12 May 2020 21:30:02 UTC

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