Skip to content

Conversation

Dreaming-Codes
Copy link
Contributor

Introduces:

  • shuttle run --profile [profile] which builds the runtime with a custom cargo profile, just like cargo build --profile [profile] does.
    • Supports any profile defined in Cargo.toml (e.g., --profile production, --profile bench)
    • Conflicts with --release flag to avoid confusion
    • Falls back to default debug/release behavior when not specified
  • shuttle run --features [features] which enables specific cargo features during build.
    • Accepts space or comma-separated list of features (e.g., --features "feature1 feature2" or --features feature1,feature2)
    • Properly combines with the existing "shuttle" feature when present
    • Works exactly like cargo build --features

This allows users to have more control over the build process, matching the flexibility of standard cargo commands. Particularly useful for:

  • Using custom optimization profiles for different environments
  • Enabling optional features without modifying Cargo.toml
  • Testing different feature combinations locally before deployment

@Dreaming-Codes Dreaming-Codes marked this pull request as draft July 20, 2025 13:55
Add support for custom build profiles and features in cargo-shuttle run command:
- Add --profile flag to specify custom build profiles (e.g., --profile production)
- Add --features flag to specify cargo features (e.g., --features "feature1 feature2")
- Ensure --profile conflicts with --release to avoid confusion
- Properly combine custom features with existing "shuttle" feature when present

This allows users to have more control over the build process, matching
the flexibility of standard cargo commands.
@Dreaming-Codes Dreaming-Codes marked this pull request as ready for review July 20, 2025 14:02
@Dreaming-Codes
Copy link
Contributor Author

clippy is failing cause there are too many arguments to a function that i modified to support this new feature. Should I refactor that into a struct?

@Dreaming-Codes
Copy link
Contributor Author

For context I need this feature to test my project with dhat without having to edit each time my project's Cargo.toml file

@jonaro00
Copy link
Member

Thanks for the idea! I'll think about how this should work regarding the default shuttle feature, and look at how we can support it in the deploy command and Shuttle.toml too. Then it could perhaps be part of the next release.

@jonaro00
Copy link
Member

jonaro00 commented Sep 9, 2025

Sorry for the delay on this. After resolving conflicts, it would be good to populate these fields in RustBuildArgs (from gather_rust_build_args), so that they can be re-used in native, docker, and remote (platform) builds.

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