summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2026-03-31 13:31:22 +0200
committerRicardo Wurmus <rekado@elephly.net>2026-03-31 18:44:30 +0200
commit7a68ab3a737cd48f5fa853b57e54303011d3d419 (patch)
tree4ce86368fef05d2a91c90204ed2ab237ab411ebc /guix
parent5008165e741546eec1990e000045a8173b8546d0 (diff)
import/cran: Use SPAWN instead of SYSTEM*.
With SYSTEM* we see a file descriptor leak. See the discussion at <https://codeberg.org/guix-science/guix-cran-scripts/issues/5>. There is no such leak when using SPAWN. * guix/import/cran.scm (fetch-description-from-tarball, source->dependencies): Use SPAWN instead of SYSTEM*. Change-Id: Idb13f775317e6d5d426f8675e169f0ebbe246fe2
Diffstat (limited to 'guix')
-rw-r--r--guix/import/cran.scm21
1 files changed, 10 insertions, 11 deletions
diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index 90d26b26d0..6cbaf6db92 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -280,15 +280,15 @@ return the resulting alist."
(tarball
(call-with-temporary-directory
(lambda (dir)
- (parameterize ((current-error-port (%make-void-port "rw+"))
- (current-output-port (%make-void-port "rw+")))
- (and (zero? (system* "tar" "--wildcards" "-x"
- "--strip-components=1"
- "-C" dir
- "-f" tarball "*/DESCRIPTION"))
- (description->alist
- (call-with-input-file (string-append dir "/DESCRIPTION")
- read-string)))))))))
+ (and (match (waitpid (spawn "tar" `("tar" "--wildcards" "-x"
+ "--strip-components=1"
+ "-C" ,dir
+ "-f" ,tarball "*/DESCRIPTION")))
+ ((pid . status)
+ (zero? status)))
+ (description->alist
+ (call-with-input-file (string-append dir "/DESCRIPTION")
+ read-string))))))))
(define* (fetch-description repository name #:optional version replacement-download)
"Return an alist of the contents of the DESCRIPTION file for the R package
@@ -709,8 +709,7 @@ by TARBALL?"
(if tarball?
(call-with-temporary-directory
(lambda (dir)
- (parameterize ((current-error-port (%make-void-port "rw+")))
- (system* "tar" "xf" source "-C" dir))
+ (waitpid (spawn "tar" `("tar" "xf" ,source "-C" ,dir)))
(source-dir->dependencies dir)))
(source-dir->dependencies source)))