Skip to content

Always collect FileProvider's filesToBuild as data runfiles#16680

Merged
ShreeM01 merged 1 commit intobazelbuild:release-6.0.0from
fmeum:release-6.0.0-15052
Nov 8, 2022
Merged

Always collect FileProvider's filesToBuild as data runfiles#16680
ShreeM01 merged 1 commit intobazelbuild:release-6.0.0from
fmeum:release-6.0.0-15052

Conversation

@fmeum
Copy link
Copy Markdown
Collaborator

@fmeum fmeum commented Nov 7, 2022

Guidelines for Starlark rules suggest that data-like attributes on rules should always merge the default outputs of rule targets into the transitive runfiles. See:
https://docs.bazel.build/versions/main/skylark/rules.html#runfiles-features-to-avoid

As a result, Starlark rules generally don't (and shouldn't) explicitly include their default outputs into their runfiles. Before this commit, native rules did not merge these outputs in the same way as idiomatic Starlark rules, which led to unexpectedly absent runfiles.

Fixes #15043

Closes #16678.

PiperOrigin-RevId: 486663801
Change-Id: I4a30b8b8a4dfc84bf4de27fd7894dd48e795c081

@fmeum fmeum requested a review from ShreeM01 as a code owner November 7, 2022 17:58
@fmeum fmeum force-pushed the release-6.0.0-15052 branch 2 times, most recently from d7c78c3 to 7ba7323 Compare November 7, 2022 19:22
Guidelines for Starlark rules suggest that `data`-like attributes on
rules should always merge the default outputs of rule targets into the
transitive runfiles. See:
https://docs.bazel.build/versions/main/skylark/rules.html#runfiles-features-to-avoid

As a result, Starlark rules generally don't (and shouldn't) explicitly
include their default outputs into their runfiles. Before this commit,
native rules did not merge these outputs in the same way as idiomatic
Starlark rules, which led to unexpectedly absent runfiles.

Fixes bazelbuild#15043

Closes bazelbuild#15052.

PiperOrigin-RevId: 486663801
Change-Id: I4a30b8b8a4dfc84bf4de27fd7894dd48e795c081
@fmeum fmeum force-pushed the release-6.0.0-15052 branch from 7ba7323 to f34c45b Compare November 7, 2022 19:46
@ShreeM01 ShreeM01 added awaiting-review PR is awaiting review from an assigned reviewer team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts labels Nov 7, 2022
@fmeum
Copy link
Copy Markdown
Collaborator Author

fmeum commented Nov 8, 2022

@comius Could you review this cherry-pick?

@ShreeM01 ShreeM01 requested a review from comius November 8, 2022 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR is awaiting review from an assigned reviewer team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants