Add option to build with unmodified original manifest#51
Conversation
|
Suggestion from @Robbepop: uglify this option to discourage use
Also maybe print a warning:
|
# Conflicts: # src/cmd/build.rs
|
@Robbepop I've made this an unstable option |
| #[derive(Debug, StructOpt)] | ||
| struct UnstableOptions { | ||
| /// Use the original manifest (Cargo.toml), do not modify for build optimizations | ||
| #[structopt(long = "unstable-options", short = "Z", number_of_values = 1)] | ||
| options: Vec<String>, | ||
| } |
There was a problem hiding this comment.
How would this look like if we specify multiple unstable options? Each having their own -Z or one -Z for all? I guess we should mimic rustc here that requires one -Z per unstable feature usage.
There was a problem hiding this comment.
Indeed that should work i.e. 1 -Z per option, I took this pattern from https://github.com/TeXitoi/structopt/blob/master/examples/keyvalue.rs#L22
By default a contract's
Cargo.tomlwill be amended to optimize the final Wasm binary. At the moment that means just removing therlibcrate type if present, though in the future we may make further modifications.This PR provides the option
-Z original-manifest(feedback on the name appreciated) to disable all modifications to theCargo.toml: it will just build using the original file. Note that this is introduced as anunstable-option(short-Z)This will result in a larger final contract binary size if
rlibis enabled, but gives full control to the user for options from theCargo.toml. This is useful for troubleshooting e.g use-ink/ink#364.Options
In general we should try to minimize the number of options/flags we support in order to keep it as simple as possible, so this and other options should be considered through that lens.
Update: with this in mind I have added this as an
unstable-option(short-Z),