-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create flags for the rustwasm working group's three "build modes" #153
Comments
I can follow up along these lines. |
awesome @clanehin - i want to loop @fitzgen in here as well, he has some good perspective about some of the configuration that may also need to happen here, primarily with |
Pulled the wasm-snip bits out into https://github.com/ashleygwilliams/wasm-pack/issues/158 to let this issue remain about different build/optimization profiles. |
I've had time this week to look into this issue again. I can submit a pull request that just changes "--debug" into something like "--profile=dev" / "--profile=release" so that the set of profiles will be extensible. <-- do you want me to go ahead and submit this? (1) Cargo already implements three build profiles ("dev", "release", and "bench") which roughly correspond to the three profiles we want to implement. However we cannot freely select any other than "dev" and "release", nor do we have any control over the default behavior of those profiles (network-delivered wasm should be size-rather-than-time-optimized, for example). I would prefer not to have a parallel implementation of very similar features in wasm-pack (any more than necessary). We may want to make our use case more visible to the cargo team and see how they feel about it. (See: rust-lang/cargo#2007) (2) Assuming that it's not practical to wait on Cargo . . . the example in https://github.com/rustwasm/rust_wasm_template/issues/6 uses "cargo rustc" to pass very specific compiler options. I don't have a clear understanding about the difference between "cargo build" and "cargo rustc", but based on my limited experimentation it's not clear to me that naively replacing one with the other will work. I'm having trouble finding good documentation about the difference between cargo build and cargo rustc and would benefit from guidance. I think in the short term, users can hackishly accomplish everything in https://github.com/rustwasm/rust_wasm_template/issues/6 using the RUSTFLAGS environment variable. |
Once the support for modes lands in |
the rust wasm working group is consider 3 modes of building a wasm project as seen here: https://github.com/rustwasm/rust_wasm_template/issues/6
this seems highly related to #127
are we interested in making a flag for each of these? i think it seems like a reasonable idea. would love to hear all ya'lls thoughts!
The text was updated successfully, but these errors were encountered: