Don't swallow runfiles of srcs in data runfiles of filegroup#25365
Don't swallow runfiles of srcs in data runfiles of filegroup#25365fmeum wants to merge 1 commit intobazelbuild:masterfrom
srcs in data runfiles of filegroup#25365Conversation
The `data_runfiles` of a `filegroup` should contain the `data_runfiles` of all deps in `srcs`, plus the `data_runfiles` of all deps in `data`. Previously, they didn't contain the former.
|
I'm not entirely sure whether the correct behavior would be to merge in the |
|
Thanks, the run looks good, all failures are caused by known issues. |
|
Ow. This is definitely a change that I'd love to land ( Hm? |
|
Sounds good! |
|
Update: the overnight test sampling run (all I could do overnight) came back clean and I kicked off the full test run. Results should be in in a few hours. |
| ruleContext.getWorkspaceName(), configuration.legacyExternalRunfiles()) | ||
| .addTransitiveArtifacts(filesToBuild) | ||
| .addDataDeps(ruleContext) | ||
| .addRunfiles(ruleContext, RunfilesProvider.DATA_RUNFILES) |
There was a problem hiding this comment.
@lberki If you want this to be DEFAULT_RUNFILES so that it's not changed again later, I'm okay with that too.
There was a problem hiding this comment.
Meh let's not poke that beast
|
I ran our internal test battery and it looks fine. Let's merge this and thanks for your patience! |
*** Reason for rollback *** b/400902205, breaks blaze nightly build 2025-03-01 ff. *** Original change description *** Don't swallow runfiles of `srcs` in data runfiles of `filegroup` The `data_runfiles` of a `filegroup` should contain the `data_runfiles` of all deps in `srcs`, plus the `data_runfiles` of all deps in `data`. Previously, they didn't contain the former. Related to #25329 (comment) Closes #25365. PiperOrigin-RevId: 733682081 Change-Id: Ibdc06c70e585758fe19ff8666aa4a02adaa0d348
|
@lberki Can you share more details on the reason for the rollback? |
|
It's a few failing tests with quite possible a single root cause that I keep not finding enough time to debug :( |
|
I did some debugging (for Googlers, link is b/405063764) and it looks like there are three different root causes, all because this change adds some extra files to the runfiles trees of some tests, which tips two tests over the maximum size of nput files and confuses one test. I'm afraid this'll require quite some debugging on our part. |
|
Looking at this more deeply, I'm not entirely sure that this is the right fix. I do realize that there is a comment that says that filegroups should visit their data dependencies as data and their srcs as default, but one could argue that semantically, not doing the latter works better. Is there an alternative fix? I'm currently elbow deep into some hairy Starlark rules to figure out where the extra files come from and I'm not sure if I can fix these without causing collateral damage. |
|
I tracked down one of the failures and it's indeed as I suspected. The structure is like this: And this change adds |
|
I would go as far as calling that the only reasonable behavior, but I can see how that would require some cleanup. :-) |
Why's that? My mental model is that the concept of "data runfiles" is not very well defined and if you accept that as a fact, it's difficult to argue for any sort of behavior based on principles. |
|
Did you mean to write "to the data runfiles of |
|
A different perspective: behaves just like whatever |
|
@fmeum that's a sound line of reasoning, although if you think a step deeper, the inevitable conclusion is that since filegroup is just, well, a group of files, the "data" attribute on it doesn't make sense at all. But there we are...
Technically, yes, to the data runfiles of |
|
@lberki I took another look at the motivating issue #25513, which doesn't use the I find it extremely surprising that the runfile I'm ultimately fine with any kind of semantics of |
|
@lberki Do you think if it's feasible to just fix the internal tests? If so, I can also help with that. |
|
It's at least not easy. The obvious fix would be to merge the runfiles so that what |
|
@fmeum Sorry, it looks like it'll take a significant amount of work to fix google internal projects, is there any other workaround to make Bazel's downstream green again? |
|
I'll send a targeted fix. |
If true, runfiles of targets listed in the srcs attribute of a filegroup are available to targets that consume the filegroup as a data dependency. Reland of bazelbuild#25365 behind an incompatible flag Closes bazelbuild#25978. PiperOrigin-RevId: 772841978 Change-Id: Ia8f126bb33e02969eafdbd6972c83f5350d58be2 (cherry picked from commit cac453b)
If true, runfiles of targets listed in the srcs attribute of a filegroup are available to targets that consume the filegroup as a data dependency. Reland of bazelbuild#25365 behind an incompatible flag Closes bazelbuild#25978. PiperOrigin-RevId: 772841978 Change-Id: Ia8f126bb33e02969eafdbd6972c83f5350d58be2 (cherry picked from commit cac453b)
If true, runfiles of targets listed in the srcs attribute of a filegroup are available to targets that consume the filegroup as a data dependency. Reland of #25365 behind an incompatible flag Closes #25978. PiperOrigin-RevId: 772841978 Change-Id: Ia8f126bb33e02969eafdbd6972c83f5350d58be2 (cherry picked from commit cac453b) Closes #26419
The
data_runfilesof afilegroupshould contain thedata_runfilesof all deps insrcs, plus thedata_runfilesof all deps indata. Previously, they didn't contain the former.Related to #25329 (comment)