-
Notifications
You must be signed in to change notification settings - Fork 21
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
Allow dylint-link to use the MSVC Linker #45
Conversation
This is awesome, @MinerSebas. Thank you. However, this also looks like a significant change to Quick question: the MSVC Linker free? (I couldn't tell from Googling.) |
No Problem.
Yes its free. You can get it either by installing the Microsoft C++ Build Tools or using Visual Studio which includes those Build Tools. I think I might have a Lead for the Linking Issues with the gnu toolchain. |
Cool. Glad to hear it. Please ping me once things have stabilized. |
@smoelius The lead went nowhere, but I suspect it is a rustc Bug. Explanation: When doing the final Linking of the Library, only the Manually creating a |
Thanks, for the detailed explanation @MinerSebas. I think it is fine to use just the MSVC Linker. I suspect that's what most people would use anyway. I'll try to start reviewing this this weekend. Have a good weekend. :) |
Is |
Depends on how much support for the GNU chain is desired. If the stance is: "Some Examples don't work -> Do not support GNU Toolchain", then it can be removed. P.S. I am open to a better name for this function and its msvc sibling. |
First, given those two choices, I think I would prefer to not support the GNU linker at all (at least not for now). But more generally, I am wondering if we could reduce the number of Am I correct that the main difference between how the Windows and non-Windows code operates is in how the output path is found? If so, then I am wondering if we could have a function like (roughly) fn output_path<I>(iter: &mut I) -> Option<PathBuf>
where
I: Iterator<Item = OsStr>,
{
....
} that gets called from within Have I over simplified? If you'd like me to take a crack at this (say, because my "vision" is unclear), I could. |
Done
Aside from the Linker Finding, that's the major difference. With the GNU Linker you provide with two arguments: Plus the existence of the Linker Response Files on Windows.
Done |
@MinerSebas Just wanted to let you know that I haven't forgotten about this and I am actively working on it. |
@MinerSebas Your method for converting to UTF-16, is it from here? https://stackoverflow.com/a/57172592 |
Also, do you recall what made the |
Yes, that was my concrete source. All others either used
After testing I can confirm that the The Source was the Console Output during debugging: |
I like to cite sources, but you had no way of knowing that. I am making a few changes, so no need to push anymore. I almost have the tests passing. I think we're close to being able to say we support Windows, thanks to you!!! 🙏🙏🙏 |
OK, the tests pass locally on my VM. @MinerSebas When you have a moment, please take a look at eabd298. Mostly, I changed things in ways that I think makes them more idiomatic. In a few places, I changed how/whether errors could occur. Please let me know if there is anything you don't like or object to. Of course, you're welcome to review the other commits to (but only if you want to). |
Everything works as expected. I just have a minor Nitpick. You added several Links which immediately succeeded by a Period. In comparison, VSCode correctly identifies that the period isn't part. I'd say either put a space between the URL and period or remove it completely. |
Oof. Not a nitpick. Did you know of any that I missed? |
You only missed one in the .gitattributes File. |
Cool. I'm going to push a new release soon. This is a significant milestone. I really, really appreciate all of your hard work on this, @MinerSebas. :) |
Just FYI, this is published now: https://crates.io/crates/dylint/1.0.2 |
This adds support for the MSVC Linker in
dylint-link
.This uses the
cc
crate to get the correct Location of the Linker.I also tried using the gnu toolchain on Windows, but there I always get man Link errors when building the examples, even without using
dylint-link
as the Linker:dylint-link
andcargo-dylint
did build successfully with it, so I don't know why it doesn't work.Though it could be a personal error, as I never used the gnu toolchain before.