-
Notifications
You must be signed in to change notification settings - Fork 239
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
Configuration to compile Rust with any profile #605
Comments
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Not stale. |
Maybe solution is to not use wasm-pack and instead opt for using cargo, so that the Hence, the onus would be on developers to create profiles or release settings, e.g. [profile.release]
panic = "abort"
lto = true
codegen-units = 1
strip = true
[profile.web-release]
inherits = "release"
opt-level = 's'
strip = "debuginfo" And then, under the hood, trunk would be invoked via: And internally, trunk would build using: cargo build -p <package> --target wasm32-unknown-unknown --profile web-release
wasm-bindgen --target web --out-dir bindings ${STAGING_DIR}/out.wasm --no-typescript
... |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
This issue was closed because it has been stalled for 5 days with no activity. |
This issue shouldn't have been closed, as this problem still affects multiple other projects that are using trunk. |
Cleaning up issues, I ran into this one. Currently trunk itself knows two modes (release and non-release). Trunk's Ideally, all of those options end up in some profile, and we have two default profiles. One of those fields being the cargo profile. That's a bigger task though. Another alternative would be to add some |
I'd prefer the thoughtful approach, where |
I think it makes sense tracking this in a separate issue. It looks to me as if that will have a bigger impact on the whole arguments/env-vars/config area. |
Is there any workaround available to tell trunk to use things like |
Trunk will "only" spawn |
@ctron is there a chance to get the profile feature in without waiting for a full config overhaul? |
As with wasm-pack, there are only two possible profiles for trunk's Rust compilation: debug and release. While trunk offers direct control over the optimization level, I need to adjust other parameters (debug options, LTO, ...) which are usually set via profiles and detectable in the code itself. Additionally, I do not want to use the release profile. The Wasm web app is just one part of a larger workspace (where all crates share build profiles), and the main executable build in the workspace requires vastly different options in its release build. My current workaround, which I have already been using for wasm-pack, is to reserve the release profile for Wasm and use a custom profile for the main release build. I would prefer the ability to do this the other way around, where the much less important web app gets some custom release profile while the main application gets the default release profile.
(Reopened from #545 since this is still not solved)
The text was updated successfully, but these errors were encountered: