cc-rs icon indicating copy to clipboard operation
cc-rs copied to clipboard

Environment variables on windows required double backslash

Open chriscoomber opened this issue 4 years ago • 2 comments

When cross-compiling from windows to Android, I found I needed to add environment variables for the CC and AR (in addition to the config in .cargo/config) in order to get this crate to work. E.g. set CC_armv7-linux-androideabi=C:\\path\\to\\ndk\\21.4.7075529\\toolchains\\llvm\\prebuilt\\windows-x86_64\\bin\\armv7a-linux-androideabi21-clang.cmd. This is all fine (though took embarrassingly long to figure out).

The problem is this requires double-backslashes, whereas normally environment variables on windows which are paths use single-backslashes (e.g. JAVA_HOME, LIBCLANG_PATH etc. all look like C:\path\to\folder). Obviously this is low priority, but if there's an easy fix there it could be worth it for consistency...

chriscoomber avatar Aug 24 '21 20:08 chriscoomber

Weird, I just ran a build of the cc-test test crate in this repo with AR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\lib.exe and it worked

Could you check again, against the master branch of cc-rs? Maybe it's been fixed already

nico-abram avatar Dec 22 '21 03:12 nico-abram

I don't think that this is a bug in cc but rather something else along-the-line. Most likely there's some shell script somewhere using CC or something like that which is behaving badly.

alexcrichton avatar Dec 22 '21 15:12 alexcrichton

This is a year old and it isn't clear how to reproduce, so I'll close this for now. If anyone has a reproducible example then feel free to create a new issue or comment here.

ChrisDenton avatar Jan 26 '23 08:01 ChrisDenton