Skip to content

Cover all cases for rpath generation#4471

Merged
fmeum merged 7 commits intomasterfrom
4451-rpath
Oct 7, 2025
Merged

Cover all cases for rpath generation#4471
fmeum merged 7 commits intomasterfrom
4451-rpath

Conversation

@fmeum
Copy link
Copy Markdown
Member

@fmeum fmeum commented Oct 5, 2025

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

This is based on the corresponding logic in rules_cc.

Which issues(s) does this PR fix?

Fixes #4451

Other notes for review

@fmeum
Copy link
Copy Markdown
Member Author

fmeum commented Oct 5, 2025

@DolceTriade @scheremisin @dgoel Could you test this?

@fmeum fmeum marked this pull request as ready for review October 5, 2025 13:55
@fmeum fmeum requested a review from Copilot October 5, 2025 15:43
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes rpath generation for CGO libraries by implementing comprehensive coverage of different executable and library location scenarios based on Bazel's C++ rules logic. The fix addresses issue #4451 by ensuring that rpaths are correctly generated for various deployment patterns including cross-repository dependencies.

  • Updated rpath generation logic to handle all cases from Bazel's C++ rules
  • Added comprehensive test coverage for CGO libraries with shared dependencies
  • Removed custom _rlocation_path function in favor of direct short_path usage

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
go/private/rpath.bzl Updated rpath generation logic to cover all cases based on rules_cc implementation
tests/core/cgo/wrapped_cgo_test.go Added new test file for wrapped CGO functionality with shared libraries
tests/core/cgo/BUILD.bazel Added test target for wrapped CGO test with platform compatibility

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@DolceTriade
Copy link
Copy Markdown
Contributor

DolceTriade commented Oct 6, 2025

Thanks!! I removed our local hack and replaced it with this patch and our CI passed!

Thanks for the fix, it looks like the logic for rpaths is quite involved 😄

@fmeum fmeum requested review from jayconrod and linzhp October 7, 2025 08:07
@fmeum fmeum enabled auto-merge (squash) October 7, 2025 14:49
@fmeum fmeum merged commit 28ce041 into master Oct 7, 2025
4 checks passed
@fmeum fmeum deleted the 4451-rpath branch October 7, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shared libraries not found due to rpath changes in v0.56.0

4 participants