unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#41105] [PATCH] build: minify-build-system: Fail to install empty files.
@ 2020-05-06  8:39 Efraim Flashner
  2020-05-18  6:54 ` bug#41105: " Efraim Flashner
  0 siblings, 1 reply; 2+ messages in thread
From: Efraim Flashner @ 2020-05-06  8:39 UTC (permalink / raw)
  To: 41105; +Cc: Efraim Flashner

* 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(-)

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





^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-18  6:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-06  8:39 [bug#41105] [PATCH] build: minify-build-system: Fail to install empty files Efraim Flashner
2020-05-18  6:54 ` bug#41105: " Efraim Flashner

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).