Add "Release" build preference profile for Rust
@luke_nukem
Submitted by Luke Jones Link to original bug (#791048)
Description
Created attachment 364704 Example Environment flags
To help prevent new users being confused as to why their Rust application is running slowly, or wondering where to specify a "--release" cargo flag, a second Build Profile should be added.
It can either have a default "cargo --release" command, or it can have two Environment variables defined:
RUSTFLAGS = -O (this is optlevel 2) PROFILE = release
RUSTFLAGS appends to cargo defaults, or overrides a flag if duplicated. PROFILE is only used in a build.rs script, and only if said script has code to read it. It doesn't affect RUSTFLAGS unless it also has code to explicitly override the set RUSTFLAGS.
Either "cargo --release" or the two environment flags will work fine. It may also require changing the directory that compiled objects are written to (currently always debug).
It may also be good to add the RUST_BACKTRACE=1 env var to Rust Default (debug) profile also to enable better and easier debugging.