{"comment":{"url":"https://api.github.com/repos/rust-lang/rust/comments/11466260","html_url":"https://github.com/rust-lang/rust/commit/7cf0b1798bddad33876258d6715b363896252e40#commitcomment-11466260","id":11466260,"user":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"position":22,"line":1105,"path":"configure","commit_id":"7cf0b1798bddad33876258d6715b363896252e40","created_at":"2015-06-02T00:50:07Z","updated_at":"2015-06-02T00:50:07Z","body":"Ah yep, that'd do it! Unfortunately if MSYS does not translate a Unix path to a Windows path for the python-in-use, it will end up leaking into LLVM's build system as a Unix path, and that path is then emitted in turn to a file which is later read by CMake. CMake then tries to read a file at a Unix path, which definitely doesn't exist, so it chokes.\r\n\r\nThe specific path taken is:\r\n\r\n* [We call `cmake`](https://github.com/rust-lang/rust/blob/a49ae5bd4378cb47fd5cfdcd0c31e04d55373696/configure#L1387-L1389) from MSYS (right?)\r\n* [LLVM calls `llvm-build`](https://github.com/rust-lang/llvm/blob/43fceb0bc06945abcdb11d6db299cc21757b7bdd/CMakeLists.txt#L406-L417) (through cmake)\r\n  * [The path to `llvm-build`](https://github.com/rust-lang/llvm/blob/43fceb0bc06945abcdb11d6db299cc21757b7bdd/CMakeLists.txt#L391) contains `LLVM_MAIN_SRC_DIR`\r\n  * [`LLVM_MAIN_SRC_DIR` is set to `CMAKE_CURRENT_SOURCE_DIR`](https://github.com/rust-lang/llvm/blob/43fceb0bc06945abcdb11d6db299cc21757b7bdd/CMakeLists.txt#L162)\r\n* `llvm-build` attempts to [infer the LLVM source root from `__file__`](https://github.com/rust-lang/llvm/blob/43fceb0bc06945abcdb11d6db299cc21757b7bdd/utils/llvm-build/llvmbuild/main.py#L888-L894). \r\n* This `source_root` is then joined on and used to emit lots more `CMakeLists.txt` files, all of which now contain Unix paths and will fail when run.\r\n\r\nI'm not 100% sure, but it seems that the current directory of CMake is Unix-style due to being run from MSYS (maybe?) and this then leaks into python via `__file__`, and eventually leaks into CMake as well.\r\n\r\nIf there's a way to force windows style paths all the way, then that'd be great! Unfortunately last time I tried that I couldn't figure out a way to do so :\\"}}