toolchains_llvm icon indicating copy to clipboard operation
toolchains_llvm copied to clipboard

Support llvm distribution for windows

Open RedwanFox opened this issue 5 years ago • 8 comments

subj

RedwanFox avatar Sep 03 '18 09:09 RedwanFox

The main problem with this issue is that I do not have access to a Windows machine to test. And it looks like it will be a fair bit of work to test everything in a non-Unix setting.

I am afraid I will have to rely on the community for this feature implementation.

siddharthab avatar Feb 18 '19 01:02 siddharthab

I started taking a look at this (filed #13 in the process), but there's a problematic issue: LLVM for Windows is released only as a installable package, not a simple archive - or at least I didn't find any on the LLVM website.

Kernald avatar May 12 '19 02:05 Kernald

Yes, I am not sure how to deal with this either. Can we install the package to a given directory path? Even if is a system default path, I don't see particular harm in installing a specific version of LLVM if the install does not overwrite installs of other versions of LLVM.

siddharthab avatar May 14 '19 19:05 siddharthab

I also came across the requirement for clang under windows. Apparently the llvm windows distribution is just a self extracting archive. If the download_and_extract method would support nsis formats, it could be even easier. e.g. 7zip can extract it out of the box, but i pressume adding that is yet another dependency

FaBrand avatar Oct 09 '19 13:10 FaBrand

We don't have to rely on download_and_extract. We can always execute the self-extracting archive in the repository rule.

siddharthab avatar Oct 11 '19 03:10 siddharthab

I have developed a different prototype patch series that works for Windows (I didn't notice the one developed by @zaucy until just now). It gets around needing to run the self-extracting executable, by relying on a re-packaged compressed archive instead of shelling out to a separate 7zip install. For my demonstration purposes, I just attached it as a release artifact to a github release.

https://github.com/mjbots/bazel-toolchain/commits/windows

The patch sequence isn't suited for submission yet, but if the general approach seemed reasonable, I would be happy to repackage it.

I also have a semi-independent ability to build libc++ from source and use that with binaries instead of the msvc standard library. That let me run coroutines on Windows with clang 10.0. It is less optimal, since I haven't figured out bazel toolchain transitions well enough to make it seamless yet. If you use that feature, every cc_binary has to manually depend upon the libc++ library.

jpieper avatar Oct 12 '20 00:10 jpieper

If people are still interested in this, I think we can get in a hacky thing in and then make it more proper over time. I don't use a Windows machine myself, so if anyone wants to put in effort, I can give them write access and let them manage the Windows feature.

siddharthab avatar Sep 23 '21 08:09 siddharthab

I'm also interested in this feature. And llvm v18.1.1 is released https://github.com/llvm/llvm-project/releases/tag/llvmorg-18.1.1 and clang+llvm-18.1.1-x86_64-pc-windows-msvc.tar.xz is officially supported. Is it possible to take a look at Windows support for now?

johnnyxcy avatar Mar 12 '24 00:03 johnnyxcy