[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#51838] [PATCH 00/11] guix: node-build-system: Support compiling add
From: |
Timothy Sample |
Subject: |
[bug#51838] [PATCH 00/11] guix: node-build-system: Support compiling add-ons with node-gyp. |
Date: |
Sun, 28 Nov 2021 14:27:56 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Hi Philip,
Philip McGrath <philip@philipmcgrath.com> writes:
> - (define (resolve-dependencies package-meta meta-key)
> - (fold (lambda (key+value acc)
> - (match key+value
> - ('@ acc)
> - ((key . value) (acons key (hash-ref index key value) acc))))
> + (define (resolve-dependencies meta-alist meta-key)
> + (match (assoc-ref meta-alist meta-key)
> + (#f
> + '())
> + (('@ . orig-deps)
> + (fold (match-lambda*
> + (('@ acc)
> + acc)
> + (((key . value) acc)
> + (if (member key absent-dependencies)
> + acc
> + (acons key (hash-ref index key value) acc))))
> '()
> - (or (assoc-ref package-meta meta-key) '())))
> + orig-deps))))
There’s a lot of refactoring going here in addition to change at hand.
To me, it needlessly obscures the actual change (which is just the check
for membership in 'absent-dependencies', AFAICS).
> (with-atomic-file-replacement "package.json"
> (lambda (in out)
> - (let ((package-meta (read-json in)))
> - (assoc-set! package-meta "dependencies"
> - (append
> - '(@)
> - (resolve-dependencies package-meta "dependencies")
> - (resolve-dependencies package-meta "peerDependencies")))
> - (assoc-set! package-meta "devDependencies"
> - (append
> - '(@)
> - (resolve-dependencies package-meta "devDependencies")))
> + ;; It is unsafe to rely on 'assoc-set!' to update an
> + ;; existing assosciation list variable:
> + ;; see 'info "(guile)Adding or Setting Alist Entries"'.
Good catch!
> + (let* ((package-meta (read-json in))
> + (alist (match package-meta
> + ((@ . alist) alist)))
Why do we have to unwrap (and then re-wrap later on) the alist? It
would be nice to explain that in the changelog. Maybe it’s just me, but
I can’t figure it out! :)
Thanks!
-- Tim
- [bug#51838] [PATCH 03/11] guix: node-build-system: Support compiling add-ons with node-gyp., (continued)
- [bug#51838] [PATCH v2 03/26] gnu: node: Patch shebangs in node_modules., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 07/26] gnu: node-ms-bootstrap: Use #:absent-dependencies., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 05/26] guix: node-build-system: Add #:absent-dependencies argument., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 05/26] guix: node-build-system: Add #:absent-dependencies argument., Liliana Marie Prikler, 2021/11/20
- [bug#51838] [PATCH v2 05/26] guix: node-build-system: Add #:absent-dependencies argument., Philip McGrath, 2021/11/20
- [bug#51838] [PATCH v2 05/26] guix: node-build-system: Add #:absent-dependencies argument., Liliana Marie Prikler, 2021/11/20
- [bug#51838] [PATCH 00/11] guix: node-build-system: Support compiling add-ons with node-gyp.,
Timothy Sample <=
- [bug#51838] [PATCH v2 04/26] gnu: node: Add an npmrc file to set nodedir., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 11/26] gnu: node-llparse-frontend-bootstrap: Use #:absent-dependencies., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 16/26] gnu: node-irc-colors: Use #:absent-dependencies., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 08/26] gnu: node-binary-search-bootstrap: Use #:absent-dependencies., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 02/26] gnu: node: Update to 10.24.1 for bootstrapping., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 09/26] gnu: node-debug-bootstrap: Use #:absent-dependencies., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 19/26] gnu: Add node-inherits., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 15/26] gnu: node-once: Use #:absent-dependencies., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 13/26] gnu: node-semver: Use #:absent-dependencies., Philip McGrath, 2021/11/19
- [bug#51838] [PATCH v2 10/26] gnu: node-llparse-builder-bootstrap: Use #:absent-dependencies., Philip McGrath, 2021/11/19