-
Notifications
You must be signed in to change notification settings - Fork 473
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
MinGW32 cannot build Python wheel packages #285
Comments
So to refresh my memory I took a look at #73 which is where the I didn't see us discussing the option to link statically with the C/C++ library at the time as one option as opposed to distributing In terms of a questionable license I'm not sure what the potential issue is. This link from Microsoft https://docs.microsoft.com/en-us/visualstudio/productinfo/2015-redistribution-vs mentions:
I just double-checked and and Now while looking around for some info on Python modules and
https://stevedower.id.au/blog/building-for-python-3-5 And the recommendation at the end of it is to link statically against the C/C++ runtimes. However he mentions that Lastly right at the end of the page there is mention of |
Thanks for the detailed answer @seanmcleod, that was very helpful.
Indeed, we haven't discussed such an option after we resolved the issue #73. Since it's quite a looong answer that I have written below, here is the executive summary aka TL;DR:
Now here is the detailed answer. Brace yourselves: License
Yes, I am aware of that statement however your quotation is incomplete (bold-facing is mine):
Which license are they referring to ? For instance the top paragraph of Distributable Code Files for Visual Studio 2017 say (bold-facing is mine again):
I infer from that statement that you need to own a license of Visual Studio to be granted the right to copy and distribute the aforementioned files. In the case of our CI workflow, GitHub own licenses of Visual Studio (at least, I hope they do 😉) and our packages are distributed through their site so I can only guess that we are covered by their license. In addition, a lot of open source projects (including Python) are happily distributing some files from the For a bit of context, I started being involved in open source in the early 2000 which was the time when Steve Ballmer was Microsoft CEO. Remember that guy who said that open source was a "communist cancer" ? He did all he could to shoot down open source projects with software patents, undisclosed APIs and purposely standards violations. Although his successor, Satya Nadella, is unquestionably having a friendly attitude towards open source (and this is why I did not flee from GitHub when Microsoft purchased them), it remains that, as far as I am concerned, Steve Ballmer's era left some scars. Hence my uneasiness. In addition to that, I have come across this answer from the GNU foundation in a FAQ about the GPL license
Fortunately, JSBSim is licensed under the LGPL 2.1 which allows distribution of JSBSim with
However, the particular case of the GPL license that I mentioned above shows that licenses are, at least to me, muddy waters. Compilation with MinGW32I have finally fixed the problem that triggered the compilation of the Python package with MSVC even when As a matter of fact, the Python's def get_msvcr():
"""Include the appropriate MSVC runtime library if Python was built
with MSVC 7.0 or later.
"""
msc_pos = sys.version.find('MSC v.')
if msc_pos != -1:
msc_ver = sys.version[msc_pos+6:msc_pos+10]
if msc_ver == '1300':
# MSVC 7.0
return ['msvcr70']
elif msc_ver == '1310':
# MSVC 7.1
return ['msvcr71']
elif msc_ver == '1400':
# VS2005 / MSVC 8.0
return ['msvcr80']
elif msc_ver == '1500':
# VS2008 / MSVC 9.0
return ['msvcr90']
elif msc_ver == '1600':
# VS2010 / MSVC 10.0
return ['msvcr100']
else:
raise ValueError("Unknown MS Compiler version %s " % msc_ver) Python Wiki tells no different story about Windows compilers:
And the section about MinGW in the same Wiki article clearly states that: "MinGW is an alternative C/C++ compiler that works with all Python versions up to 3.4." So much for compiling our Python package with MinGW32 ! Anyway, I have pushed the code to compile the Python package with MinGW32 to JSBSim, in case the Python developers change their mind in the future. For now, the compilation of our Python package is disabled for MinGW32 by setting Shipping
|
This is known to fail since compilation of Python packages with MinGW32 is longer supported by Python since version 3.5. These modifications are pushed to JSBSim for when the support of MinGW32 will be brought back by Python developers. Would that happen, this commit will hopefully avoid from delving again into the nuts and bolts of distutils.
Hmm, well your answer was 10x more detailed than my answer :wink I'd suggest maintaining our status quo of shipping |
😄 I was not trying to compete with your answer but rather building on the foundations it has laid. When I said the links you have provided were enlightening, I really meant it 👍. I spent a whole afternoon gathering additional information and making up my mind on that topic, so I felt it needed to be documented somewhere for future reference. Hence that long answer.
Good, so I consider the issue closed. |
When building JSBSim with
-DBUILD_PYTHON_MODULE=ON
, the library is built with MinGW32'sgcc
compiler but, for some reason, the Python module is built with MSVC which triggers a complete new compilation of the library. As a result, the library is compiled twice.That's a shame because I would prefer building the Python modules for Windows with MinGW32 rather than MSVC. That would avoid shipping the DLL
msvcp140.dll
and its questionable license with our Python Windows package.The text was updated successfully, but these errors were encountered: