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

Bazel warns the genrule //example:base which outputs a directory #65

Closed
tetsuok opened this issue Feb 12, 2023 · 3 comments · Fixed by #165
Closed

Bazel warns the genrule //example:base which outputs a directory #65

tetsuok opened this issue Feb 12, 2023 · 3 comments · Fixed by #165
Assignees

Comments

@tetsuok
Copy link
Contributor

tetsuok commented Feb 12, 2023

When I build //example:base and other targets that depend on it, Bazel warns the output of //example:base is a directory as follows:

$ bazel build //example:base
...
WARNING: /Volumes/work/github/rules_oci/example/BUILD.bazel:25:8: output 'example/layout' of //example:base is a directory; dependency checking of directories is unsound

Build itself succeeds, but it would be nice to fix the warning or work around the underlying issue.

I see the similar warning when I ran bazel build //src:image in e2e/js_image_oci of rules_js (Probably, the root cause of the warning is same):

WARNING: /private/var/tmp/_bazel_t/ce0e746d0a64bfce50fc270eb1254184/external/debian_amd64/BUILD.bazel:2:8: output 'external/debian_amd64/layout' of @debian_amd64//:image is a directory; dependency checking of directories is unsound
alexeagle pushed a commit that referenced this issue Mar 12, 2023
* Add rules_foreign_cc 0.8.0 implementation

* Add rules_foreign_cc 0.9.0
@alexeagle
Copy link
Collaborator

I don't think we can do anything about this. We use genrule in that example. https://docs.aspect.build/rules/aspect_bazel_lib/docs/run_binary/ knows how to produce directory outputs, but doesn't permit a bash one-liner like we use in that example.

I think the upside is that users would generally never use a genrule. Maybe we could even remove that from our examples, or make an examples/genrule folder that is documented as "produces a warning from Bazel, don't do it this way unless you have reason X or Y"

@alexeagle
Copy link
Collaborator

@thesayyn I think we should just change //examples:base to use our normal oci_pull mechanism now, this was using crane pull in a genrule for historical reasons.

@thesayyn
Copy link
Collaborator

@thesayyn I think we should just change //examples:base to use our normal oci_pull mechanism now, this was using crane pull in a genrule for historical reasons.

done in #165 but i needed to fix #151 so working on it.

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

Successfully merging a pull request may close this issue.

3 participants