Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg_rpm can't set package_file_name = ${package_name}.rpm #919

Open
ashi009 opened this issue Jan 16, 2025 · 0 comments
Open

pkg_rpm can't set package_file_name = ${package_name}.rpm #919

ashi009 opened this issue Jan 16, 2025 · 0 comments

Comments

@ashi009
Copy link

ashi009 commented Jan 16, 2025

When package_file_name = ${package_name}.rpm, the rule will fail:

ERROR: file 'test.rpm' is generated by these conflicting actions:
Label: //:rpm
RuleClass: pkg_rpm rule
JavaActionClass: class com.google.devtools.build.lib.analysis.actions.StarlarkAction, class com.google.devtools.build.lib.analysis.actions.SymlinkAction
Configuration: 211cf97c47c3c3c62956d4ca62222b55a5848ae6122e5c02c157c85559f94b7f
Mnemonic: MakeRpm, Symlink
Action key: e01d1825161e914df618d1befd116e60fa70bc978a57f884fe40324b1bee6e03, 7a39b61d5744a8903119e17b3ddc7e56e330f240d2bead98c3ba081a81b5c9ac
Progress message: MakeRpm test.rpm, Creating symlink bazel-out/aarch64-fastbuild/bin/test.rpm
Action describeKey: MakeRpm test.rpm
...

relevant callsites:

rules_pkg/pkg/rpm_pfg.bzl

Lines 492 to 497 in 12fed4b

if ctx.attr.package_name:
rpm_name = ctx.attr.package_name
else:
rpm_name = ctx.attr.name
default_file = ctx.actions.declare_file("{}.rpm".format(rpm_name))

rules_pkg/pkg/rpm_pfg.bzl

Lines 701 to 705 in 12fed4b

_, output_file, _ = setup_output_files(
ctx,
package_file_name = package_file_name,
default_output_file = default_file,
)

So the default_file is {rpm_name}.rpm where rpm_name is package_name, and output_file generates a file {package_file_name}, and it will cause the conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant