Skip to content

feat(ifc, cargo-shuttle): extract infra macro annotation parser to separate crate#2072

Merged
jonaro00 merged 14 commits intomainfrom
macro-parser
Jul 2, 2025
Merged

feat(ifc, cargo-shuttle): extract infra macro annotation parser to separate crate#2072
jonaro00 merged 14 commits intomainfrom
macro-parser

Conversation

@jonaro00
Copy link
Member

@jonaro00 jonaro00 commented Jun 27, 2025

Extract the syn parser for infra attributes to separate crate that is re-used by CLI.

  • CLI's package+target finder upgraded to look for a valid syntax tree with #[shuttle_runtime::main] instead of a #[shuttle_runtime::main string
  • CLI deploy command parses infra macro and attaches it to the deployment request
  • Tests added for
    • Parsing macro attributes
    • Finding main function in source code
    • Parsing main function + attributes
    • Compiler error from main macro when attributes are invalid
  • added CI for ifc crate (release, test)

@jonaro00 jonaro00 marked this pull request as draft June 27, 2025 11:42
@fussybeaver
Copy link
Collaborator

This is significantly different to what was agreed upon in the PRD... was new design and approach to the annotation declaration agreed somewhere?

@jonaro00 jonaro00 changed the title feat(infra, cargo-shuttle): separate infra macro annotaiton parser feat(infra, cargo-shuttle): extract infra macro annotaiton parser to separate crate Jul 1, 2025
@jonaro00 jonaro00 marked this pull request as ready for review July 1, 2025 11:21
Copy link
Collaborator

@fussybeaver fussybeaver left a comment

Choose a reason for hiding this comment

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

Apparently you can also use #[shuttle_runtime::main { instance_size = "xxl" } ] or wrap the inner in [] braces, but I guess it's fine like that

Copy link
Collaborator

@oddgrd oddgrd left a comment

Choose a reason for hiding this comment

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

Cool!

@jonaro00 jonaro00 changed the title feat(infra, cargo-shuttle): extract infra macro annotaiton parser to separate crate feat(infra, cargo-shuttle): extract infra macro annotation parser to separate crate Jul 2, 2025
@jonaro00 jonaro00 changed the title feat(infra, cargo-shuttle): extract infra macro annotation parser to separate crate feat(ifc, cargo-shuttle): extract infra macro annotation parser to separate crate Jul 2, 2025
@jonaro00 jonaro00 merged commit 03fa327 into main Jul 2, 2025
23 checks passed
@jonaro00 jonaro00 deleted the macro-parser branch July 2, 2025 15:34
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.

3 participants