Skip to content

Support annotation link dependencies - #210

Merged
dzbarsky merged 1 commit into
hermeticbuild:mainfrom
finn-ball:finn/annotation-link-deps
Aug 8, 2026
Merged

Support annotation link dependencies#210
dzbarsky merged 1 commit into
hermeticbuild:mainfrom
finn-ball:finn/annotation-link-deps

Conversation

@finn-ball

@finn-ball finn-ball commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add link_deps and platform-specific link_deps_select annotation attributes.
  • Thread annotation link dependencies into generated crate metadata and rust_library targets.
  • Preserve compatibility with synthetic rustc-source attributes that do not define the optional fields.

@finn-ball
finn-ball marked this pull request as ready for review August 4, 2026 09:15
Comment thread rs/rust_crate.bzl
if is_proc_macro:
(_rust_proc_macro if skip_deps_verification else rust_proc_macro)(**kwargs)
else:
kwargs["link_deps"] = link_deps

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you leave a comment explaining why rust_proc_macro doesn't need link_deps? Also it seems odd that it's silently ignored if it's specified, perhaps we should hard-fail and tell you to remove the annotation?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You can't hard fail. Some packages can include rust_proc_macro, rust_binary and rust_library. Added a comment instead.

@finn-ball
finn-ball force-pushed the finn/annotation-link-deps branch 2 times, most recently from dfe2ba8 to 4bfc564 Compare August 5, 2026 09:56
@finn-ball
finn-ball force-pushed the finn/annotation-link-deps branch from 4bfc564 to 6b269cc Compare August 5, 2026 10:00
@dzbarsky
dzbarsky merged commit 441e5c9 into hermeticbuild:main Aug 8, 2026
10 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