Skip to content
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

Closed
ashleygwilliams opened this issue Jun 6, 2018 · 5 comments
Closed

Comments

@ashleygwilliams
Copy link
Member

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!

@ashleygwilliams ashleygwilliams added help wanted Extra attention is needed question Further information is requested labels Jun 6, 2018
@itsybitesyspider
Copy link
Contributor

I can follow up along these lines.

@ashleygwilliams
Copy link
Member Author

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 wasm-snip :)

@fitzgen
Copy link
Member

fitzgen commented Jun 7, 2018

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.

@itsybitesyspider
Copy link
Contributor

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.

@xtuc
Copy link
Member

xtuc commented Nov 8, 2018

Once the support for modes lands in wasm-pack we should add the support in the Webpack plugin (currently it will work by passing manually args in extraArgs).

fitzgen added a commit to fitzgen/wasm-pack that referenced this issue Nov 8, 2018
fitzgen added a commit to fitzgen/wasm-pack that referenced this issue Nov 8, 2018
fitzgen added a commit to fitzgen/wasm-pack that referenced this issue Nov 8, 2018
fitzgen added a commit to fitzgen/wasm-pack that referenced this issue Nov 9, 2018
fitzgen added a commit to fitzgen/wasm-pack that referenced this issue Nov 9, 2018
fitzgen added a commit to fitzgen/wasm-pack that referenced this issue Nov 9, 2018
fitzgen added a commit to fitzgen/wasm-pack that referenced this issue Nov 9, 2018
@ashleygwilliams ashleygwilliams added this to the 0.6.0 milestone Jan 12, 2019
@ashleygwilliams ashleygwilliams added changelog - feature and removed help wanted Extra attention is needed question Further information is requested labels Jan 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants