-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Download and manage internal copy of MSYS2 for ./configure-only libraries #241
Comments
MSYS2 relies on its own package manager (pacman) which downloads binary packages. This will make one package manager (vcpkg) to depend on the other.
Maybe vcpkg should provide prebuilt versions of each required MSYS2 package and not rely on pacman at all? Also I'm not sure if autoconf scripts can understand how to use msvc.
ffmpeg doesn't use autoconf, there is a handwritten |
Thanks for bringing up the point about autoconf; I believe all the libraries above use bash
|
Just to give an example - MSYS2 doesn't require any user interaction. It is possible to compose a set of required tools, that can be provided. I'm currently working on the PHP Windows build toolkit, where we use many OSS tools like fe. bison, re2c, zip, etc. The actual PHP binaries and dependencies are produced with the conventional Visual Studio by standard. So we don't depend on the MSYS2 libraries for the compilation, but only on the tools, that MSYS2 provides or that are impossible to provide using the Windows toolchain. What I'm literally doing, is picking the required tools and their dependencies, thus avoiding to have the whole MSYS2 tree, even avoiding to have the whole base tools package. Also, even if the original MSYS2 might not contain some tool - well, you can compile it with the toolchain provided by MSYS2. It'll have then same dependencies as the MSYS2 distribution, so can be shipped with it. Now, as i understand, the tools like autotools, maybe make and some others, are only what is needed for VCPKG as well. Otherwise, it could be done the other way round - take the MSYS2 distribution, but only leave the tools that can be useful and strip others out. As mentioned, the big pluses of doing it this way are
Thanks. |
Does invoking msvc through a configure script work correctly in msys2? The way I've done that in the past, using the |
Don't think that Long term it's probably most worthwhile to translate and contribute cmake ports of various projects' build systems for them to support msvc in a predictable way. |
I've added initial support for a minimal internal msys with 2f8d8d8, which also demonstrates using it to build FFMPEG. Please open new issues or pull requests for improvements! A notable issue at the moment: we do not hash check the msys2 packages. This means they can (and will) update underneath us, which could cause intermittent or unreproducible errors for users. We should try to improve this in the future, such as by individually downloading packages ourselves, checking them, then installing them with |
Since it's unfortunately common to require autoconf on Windows (ffmpeg, ipopt, ...), we probably need vcpkg to download and manage an internal copy of MSYS2 for just this reason.
It is possible to use MSYS2 without a global install (https://github.com/StephanTLavavej/mingw-distro), but those instructions require user interaction as written. I'm sure we can mimic whatever effects the
msys2_shell.bat
script is having and internally perform those.Depending on the size/time cost of this, we may want to allow the user to provide their own MSYS2 (or autodetect a system-installed one).
Needed for: #233 #2
The text was updated successfully, but these errors were encountered: