[PATCH] build: minify-build-system: Fail to install empty files.

DoneSubmitted by Efraim Flashner.
Details
One participant
  • Efraim Flashner
Owner
unassigned
Severity
normal
E
E
Efraim Flashner wrote on 6 May 2020 10:39
(address . guix-patches@gnu.org)(name . Efraim Flashner)(address . efraim@flashner.co.il)
20200506083923.14385-1-efraim@flashner.co.il
* guix/build/minify-build-system.scm (install): Produce an error if the
minified file is zero bytes.
---

I'm pretty sure this can go directly into master. 'guix refresh -l
uglify-js' shows 93 packages. 'guix refresh -l r-shiny' shows 71
packages. The 4 differing packages are hpcguix-web, calibre, mate and
snap.

My only real concern is that r-shiny is calling minify directly and so
we might want it to error during the 'build phase and not during the
'install phase.

---
guix/build/minify-build-system.scm | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

Toggle diff (28 lines)
diff --git a/guix/build/minify-build-system.scm b/guix/build/minify-build-system.scm
index 563def88e9..92158a033f 100644
--- a/guix/build/minify-build-system.scm
+++ b/guix/build/minify-build-system.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -54,8 +55,12 @@
   (let* ((out (assoc-ref outputs "out"))
          (js  (string-append out "/share/javascript/")))
     (mkdir-p js)
-    (for-each (cut install-file <> js)
-              (find-files "guix/build" "\\.min\\.js$")))
+    (for-each
+      (lambda (file)
+        (if (not (zero? (stat:size (stat file))))
+          (install-file file js)
+          (error "File is empty: " file)))
+      (find-files "guix/build" "\\.min\\.js$")))
   #t)
 
 (define %standard-phases
-- 
2.26.2
E
E
Efraim Flashner wrote on 18 May 2020 08:54
minify-build-system: Fail to install empty files
(address . 41105-done@debbugs.gnu.org)
20200518065406.GC18220@E5400
Patch pushed.

--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl7CMQ0ACgkQQarn3Mo9
g1E+aw/7BwK5scJJh+4BDDaEjQMXqiZVHriolyUkrpgxpuuH7HHHwraPl6WYNDsI
+fp9lQ8J3P8ghPwHdauAnmW/BdvpCowG9QPl8qZBJ/th4h4DYvuly32HWqmFILZB
F2qGAxzauYPOEY9pwbdjPj9dQMyz4RYCPLV1VOCptSbwlwrn8YpV510V1ubZG4rW
9+CEbyNZ4lVSw3zt1Rqyf/26r1VJ5eGbLYScKLbgdWI1laQJNOlt5DaF6zsMSFV+
NGUx+TmMh6iT+lHQ5Y4ZemWJkqvcGaKFX8icYAws3fT/WBzkFbj3vP/0obtHIuKC
dE+ex9NJUhHHcCe/tCRagyP5ot8HB328WdKPuhyrX9vT3Jfo5bkY+RBmlIRHR6Iy
7x9gjztxeVEwtjIEU6vknXHEnEsk/HJrYcmARzXzW6hYz62dUm9b/r4cYjrWlZ5O
aw0OYo2QNoOW16P6mjIr0qeOQupKbDIOhMgIsIURyNMnTq6s8VCne7o+OSGtYYZF
OuQg8RlCpyTC3i1ZQ63hZ2I3c+e//FF0dfNNV47HoAvFai2cano2lN6WFtPkVfeR
MoomyKKit7HrabZqiQavNeHIRhguUpS9oV/knu1iEFDEOWwWx2YRXXSvmxieGJhl
oxrLlU4tPModmZ6wvmFKtcIPOkp7nwk8lAosA4Aa4/4g6Jhwl8k=
=aM51
-----END PGP SIGNATURE-----


Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 41105@debbugs.gnu.org