felix.winkelm...@bevuta.com wrote:
> Reported by wasamasa.
> 

Resurecting this bug report.

As reference, here is an example egg file that shows the error (from wasamasa):

((synopsis "Broken")
 (components (program test (component-dependencies test-files))
             (data test-files (files "test.txt"))))

Unknown component dependenciy errors are already handled in filter-deps, the 
problem here is trying to generate build commands for data files.

The original proposed patch displays an error message even though the egg file 
is valid, it’s just a no-op to have a data component as a dependency, because 
the data is always there.
I think having this kind of error message (“unknown dependency: test-files” for 
the above example) would be very confusing.

Here is a different patch for this issue: it just adds the three missing cases 
for static data components, mapping them to an empty build command list.
For good measure there’s also a fallback case that prints an error message 
indicating that there is a bug in chicken-install if we someday add a new 
component type and forget to add its build commands.

From 648331dda85ec4de1ef3ee2c07d5dead0c22c61f Mon Sep 17 00:00:00 2001
From: Kooda <ko...@upyum.com>
Date: Wed, 3 Mar 2021 11:49:57 +0100
Subject: [PATCH] =?UTF-8?q?chicken-install:=20don=E2=80=99t=20try=20to=20g?=
 =?UTF-8?q?enerate=20build=20commands=20for=20data=20components?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 egg-compile.scm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/egg-compile.scm b/egg-compile.scm
index be05f6a6..a4c4bf0c 100644
--- a/egg-compile.scm
+++ b/egg-compile.scm
@@ -526,9 +526,14 @@
                                (if (memq 'static link)
                                    (list (apply compile-static-object data))
                                    '())))))
-                  (else
-                    (let ((data (assq id genfiles)))
-                      (list (apply compile-generated-file data))))))
+                  ((assq id genfiles) =>
+                   (lambda (data)
+                     (list (apply compile-generated-file data))))
+                  ((or (assq id data)
+                       (assq id cinc)
+                       (assq id scminc))
+                   '()) ;; nothing to build for data components
+                  (else (error "Error in chicken-install, don't know how to 
build component" id))))
           order)
         ;; installation commands
         (append
-- 
2.30.0

Reply via email to