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

Always collect FileProvider's filesToBuild as data runfiles #16680

Merged
merged 1 commit into from
Nov 8, 2022

Conversation

fmeum
Copy link
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
@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
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