fix: remove "rust-lld" as custom linker on windows#5242
Open
alex-ds13 wants to merge 1 commit intoDioxusLabs:mainfrom
Open
fix: remove "rust-lld" as custom linker on windows#5242alex-ds13 wants to merge 1 commit intoDioxusLabs:mainfrom
alex-ds13 wants to merge 1 commit intoDioxusLabs:mainfrom
Conversation
- Since we already use the lld version packed by rust on windows by default, we can simply set custom_linker to `None` when the user is using "rust-lld" as linker.
fa44c30 to
e5e1817
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While porting some of the windows fixes into
cargo-hot(this PR), I discovered and fixed another issue on windows that also exists on dioxus cli.The issue is that the
lldpacked by rust by default asrust-lld.exeon windows needs a-flavorflag to tell it which flavor to use. When executingcargonormally it seems to be passing aZ linker-flavor=linkto rustc which ends up calling "rust-lld.exe" with the proper flavor, that is it callsrust-lld.exe -flavor link.We could do the same here and add the
-flavor linkto the "rust-lld.exe" command on Windows when we detect that the user is using the "rust-lld" linker. However I believe that is just some unnecessary complexity, since we already use the lld version packed by rust on windows by default, we can simply setcustom_linkertoNonewhen the user is using "rust-lld" as linker. And then it will behave properly.Also, I've used
cfg!(windows)instead of checking forBundleFormat::Windows, since from what I understood theBundleFormatis related to the target you are building and not the system you are currently using, but if you think there is a better way to do this, let me know!Also let me know if you think this should be fixed in another manner, like passing the flavor flag to the custom linker.
Fixes #4694