Skip to content
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

Document the MSYS2 stack #1891

Open
jaimergp opened this issue Jan 26, 2023 · 11 comments
Open

Document the MSYS2 stack #1891

jaimergp opened this issue Jan 26, 2023 · 11 comments

Comments

@jaimergp
Copy link
Member

jaimergp commented Jan 26, 2023

Where should the content be added?

Probably in the knowledge base

What should be added?

The MSYS2 stack is built in non-conventional ways and its not well documented. E.g. TIL how m2-* vs m2w64-* packages must be used in the recipe, but I don't know why.

There are some issues with some background, but the picture is incomplete and it should be preferably clarified and discussed in the documentation.

Additional information

@zklaus
Copy link
Contributor

zklaus commented Jan 29, 2023

Thanks for the initiative, @jaimergp! One question I would like to see addressed is that of data model: Unix generally uses LP64, whereas Windows uses LLP64, the main difference being that long int is 64bit, and 32bit, respectively. This gives me some headaches with the Windows builds of esmf, netcdf, etc. Cygwin on Windows uses LP64, precisely to simplify porting things from the Unix world. This requires greater care when calling into the Windows API, see here.

If we think the main reason for the win-64 subdir is the porting of Unix toolchains, it may be better to just go with the Cygwin approach?

pkgw added a commit to regro-cf-autotick-bot/xorg-libx11-feedstock that referenced this issue Jun 7, 2023
…on minimum

This is the same issue as seen in
conda-forge/xorg-libxt-feedstock#13 -- it looks
like the X.org packages are bumping their autoconf requirements to 2.70,
while our Windows toolchain only provides 2.69. Unfortunately, we don't
really know how to update the Windows tools right now, as tracked in
conda-forge/conda-forge.github.io#1891 .

Let's see if it works to just patch the version requirement down. The
2.70 release of Autoconf is billed as introducing several important
changes (and it comes 8 years after 2.69), but I would expect that if it
doesn't reject the `configure.ac` specification, we should be OK.
@pkgw
Copy link
Contributor

pkgw commented Sep 22, 2023

It looks like the update to Python 3.12 is going to interact with this issue. In conda-forge/xcb-proto-feedstock#24 , the Windows / Python 3.12 build is failing because the most recent available MSYS2 automake package, m2-automake1.15, provides a very old version of a support script (py-compile) that relies on the imp module, which was removed in 3.12. This problem can definitely be worked around at the feedstock level, but it would be nice to not have to do that.

@isuruf
Copy link
Member

isuruf commented Sep 23, 2023

If we think the main reason for the win-64 subdir is the porting of Unix toolchains, it may be better to just go with the Cygwin approach?

@zklaus, m2- packages uses the MSYS2 runtime which is a fork of the Cygwin runtime whereas m2w64- packages link to msvcrt (or ucrt). If you compile netcdf etc with Cygwin, then you would have to compile python with Cygwin too, then you won't be able to use any of the pip wheels because it will be a different Python ABI.

@isuruf
Copy link
Member

isuruf commented Sep 23, 2023

@pkgw, we will update the packages in the near future.

@pkgw
Copy link
Contributor

pkgw commented Sep 24, 2023

@isuruf That is great to hear! Do you have a sense of how near "near" is? Depending on the timeline it might make sense to deploy some workarounds to help advance the Python 3.12 migration.

@isuruf
Copy link
Member

isuruf commented Sep 24, 2023

A month or two I guess

@FaustinCarter
Copy link

A month or two I guess

Any update on this? Would be awesome to have an update to the old 2016 packages.

@isuruf
Copy link
Member

isuruf commented Apr 4, 2024

The m2 packages have been updated, but not the m2w64 packages.

@ehfd
Copy link
Member

ehfd commented May 6, 2024

As of today, how is it possible to use MSYS2 to build newer packages which have various issues impacting its usage with Visual Studio (such as https://mesonbuild.com/FAQ.html#my-project-works-fine-on-linux-and-mingw-but-fails-to-link-with-msvc-due-to-a-missing-lib-file-fatal-error-lnk1181-why)?

For instance, I need to use m2-automake1.16 which is required for autoconf > 2.70, and there is the following error with the m2w64_c toolchain. Would like to know if it's possible to utilize this now or not.

Could not solve for environment specs
The following packages are incompatible
\u251c\u2500 m2-automake1.16 is installable and it requires
\u2502  \u2514\u2500 m2-conda-epoch 20230914 *_x86_64, which requires
\u2502     \u2514\u2500 msys2-conda-epoch <0.0a0 , which can be installed;
\u2514\u2500 m2w64-toolchain_win-64 is not installable because it requires
   \u2514\u2500 m2w64-toolchain, which requires
      \u2514\u2500 msys2-conda-epoch 20160418 , which conflicts with any installable versions previously reported.

Edit: For an answer to this, refer to conda-forge/xorg-makedepend-feedstock#9 (comment) (copied below)

I'll duplicate one of my commit messages here in the PR discussion. For posterity, here are the changes to update the package to work with the updated MSYS2 stack:

Remove very old MSYS2_ARG_CONV_EXCL workaround in bld.bat
Remove very old IFS workaround in build.sh
Update Automake to 1.16 (in both meta.yaml and build.sh)
Update aclocal include path given to autoreconf
Remove posix dep; addm2-{grep,m4} (on Windows only, of course)
Change make dep to m2-make (Windows only)
Change m2w64-pkg-config dep to m2-pkg-config (Windows only)
Switch to MSVC compilers: change compiler('m2w64_c') to compiler('c'), etc

Other X.org packages that are migrating should also use the opportunity to start depending on the unified xorg-xorgproto protocol package, which supersedes the individual xorg-*proto packages that we have used historically.

In this particular package, we also need to patch the source to work on a native MSVC build. I believe that most other X.org packages should be able to build with MSVC without needing (additional) patching.

@ehfd
Copy link
Member

ehfd commented May 6, 2024

Moreover, is it possible to use code containing fork() with Windows MSYS2 builds without major patches? If so, how?

@pkgw
Copy link
Contributor

pkgw commented May 6, 2024

@ehfd I think your kinds of questions are a bit too fine-grained for this issue, which is more targeted at the higher-level MSYS2 situation. I've replied in the xorg-libxmu PR thread with some pointers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

6 participants