Skip to content

refa(cargo-shuttle): find binary target based on macro in source#2059

Merged
jonaro00 merged 6 commits intomainfrom
find-shuttle-binary
Jun 18, 2025
Merged

refa(cargo-shuttle): find binary target based on macro in source#2059
jonaro00 merged 6 commits intomainfrom
find-shuttle-binary

Conversation

@jonaro00
Copy link
Member

@jonaro00 jonaro00 commented Jun 12, 2025

Description of change

Now finds the package and binary target for local runs and deployments by looking in the target's source file for a #[shuttle_runtime::main string. (no ] so that #[shuttle_runtime::main(...)] can be found)
Also passes --bin to cargo build and binary_name to deployment args.

✔️ Gets rid of the requirement that the target (binary) name of the Shuttle service has to match the crate name :)
✔️ Sets us up to add -p/--package and --bin args to build/run/deploy commands.

⚠️ Breaking change for users who do

use shuttle_runtime::main;

#[main]
...

How has this been tested? (if applicable)

Intergration tests were added and adjusted for the changes, and local run and deploy was manually tested (works the same way).

@jonaro00 jonaro00 merged commit 03e25b6 into main Jun 18, 2025
22 checks passed
@jonaro00 jonaro00 deleted the find-shuttle-binary branch June 18, 2025 18:12
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