Skip to content

Commit 5a77a59

Browse files
authored
Add pkg_rpm() "data" attribute to provide files for rpmbuild (#964)
When building debuginfo packages, find-debuginfo is called by rpmbuild. To include the relevant source files, they will need to be accessible to find-debuginfo via rpmbuild. There are a number of other pieces required for an end-to-end solution with debuginfo, but they're outside the scope of rules_pkg, e.g. - customized find-debuginfo that can run inside bazel - special _find_debuginfo_opts used to locate source files - figuring out which source files to pass to pkg_rpm() in the first place. The key, though, is that pkg_rpm() accepts extra data in the first place. Fixes: #965
2 parents 359ea46 + f3ae90e commit 5a77a59

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/rpm_pfg.bzl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ def _pkg_rpm_impl(ctx):
878878
executable = ctx.executable._make_rpm,
879879
use_default_shell_env = True,
880880
arguments = rpm_ctx.make_rpm_args,
881-
inputs = files,
881+
inputs = files + (ctx.files.data or []),
882882
outputs = rpm_ctx.output_rpm_files,
883883
env = {
884884
"LANG": "en_US.UTF-8",
@@ -1279,6 +1279,10 @@ pkg_rpm = rule(
12791279
"rpmbuild_path": attr.string(
12801280
doc = """Path to a `rpmbuild` binary. Deprecated in favor of the rpmbuild toolchain""",
12811281
),
1282+
"data": attr.label_list(
1283+
doc = """Extra files that are needed by rpmbuild or find-debuginfo""",
1284+
allow_files = True,
1285+
),
12821286
# Implicit dependencies.
12831287
"_make_rpm": attr.label(
12841288
default = Label("//pkg:make_rpm"),

0 commit comments

Comments
 (0)