Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Fix Bazel incompatible issues. #648

Merged
merged 9 commits into from
Jan 11, 2019
Merged

Fix Bazel incompatible issues. #648

merged 9 commits into from
Jan 11, 2019

Conversation

xingao267
Copy link
Member

@xingao267
Copy link
Member Author

@laurentlb could you help take a look at this PR which resolve various Bazel incompatible issues?

Copy link
Contributor

@nlopezgi nlopezgi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm overall, but lets hold off until laurent comments to submit

@k8s-ci-robot k8s-ci-robot removed the lgtm label Jan 10, 2019
Copy link
Contributor

@laurentlb laurentlb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, it's very appreciated

(feel free to ignore the comment regarding depsets, or address it later - your PR is already a nice improvement)

if hasattr(f, "files"): # a jar file
files += list(f.files)
files += f.files.to_list()
return files
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to have java_files and java_files_with_data return depsets, because:

  • most call sites convert the list to a depset
  • you can avoid the .to_list() above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion. I'll do do that in a separate PR.

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: laurentlb, nlopezgi, xingao267
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approvers:

If they are not already assigned, you can assign the PR to them by writing /assign in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot removed the lgtm label Jan 11, 2019
@k8s-ci-robot
Copy link

New changes are detected. LGTM label has been removed.

@xingao267 xingao267 merged commit a98bc3b into bazelbuild:master Jan 11, 2019
@xingao267 xingao267 deleted the fix branch January 11, 2019 16:00
@@ -229,8 +229,8 @@ def _assemble_image_digest(ctx, name, image, image_tarball, output_digest):

ctx.actions.run(
outputs = [output_digest],
inputs = [image["config"]] + blobsums + blobs +
([image["legacy"]] if image.get("legacy") else []),
tools = [image["config"]] + blobsums + blobs +
Copy link
Contributor

@ash2k ash2k Mar 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xingao267 what is the reason for this change? Just trying to understand. I thought tools is for "tools" that are used to perform the action and the inputs are for inputs i.e. files that are processed by the tools. Here all these things are inputs, not files, I think. Same in other files below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I think I made that change because Bazel complains that some of these files were executable, so I put them into tools according to https://docs.bazel.build/versions/master/skylark/backward-compatibility.html#disallow-tools-in-action-inputs. Let me try to change it back to inputs to see if the CI complains about it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why they are executable... From that page:

In the rare case that your action requires a tool as input, but does not actually run the tool and therefore does not need its runfiles, the safety check will fail even though the action would have succeeded. In this case, you can bypass the check by adding a (possibly empty) tools argument to your action.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea. I was surprising too. I sent https://github.com/bazelbuild/rules_docker/pull/716/files to changed it back and I think it's fine. Maybe I mistakenly changed it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing out!

grepwood pushed a commit to grepwood/rules_docker that referenced this pull request Mar 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants