cargo-c icon indicating copy to clipboard operation
cargo-c copied to clipboard

Choose the correct default target on MSYS2/MinGW64

Open mgeier opened this issue 3 years ago • 4 comments

I was hoping to get the right target automatically, since I'm using cargo from MSYS2, which should know that it uses the GNU toolchain.

Strangely, when I'm using the MSYS2 package for cargo-c (instead of compiling it on-the-fly), the --target flag is not necessary (see https://github.com/mgeier/cargo-c/runs/4754623622)!

So why does the MSYS2 package of cargo-c do the right thing?

Originally posted by @mgeier in https://github.com/lu-zero/cargo-c/pull/194#discussion_r780821730

mgeier avatar Jan 10 '22 19:01 mgeier

it is not something cargo-c controls but defers to cargo (the crate).

lu-zero avatar Jan 10 '22 21:01 lu-zero

Can you point me to the place where this information is obtained from cargo? Then I'll create a corresponding issue over there.

But the question remains: Why does the MSYS2 package of cargo-c already do the right thing?

mgeier avatar Jan 12 '22 21:01 mgeier

we look up what is in https://docs.rs/cargo/latest/cargo/util/config/struct.Config.html#method.load_global_rustc, I do not know how they are building cargo and how it is different from building the cargo crate as we build it.

lu-zero avatar Jan 12 '22 22:01 lu-zero

FYI, you can follow all the MSYS2 patches and the build recipe here: https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-rust

kmilos avatar Dec 28 '22 09:12 kmilos