-
Notifications
You must be signed in to change notification settings - Fork 25
Fix issues on bazeldnf and xattr rule invocations #135
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
Conversation
Fix errors like ``` $ bazel run //rpm:ldd_x86_64 DEBUG: /usr/local/google/home/rmohr/.cache/bazel/_bazel_rmohr/4c1501bf8a3fa32b59ed554fc2f4f732/external/bazeldnf/def.bzl:10:10: import this method from @bazeldnf//bazeldnf:defs.bzl ERROR: /usr/local/google/home/rmohr/gerrit/kubevirt/rpm/BUILD.bazel:21:9: in _bazeldnf rule //rpm:ldd_x86_64: Traceback (most recent call last): File "/usr/local/google/home/rmohr/.cache/bazel/_bazel_rmohr/4c1501bf8a3fa32b59ed554fc2f4f732/external/bazeldnf/internal/bazeldnf.bzl", line 18, column 39, in _bazeldnf_impl transitive_dependencies.extend(ctx.attr.tar.files) Error in extend: type 'depset' is not iterable ``` Signed-off-by: Roman Mohr <rmohr@google.com>
By accident arrays of capabilities were added insteads of strings. Fixes errors like ``` ERROR: /usr/local/google/home/rmohr/gerrit/kubevirt/cmd/virt-launcher/BUILD.bazel:73:7: in _xattrs rule //cmd/virt-launcher:blub: Traceback (most recent call last): File "/usr/local/google/home/rmohr/.cache/bazel/_bazel_rmohr/4c1501bf8a3fa32b59ed554fc2f4f732/external/bazeldnf/internal/xattrs.bzl", line 28, column 44, in _xattrs_impl args += ["--capabilities", ",".join(capabilities)] Error in join: expected string for sequence element 0, got 'list' ``` Signed-off-by: Roman Mohr <rmohr@google.com>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use ctx.actions.args instead, it knows how to expand depart when used with joinall and others, but maybe that can wait another PR and not as part of this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to replace with ctx.actions.args
Do you have an example pointer? I can do a follow-up. |
https://www.stevenengelhardt.com/2020/11/12/practical-bazel-use-ctx.actions.args-to-form-arguments-lists/ there's and add_all_joined that takes a separator as argument, it has slight performance improvements as depsets are only expanded on the build phase and not at analysis |
…patibility The new version has a few fixes which are potentially hit on newer bazel versions due to plugin code changes and is also module ready in principle. Most notably it brings in rmohr/bazeldnf#135.
…patibility The new version has a few fixes which are potentially hit on newer bazel versions due to plugin code changes and is also module ready in principle. Most notably it brings in rmohr/bazeldnf#135. Signed-off-by: Roman Mohr <rmohr@google.com>
…patibility The new version has a few fixes which are potentially hit on newer bazel versions due to plugin code changes and is also module ready in principle. Most notably it brings in rmohr/bazeldnf#135. Signed-off-by: Roman Mohr <rmohr@google.com>
…patibility The new version has a few fixes which are potentially hit on newer bazel versions due to plugin code changes and is also module ready in principle. Most notably it brings in rmohr/bazeldnf#135. Signed-off-by: Roman Mohr <rmohr@google.com>
First, if bazeldnf is invoked via bazel itself, transitive dependencies are treated as iterables, which is long deprecated and which can fail on newer versions with:
Second, the
xattr
rule was not properly constructing the arguments list which seems to only now be visible: