Skip to content

Fix windows builds #252

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

Merged
merged 3 commits into from
May 21, 2025
Merged

Conversation

alphastrata
Copy link
Contributor

@alphastrata alphastrata commented May 21, 2025

Windows by default will use the msvc linker, which maxes out on 2^16-1 symbols, which the ash and wgpu examples in debug mode easily exceed.

Solution: rust-lld.exe, which should be available already as it's in the llvm-tools that the rust-toolchain.toml will be ensuring is installed anyway.

Copy link
Member

@Firestar99 Firestar99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm that the ash and wgpu examples fail to build on windows, when build in debug mode (eg, --release works on master), and this PR fixes that.

CI only checks the examples and builds the example shaders, never actually fully builds the examples. @LegNeato should we cahnge our CI to not run into this again?

(I didn't actually know you could use rust's lld linker for windows as well)

@Firestar99 Firestar99 added this pull request to the merge queue May 21, 2025
@alphastrata
Copy link
Contributor Author

alphastrata commented May 21, 2025

Can confirm that the ash and wgpu examples fail to build on windows, when build in debug mode (eg, --release works on master), and this PR fixes that.

I will confirm this shortly.

(I didn't actually know you could use rust's lld linker for windows as well)

I can't take the credit, I found it some years back in the Bevy community.

Merged via the queue into Rust-GPU:main with commit fcb4fdf May 21, 2025
7 checks passed
@LegNeato
Copy link
Collaborator

LegNeato commented May 21, 2025

@Firestar99 I think we had a other issue around here to make CI do debug as well. Only doing ---release has caused issues in the past: #40

@alphastrata
Copy link
Contributor Author

Can confirm that the ash and wgpu examples fail to build on windows, when build in debug mode (eg, --release works on master), and this PR fixes that.

CI only checks the examples and builds the example shaders, never actually fully builds the examples. @LegNeato should we cahnge our CI to not run into this again?

(I didn't actually know you could use rust's lld linker for windows as well)

both ash and wgpu builds (debug) fail without the rust-lld fix, they both wail with LINK : fatal error LNK1189: library limit of 65535 objects exceeded␍ errors. So I think this is a good fix. @Firestar99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants