Skip to content

Handle debug info packages separately when using cc_common.link #3257

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

Merged
merged 2 commits into from
Feb 27, 2025

Conversation

yuzhy8701
Copy link
Contributor

@yuzhy8701 yuzhy8701 commented Feb 11, 2025

Debug info packages (dSYM, pdb) are created by rustc only if you link with rustc. When linking with cc_common, they should be handled by the cc toolchain or a custom aspect. Declaring them prematurely can cause conflicts.

This PR removes the dsym_folder declaration if cc_common.link is being used - since cc_common doesn't support dsym generation yet. It postpones the declaration of pdb_file after checking with the cpp features first.

@yuzhy8701 yuzhy8701 marked this pull request as draft February 12, 2025 18:45
Debug info packages (`dSYM`, `pdb`) are created by `rustc` only if you link with `rustc`. When linking with `cc_common`, they should be handled by the cc toolchain or an custom aspect. Declaring them prematurely can cause conflicts.
@yuzhy8701 yuzhy8701 changed the title Do not declare debug info packages when using cc_common.link Handle debug info packages separately when using cc_common.link Feb 12, 2025
….link

This replicates the behavior of the `cc_binary` rule.
@yuzhy8701 yuzhy8701 marked this pull request as ready for review February 12, 2025 22:25
Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

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

Thanks!

@UebelAndre UebelAndre added this pull request to the merge queue Feb 27, 2025
Merged via the queue into bazelbuild:main with commit 1f6d91f Feb 27, 2025
3 checks passed
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.

2 participants