Skip to content

Conversation

@SuperFluffy
Copy link
Contributor

@SuperFluffy SuperFluffy commented Oct 13, 2025

This fixes the need to explicitly to load the dependencies of the proc macros into the namespace at the expansion site.

To do this, we needed to employ 2 tricks:

  1. define a proc-macros crate that holds the proc macros, but expands third party dependencies as ::commonware_macros::<item>. This is because crates configured with proc-macro = true are only allowed to reexport items marked #[proc_macro].
  2. have the macros re-export the third party dependencies and the proc macros.

Finally, to ensure that the proc macros tests work without having the 3rd party items in the namespace, we need to introduce a crate macros-test and move all integration tests there. Since commonware-macros has all third party dependencies in its namespace (since it reexports them), it cannot ensure that the expanded code works without it.

@SuperFluffy SuperFluffy marked this pull request as draft October 13, 2025 17:17
@SuperFluffy SuperFluffy marked this pull request as ready for review October 14, 2025 14: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.

1 participant