Use mlocati/inspect-visualstudio GH Action to wrap vcvarsall.bat#2
Use mlocati/inspect-visualstudio GH Action to wrap vcvarsall.bat#2mlocati wants to merge 1 commit intognu-gettext:masterfrom
Conversation
|
Hi Michele,
Yes, this is the problem that I faced when trying to create a build environment for MSVC binaries using Cygwin. Your https://github.com/mlocati/inspect-visualstudio project can certainly be helpful for users who don't want to set up the necessary environment variables manually. Although it looks like it has two problems:
In my
|
Typescript is the source language. But it's transpiled to javascript (see here and here).
Of course people installing cygwin in creative ways on github actions will have to process paths on their own. But it 's not the case here, isn't it?
It reduces completely IMHO: it uses vswhere to autodetect the available visual studio, and uses the vcvarsall utility that comes with visual studio to detect the build environment. Easy, secure and future proof.
Of course a github action is only meant to be executed in a github environment, so it's orthogonal vs any other environment. So, if one of the aims of this repo is to be sure the instructions in install.windows doc are ok, feel absolutely free to throw this PR in a trashcan 😉 |
OK, I had imagined that you wanted this tool to be useful also for users who check out the GNU gettext sources from git or from a tarball and want to build them locally.
I agree that it makes things easy. But at the cost of added complexity (→ reduced transparency) and added dependencies. This is a difficult trade-off. I've come to dislike these easy but complex wrappers over the years (from the Windows installers in .exe format, where a .zip would have been sufficient; up to the KDE NetworkManager app with its unpredictable behaviour).
Yeah, I know the next migration to a newer Visual Studio version or Windows version might cause a bit of work, to update the directory names. But that is not so much different to upgrading to a new Homebrew version on macOS. |
Configuring the environment variables used by Visual C++ is rather a nightmare.
That's why Microsoft provided helper batch files.
The one to be used to builc C/C++ projects is
vcvarsall.bat.Sadly, we can't use
vcvarsall.batdirecly when using Visual C++ from Cygwin... For example the PATH environment variable must be in Cygwin notation (/cygdrive/c/...) (I guess you too tried it - see this useless step and this messy code).That's why, for my gettext project for Windows I wrote the
mlocati/inspect-visualstudioGitHub Action: it parses the variables set byvcvarsall.bat, so that other steps can use them.What about switching to it?
PS: I launched a test run and it seems ok