llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.89k stars 11.51k forks source link

Provide unified installer for C/C++ tooling for windows. #91108

Open Rossmaxx opened 4 months ago

Rossmaxx commented 4 months ago

I appreciate the llvm project for making this awesome compiler and releasing it under open source. I currently use MSVC build tools for compiling C++ code and would like to use clang but I can't for one reason - There's no .exe installer available. I can get it from visual studio but the VS clang support is experimental from what I heard. I als use mingw from msys2 for working with vscode as integrating msvc build tools with vscode is a pain. Msys2 comes with a different drawback being it's hard to install and update for novice users.

What I'm asking is for the project to release official binary installs with everything needed (compiler, debugger, runtime, sdk, etc) to be consolidated to one package + an "add to path" option in the installer so that one need not fiddle with the system variables on their own.

The motivation for opening this issue came from a friend asking me for an "easy way to install a C compiler". I couldn't suggest any of the methods i did because he didn't want to do anything other than run the code given in the classes.

One suggestion that i have for an implementation is to use the mingw runtime + gcc libc with clang (as using MS sdk might lead to license issues)

Sorry in advance if the issue report ended up being too long.

Andarwinux commented 4 months ago

Bundling the Windows SDK is obviously impractical, and MinGW isn't a reasonable choice either, with a command line style that's completely different from MSVC (albeit better), severely outdated headers, lack of all modern Windows features.

Rossmaxx commented 4 months ago

Thanks for the reply.

Bundling the Windows SDK is obviously impractical

That's what i suggested mingw for instead but from your reply, looks like mingw isn't feasible either.

a command line style that's completely different from MSVC

I believe a simple readme is enough to clarify the differences (or a clang --help entry)

severely outdated headers

I'm actually asking this for amateur users/schools, where convenience is the no 1 priority above staying updated. In most schools in our area, we use turbo C, which is years behind even mingw. Still, updated headers is actually something we should be having.

I was supposed to be opening this issue with the mingw project for an easy installer but looks like that project has been dead for long.

mstorsjo commented 3 months ago

FWIW, llvm-mingw, https://github.com/mstorsjo/llvm-mingw/releases, does provide most of what you're asking for - one single package to unpack and add to $PATH, containing compiler, SDK, debugger, all usable directly out of the box. It (obviously) uses mingw-w64 though, so it's not in sync with all the latest bits in WinSDK though (but as the WinSDK is unredistributable, nobody can provide such a single package that is bundled and set up anyway), but for many practical uses, it should be quite enough.