-
Notifications
You must be signed in to change notification settings - Fork 348
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 section for cranelift #1523
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very good right now, but one nit I have is to only compile your binary with Cranelift. In the October 2023 progress report, it mentions how you can enable Cranelift for specific packages.
In this case, I think it would be best to recommend to only compile your binary with Cranelift, so that Bevy and the rest still receive better optimizations. This is the same reason why we recommend opt-level = 3
for dependencies.
Co-authored-by: BD103 <59022059+BD103@users.noreply.github.com>
@BD103 that makes sense, thanks for the suggestion! |
Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Blocked by rust-lang/rustc_codegen_cranelift#1504 |
While we are on the subject, @bjorn3, is there a way to compile my dependencies with LLVM and use cranelift only for my binary on Windows? The way I've set it up locally, I need to run Also, I heard Bevy stuff on Wasm didn't build or didn't run with cranelift. I don't have the time to verify this. Is this still the case? If so, I can point it out in the readme as well. |
Not really. The codegen-backends option in .cargo/config.toml only works for codegen backend shipped with rustc. Rustc itself supports passing the path to a codegen backend dylib (which cargo-clif internally uses), but for cargo I was asked to restrict this unfortunately.
This is still the case. |
rust-lang/rust#127177 would also be really nice to land first. This will ship cg_clif for arm64 macOS. |
@bjorn3 I've added both links to the PR description for visibility :) |
@bjorn3 since we discovered a runtime crash on macOS in the meantime, would it be fine if we changed the section to recommend cranelift specifically for Linux for now? I'd like to have this section merged in time for the Bevy jam. |
Yeah, that is fine. Maybe also explicitly mention why it shouldn't be used on Windows and macOS to avoid people trying to do it anyway. |
Adopts #801 by @MalekiRe and changes some text based on feedback by @bjorn3
Blocked by:Edit: leaving it as a primary Linux recommendation for now.