4 ms·
I would however make the argument that if you do have a native extension but you have no binary wheel, it's better for that code to be written in Rust than C. U
by the_mitsuhiko 4y ago
I would however make the argument that if you do have a native extension but you have no binary wheel, it's better for that code to be written in Rust than C. Usually for a rust binary extension to build you just need a recent rust compiler on your machine whereas making C/C++ things to work can be a nightmare from you needing to have the right version of cmake, Cons, header files, dependency libraries and more to be installed. I have a text file with common CFLAGS and LDFLAGS I need to set to install various database drivers and more.
- ciupicri 4y agoI tried once building a very simple Rust extension on Windows using the Anaconda Python distribution and had no luck. If I remember correctly it got stuck trying to find the VC++ compiler. Cython extensions on the other hand work fine with the MinGW GCC compiler provided by Anaconda, although it's pretty old (version 5).
- mynameisnull 4y agoIn my experience that is just the silly amount of variables you have to export to use the VC++ compiler and this is why they provide a dedicated terminal prompt for the VC++ compiler with all the right env vars loaded. I've struggled as well automating VC++ compilation in rust as a result. If you're so inclined to revisit this using mingw with rust you can see how here https://rust-lang.github.io/rustup/installation/windows.html https://rust-lang.github.io/rustup/installation/windows.html This is far easier to automate imo
- ciupicri 4y agoI forgot to mention that I didn't have VC++ installed at all (because it's not free from all points of view). If I remember correctly I tried installing the MinGW based Rust toolchain too, but I'll try again with the instructions you've given me.
- dwattttt 4y agoFinding where & how to use an installed VS instance (or selecting one) in automated tooling is solved by the criminally unknown, MIT licensed, MS supported, redistributable, vswhere tool: https://github.com/microsoft/vswhere https://github.com/microsoft/vswhere
- nerdponx 4y agoThere used to be a "vcvarsall.bat" script that set everything up properly without opening a separate shell session. However I recall that it moved locations on every VC++ update. Does that even exist anymore?