feat: add support for --profile and --features flags
Introduces:
-
shuttle run --profile [profile]which builds the runtime with a custom cargo profile, just likecargo build --profile [profile]does.- Supports any profile defined in
Cargo.toml(e.g.,--profile production,--profile bench) - Conflicts with
--releaseflag to avoid confusion - Falls back to default debug/release behavior when not specified
- Supports any profile defined in
-
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
- Accepts space or comma-separated list of features (e.g.,
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
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?
For context I need this feature to test my project with dhat without having to edit each time my project's Cargo.toml file
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.
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.