shuttle icon indicating copy to clipboard operation
shuttle copied to clipboard

feat: add support for --profile and --features flags

Open Dreaming-Codes opened this issue 5 months ago • 4 comments

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 avatar Jul 20 '25 13:07 Dreaming-Codes

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 avatar Jul 20 '25 14:07 Dreaming-Codes

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

Dreaming-Codes avatar Jul 20 '25 14:07 Dreaming-Codes

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 avatar Jul 21 '25 11:07 jonaro00

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.

jonaro00 avatar Sep 09 '25 22:09 jonaro00