Hacker News new | ask | show | jobs
by seventh-chord 2221 days ago
If you install visual studio, and then copy together all the files it adds to %PATH%, %INCLUDE% and %LIB%, and create a .bat script to set environment variables to point to your copies of these files you get a fully portable first-class compiler for windows with needed headers and libraries, zipped up to around 75 mB. Add remedybg as a debugger, and your editor of choice, and you never have to touch visual studio again.
3 comments

Which you need the visual studio installer for, which only works half of the time. Just to check if it still is as bad as last I tried, I downloaded the build tools and started the installer. Currently downloading 1 GB of data...

Edit: To nobodies surprise, the installer still doesn't work. The command line shortcuts it installs fail to properly set up the path. At least it looks like they are trying to print a sensible error message in the command prompt now though. Still not quite sure how they manage to fail this badly though.

There's no way all the libraries zip up to 75MB. Literally just the x64 CRT lib folder by itself zips up to 96MB. I think you meant more like 1GB?
Not sure exactly what folder you mean, but I literally have a 75 MB zip file (or rather, it's a .7z file, zipping would make it slightly larger). Unzipped its 700 MB though.
Which folder do you mean? I'm referring to

  C:\Program Files (x86)\Microsoft Visual Studio\2019\{edition}\VC\Tools\MSVC\{version}
In that folder, bin includes files for compiling from x86/x64 to x86/x64, and in practice you only need one of the subfolders (in my case the x64 to x64 toolchain). The lib folder also includes binaries for x86 and onecore. If you remove all of those 7zip compresses the rest down to 25 MB.
You're kidding right? Hostx64\x64 is like 51MB, lib\x64 is 428MB, together they compress to like 116MB. And then you forgot the ATLMFC x64 files which are 465MB and bring it to 230MB compressed.
On the fresh install of the 2019 build tools lib\x64 is 200 MB. I tried using 7zip to compress to .zip instead of to .7z, that took the archive from 25MB to 75MB. I might not have enabled ATLMFC in the installer though, I didn't change the default checkboxes.

Edit: I feel like this whole discussion highlights the issues with the vs installer though. If it wouldn't create hundreds of folders all over the place it would be much easier to have a sane discussion about it.

Can someone do that, and legally redistribute it? Please?