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

Add RunfilesLibraryInfo #16125

Closed

Conversation

fmeum
Copy link
Collaborator

@fmeum fmeum commented Aug 18, 2022

The new provider marks runfiles libraries as such and will be used by
both Bazel itself and language rules to emit additional information
required for executable targets to find their runfiles in the presence
of repository mappings.

Work towards #16124

The new provider marks runfiles libraries as such and will be used by
both Bazel itself and language rules to emit additional information
required for executable targets to find their runfiles in the presence
of repository mappings.

Work towards bazelbuild#16124
@fmeum
Copy link
Collaborator Author

fmeum commented Aug 18, 2022

@Wyverald

@sgowroji sgowroji added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Aug 18, 2022
@oquenchil
Copy link
Contributor

Hey Fabian,

@Wyverald showed me the error you were getting with this in testNoRunfilesLibraryUsers. But I'm confused why you need this provider, I thought in the proposal we had concluded that we can use the existing runfiles provider. Why do you need to know if the dependency is actually giving you runfiles or not? If you do need to know, I think you can get to the runfiles from the DefaultInfo provider and check if the depset of files is empty or not.

@fmeum
Copy link
Collaborator Author

fmeum commented Aug 22, 2022

@oquenchil This is a bit confusing, so let me try to clarify the situation: The RunfilesLibraryInfo provider is meant to mark a dependency as providing a runfiles library, not merely (and not necessarily) runfiles. For example, once the proposal has been implemented, @bazel_tools//tools/cpp/runfiles will advertise this provider. Direct dependents of targets advertising this provider will be tracked as "runfiles library users" in the existing RunfilesProvider - this is what I initially thought I needed a second new provider (which I called RunfilesLibraryUsersProvider) for.

The RunfilesLibraryInfo is needed because e.g. Java rules need to emit additional actions to make the current repository name available to code as a constant - this should only happen for targets that actually need it. Furthermore, the list of runfiles library users can be used to trim down the repository mapping manifest, which allows for more efficient caching in the face of changes to third-party dependencies' repository mappings.

Thanks for looking into the test failure, please let me know if you want additional clarifications.

@oquenchil
Copy link
Contributor

Thanks for the clarification Fabian. You are getting a Skyframe error and I'm not very familiar with it. @Wyverald will be asking around though. In the mean time, it might help them if you can upload the whole change that produces this error.

@fmeum
Copy link
Collaborator Author

fmeum commented Aug 22, 2022

@oquenchil I pushed the failing test as a new commit 7304185 on #16126.

Copy link
Contributor

@oquenchil oquenchil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@oquenchil oquenchil added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Aug 26, 2022
@Wyverald
Copy link
Member

@sgowroji could you import this? Thanks!

@sgowroji sgowroji removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Aug 30, 2022
aiuto pushed a commit to aiuto/bazel that referenced this pull request Oct 12, 2022
The new provider marks runfiles libraries as such and will be used by
both Bazel itself and language rules to emit additional information
required for executable targets to find their runfiles in the presence
of repository mappings.

Work towards bazelbuild#16124

Closes bazelbuild#16125.

PiperOrigin-RevId: 470966227
Change-Id: Ie9b4dc69bdd4d8f85485fa04efa347ebbd07b8b5
copybara-service bot pushed a commit that referenced this pull request Oct 25, 2022
*** Reason for rollback ***

We're no longer going with this approach.

*** Original change description ***

Add RunfilesLibraryInfo

The new provider marks runfiles libraries as such and will be used by
both Bazel itself and language rules to emit additional information
required for executable targets to find their runfiles in the presence
of repository mappings.

Work towards #16124

Closes #16125.

PiperOrigin-RevId: 483622668
Change-Id: I599d588cbed27c08466cc1311779925bd39a77fc
Wyverald added a commit that referenced this pull request Oct 25, 2022
*** Reason for rollback ***

We're no longer going with this approach.

*** Original change description ***

Add RunfilesLibraryInfo

The new provider marks runfiles libraries as such and will be used by
both Bazel itself and language rules to emit additional information
required for executable targets to find their runfiles in the presence
of repository mappings.

Work towards #16124

Closes #16125.

PiperOrigin-RevId: 483622668
Change-Id: I599d588cbed27c08466cc1311779925bd39a77fc
Wyverald added a commit that referenced this pull request Oct 25, 2022
*** Reason for rollback ***

We're no longer going with this approach.

*** Original change description ***

Add RunfilesLibraryInfo

The new provider marks runfiles libraries as such and will be used by
both Bazel itself and language rules to emit additional information
required for executable targets to find their runfiles in the presence
of repository mappings.

Work towards #16124

Closes #16125.

PiperOrigin-RevId: 483622668
Change-Id: I599d588cbed27c08466cc1311779925bd39a77fc
coeuvre pushed a commit to coeuvre/bazel that referenced this pull request Oct 26, 2022
*** Reason for rollback ***

We're no longer going with this approach.

*** Original change description ***

Add RunfilesLibraryInfo

The new provider marks runfiles libraries as such and will be used by
both Bazel itself and language rules to emit additional information
required for executable targets to find their runfiles in the presence
of repository mappings.

Work towards bazelbuild#16124

Closes bazelbuild#16125.

PiperOrigin-RevId: 483622668
Change-Id: I599d588cbed27c08466cc1311779925bd39a77fc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants