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

Add some kind of (likely toml) configuration #160

Closed
fitzgen opened this issue Jun 7, 2018 · 4 comments
Closed

Add some kind of (likely toml) configuration #160

fitzgen opened this issue Jun 7, 2018 · 4 comments

Comments

@fitzgen
Copy link
Member

fitzgen commented Jun 7, 2018

As we add more options and flags (#159 #158 #153 etc) it would be great if we didn't have to keep passing the same command line arguments for every build all the time, and instead could canonicalize configurations in a toml file.

@ashleygwilliams ashleygwilliams added question Further information is requested to-do stuff that needs to happen, so plz do it k thx labels Jun 7, 2018
@ashleygwilliams
Copy link
Member

@fitzgen it would be really useful in discussing this if we had a strawman proposal. do you think you could write up an example of what you think it might look like and we can discuss from there? thanks! (of course, anyone else reading this should also feel free to post an example of how they think configuration should work!)

@ashleygwilliams ashleygwilliams changed the title Add some kind of toml configuration Add some kind of (likely toml) configuration Jun 11, 2018
@ashleygwilliams
Copy link
Member

(also, i updated the title because, while i think we'll likely want to use TOML, i don't want to close the convo off to potentially other formats, assuming there's a good rationale, of course)

@fitzgen
Copy link
Member Author

fitzgen commented Jun 11, 2018

This is what I imagine the defaults from #153 would look like, as described in a strawman toml format

[build.debug]
debug = true
features = ["console_error_panic_hook"]
rustc-opt-level = 0
wasm-opt = false
wasm-snip = false
wasm-bindgen = true

[build.profiling]
debug = true
features = ["console_error_panic_hook", "wee_alloc"]
rustc-opt-level = "s"
wasm-opt = { opt-level = "z" }
wasm-snip = false
wasm-bindgen = true

[build.production]
debug = false
features = ["wee_alloc"]
rustc-opt-level = "s"
wasm-opt = { opt-level = "z" }
wasm-snip = { snip-rust-fmt-code = true, snip-rust-panicking-code = true }
wasm-bindgen = true

@steveklabnik
Copy link
Contributor

After trying tools that use an external .toml file vs putting configuration in Cargo.toml, I would argue that putting it in Cargo.toml is much nicer. All of your configuration is in one file, rather than an increasing number of .toml files. See https://github.com/rust-osdev/bootimage#configuration for example; you could put this in

[package.metadata.wasm-pack.build.debug]

instead of just

[build.debug].

@ashleygwilliams ashleygwilliams modified the milestones: 0.5.0, 0.6.0 Jul 26, 2018
@ashleygwilliams ashleygwilliams added the PR attached there's a PR open for this issue label Jul 30, 2018
fitzgen added a commit to fitzgen/wasm-pack that referenced this issue Nov 6, 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 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 changelog - feature and removed PR attached there's a PR open for this issue question Further information is requested to-do stuff that needs to happen, so plz do it k thx labels Jan 11, 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

3 participants