-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Difference between files and runfiles providers is unclear #4519
Comments
Shouldn't these be propagated using the runfiles provider?
|
I think this has always been the behavior. At least, I can't see that this behavior has changed recently looking at the code. |
cc @buchgr |
Still seems to be relevant in version 3.4.0. |
This keeps biting me. It seems very strange to me, that a rule that generates a generic file has to provide it as both |
For the difference between "files" ("FilesToBuild" in the Java code) and "runfiles", see this comment. Perhaps we could elevate that information to documentation, if not already present. I'll admit, I was confused at first by the example. One could also interpret this issue as a feature request to treat the |
We just also hit this (target using a custom rule outputting I think the confusion mostly comes from an assumption that In reality, In addition, maybe some code changes could be made to make this a bit more obvious - maybe if a target's output is directly included as the runfiles of another target, Bazel should warn when there is a direct inclusion of an output with empty DefaultInfo.runfiles, and that is probably not what the user meant? Defaulting to runfiles=files if not set otherwise is tempting, but I'd be afraid of breakage this would cause. And it would probably muddle the distinction even further. |
#15052 changes the behaviour to reflect the understanding that a lot of people had, that runfiles are additional files needed at runtime by the files declared as regular outputs, so files that are declared as default outputs shouldn't be declared in runfiles. |
As @uri-canva explained, this has been fixed by #15052, which is in Bazel 6. Just a nitpick: "... files that are declared as default outputs shouldn't be declared in runfiles." should be "... files that are declared as default outputs don't have to be declared in runfiles." @sgowroji Could you close this issue as completed? |
Description of the problem / feature request
Given the following three files (
BUILD
,rule.bzl
,the_test.sh
) I would expect the output of the test to include the generated data file. However, the output does not -- it seems like files included in the DefaultInfo provider of a Skylark rule do not get used in the sh_test data or runfiles sets.@dslomov's comment on an ancient issue from 2016 (#1305 (comment)) implies this used to work, or at least is expected to work. However, it doesn't seem to in contemporary Bazel versions.
What operating system are you running Bazel on?
MacOS
What's the output of
bazel info release
?The text was updated successfully, but these errors were encountered: