Skip to content

Commit f9cb938

Browse files
committed
fix(future): Cover release profile support
1 parent d0abe6b commit f9cb938

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

text/3502-cargo-script.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,23 @@ Options
10771077
- Key off of workspace membership (as then it won't likely be a temp file)
10781078
- This has a chicken-and-egg problem as we need to load config before we load manifests
10791079

1080+
## Access to `--release` in shebang
1081+
1082+
While the primary target of this feature is one-off use that is not performance sensitive,
1083+
users may want to have long-lived scripts that do intensive operations.
1084+
1085+
This is generally viewed as a script-author decision, rather than a user decision, as they are most likely to know the performance characteristics of their script.
1086+
1087+
In the short term, users can configure `[profile.dev]` to match `[profile.release]`, see [Cargo's Profiles chapter](https://doc.rust-lang.org/cargo/reference/profiles.html#default-profiles).
1088+
1089+
Potential options for addressing this include
1090+
- Add `cargo --release <script>` or `cargo --profile=name> <script>`
1091+
- This would only work on systems that support `env -S` which might be fine as this is a more specialized case already
1092+
- This doesn't scale too well for other customization
1093+
- Add a "default profile" of some kind to the manifest format
1094+
- See also [zulip: cargo build default profile](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/cargo.20build.20default.20profile)
1095+
- Allow built-in profiles to inherit from other built-in profiles (so `dev` could inherit from `release`)
1096+
10801097
## Scaling up
10811098

10821099
We provide a workflow for turning a single-file package into a multi-file

0 commit comments

Comments
 (0)