-
Notifications
You must be signed in to change notification settings - Fork 217
pkg_rpm fails trying to create an empty rpm package #711
Copy link
Copy link
Closed
Labels
P3An issue that we are not working on but will review quarterlyAn issue that we are not working on but will review quarterlyrpm
Description
Given the following:
pkg_files(
name = "empty",
srcs = [],
)
pkg_rpm(
name = "empty_rpm",
srcs = [
":empty",
],
architecture = "noarch",
description = """description""",
license = "Apache 2.0",
summary = "summary",
version = "1.0",
)empty_rpm will eventually fail to build with:
error: Empty %files file /tmp/tmpa07nyy51/BUILD/empty_rpm.spec.files
Creating an empty package should be possible. For example, one could wish to create a package consisting entirely of metadata that requires other packages. There are two ways users could hit this issue:
- Users could (inadvertently) create a
pkg_fileswith an empty input and pass it topkg_rpm. The error presented to the user is related topkg_rpminternals and is not useful to end-users. - Users could deliberately pass in an empty
srcsvalue topkg_rpm. In this case, we get a failure in thepkg_rpmwrapper macro due to relaxed boolean checks on incoming values (empty lists are "falsey"). Checking specifically forNoneshould be enough. When tested locally, this ends up producing the same error as above.
IMO, making srcs non-mandatory is not a good idea, as requiring its presence (even if it is an empty value) makes the intent clearer.
Other packages (debian packages?) may also have this need as well.
#209 may help to simplify the fix here, but it is not necessary to address this problem.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3An issue that we are not working on but will review quarterlyAn issue that we are not working on but will review quarterlyrpm