-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Bundled GCC on windows doesn't pick up system link paths #17442
Comments
This has also broken the cargo nightlies and builds
|
I'm not sure this is a bug if cargo is relying on random mingw libraries - eventually we will switch away from mingw completely and those libs will not be available. |
How did cargo machine end up with a bundled gcc? Does it use windows installer?! |
The cargo builders do not have a pre-installed rustc and they are run in a mingw-w64 shell (and mingw32 for now). The first step of a cargo build on the bots is to download the latest rust nightly installer and unpack it. |
Hmm, I'd have expected them to use a snapshot compiler... |
@brson What are you planning to use instead of MinGW? |
If we want to link Rust programs against Windows libraries we'll have to either bundle those libraries, depend on the system MinGW's copy of them, or depend on the MSVC toolchain (not likely to happen). So unless Cargo dependencies are going to start bundling the system libraries, I don't see how we can really avoid a dependency on a system MinGW for any non-trivial project. |
Well, we could:
|
Nominating. From what I understand Cargo's mingw dependencies are preventing us from accomplishing #11782. |
@jhasse We rely on mingw principally for the GNU linker, and would prefer to instead use the msvc linker. |
I'm not clear on whether the problem is cargo linking to windows libs or gnu libs. Shouldn't we be trying to link to windows libs since those don't depend on mingw? |
@vadimcn Not fully understanding the problem here, my strong preference is for your option 1: we should not be encouraging mingw dependencies; much of the work we are doing here is explicitly to get away from the mingw dependency. |
From what @alexcrichton says, cargo should work without mingw, which is what we need: the problem it has is that it can't build without mingw, which is just a problem for our bots. We should test this. |
@brson: Not sure what you mean by "windows" libs. |
@brson: I doubt that. Windows does not ship with linker. It's only available if you install MSVC toolchain. I doubt we'd be allowed to extract and redistribute it the way we do it with gcc. |
I'm also strongly against MSVC if that would imply a dependency on the VC++ runtime (llvm is using C++, right?). |
Using MinGW we already have a dependency on the VC++ runtime, just an ancient version that all Windows computers already have installed. If we switched to the msvc toolchain we'd likely use a newer VC++ runtime, so if we linked to it dynamically and didn't include the dlls then some people might have to install the VC++ redistributable. |
@alexcrichton says this is actually fixed or at least working "fine". Closing. |
fix: Fix pat fragment parsers choking on <eoi> Fixes rust-lang/rust-analyzer#17441
A system mingw-w64 gcc installation has many many libs in
/mingw64/$triple/lib
whichgcc
will make available for linking by default. The bundled GCC that rust provides, however, does not link against these libraries by default (they are not in any-L
flag). This means thatgcc
invocations which would otherwise work on the system begin to fail because the bundled GCC is preferred.For a concrete example, see rust-lang/cargo#620.
cc @vadimcn
The text was updated successfully, but these errors were encountered: