Comments (27)
Hmm. I don't personally know much at all about Windows development. Does Python 3 do this?
from tauthon.
Yes. It would really help to modernize this 2.8 version for C and C++ modules. I believe @ukoethe has done this before?
from tauthon.
See https://github.com/kovidgoyal/cpython
from tauthon.
Thanks. Any chance of submitting a PR?
from tauthon.
Sure, but I'd need to hear from @naftaliharris if he is willing to accept such a PR before I spend the time.
from tauthon.
@kovidgoyal, I don't understand this issue. (I don't know much about Windows development, I'm afraid). Is there some place I can read a bit more about this? If this is something it makes sense to do, (which I don't know enough to decide), I would be very grateful for a PR and be very happy to review it.
from tauthon.
See the original issue I opened on the python bug tracker for more details: http://bugs.python.org/issue25759 for details on the patches.
As for why it is needed a brief background: On windows every different compiler (and there are dozens) usually ships with its own incompatible C library (think gnu libc). This even includes different versions of the same compiler. All native code used in a single program should be compiled against the same C library, otherwise you can end up with crashes in code that uses C library functions, which is pretty much all code, if it uses datastructures from one C library passed to another C library.
As a result, python and all its extension modules have to be compiled with the same version of Visual Studio (the "official" compiler to be used on windows). If you change the version of visual studio everything has to be recompiled. python 2.7 is stuck on Visual Studio 2008 which is very old and has no support for things like C++11. So if you use any modern C++/C99 libraries, such as, for example, Qt, ten you cannot compile them with VS 2008 and so cannot use them with python 2.7.
Feel free to ask if you have more questions.
from tauthon.
Also as of Visuual Studio 2015, microsoft has moved to a "universal" C library that is (almost) entirely decoupled from visual studio versions and is updated as part of the OS itself -- this functions more like gnu libc on linux, where programs compiled against older versions continue to work against newer versions.
from tauthon.
So let me know if this is something you want to accept in tauthon. Also, it would be nice to setup appveyor CI integration to test tauthon on windows alongside linux and OS X. It's my TODO list to setup that up in my cpython fork in any case, so if you want this PR I'll probably create it only after I have that working.
from tauthon.
So if somebody has a C-extension that works with Python 2.7, and we start building with VS 2015, what would you need to change about the C-extension in order to use it with tauthon? Any code changes, or just recompiling with VS 2015?
Also, it would be nice to setup appveyor CI integration to test tauthon on windows alongside linux and OS X.
That would be excellent!
from tauthon.
Another windows-related issue I'd love to have help on is #16, which will help us backport asyncio for windows.
from tauthon.
from tauthon.
from tauthon.
So let me know if this is something you want to accept in tauthon. Also, it would be nice to setup appveyor CI integration to test tauthon on windows alongside linux and OS X.
Thanks for explaining the issue to me! Yes, I will accept a PR for this, (but lets get CI for windows working first).
from tauthon.
OK -- probably sometime this weekend, although given that it is also my daughter's annual day on Saturday, maybe not :)
from tauthon.
Well I have it building on AppVeyor, but one of the ctypes tests is causing a hard crash. I cannot reporduce on my windows machine and trying to debug a crash on appveyor is impossible, so I'm stuck. All the other tests pass on AppVeyor.
from tauthon.
I tried to reproduce the ctypes crash on three different windows VMs, failed in all, so Ihave just skipepd the test on AppVeyor, now the build succeeds: https://ci.appveyor.com/project/kovidgoyal/cpython
Note that I have skipped the following tests:
- ctypes, for reasons noted above
- bsddb: not of interest to me
- tcl/tk: not of interest to me
Other than that, everything is built and all tests are run (except the very slow/memory intensive ones)
from tauthon.
Ok, I'm trying this out on Tauthon: https://ci.appveyor.com/project/naftaliharris/tauthon
Since backwards compatibility is a critical feature of this project, I am going to need all of the tests to pass.
from tauthon.
Added a new issue for this the CI #69
from tauthon.
All tests do pass, just not on appveyor. It's likely something about the appveyor environment, but its hard to figure out what.
from tauthon.
Also with regards to this, it'll also screw up the building of modules as distutils and such will need to be updated. I submitted a patch to 2.7 but as expected it was ignored.
https://bugs.python.org/issue35172
I regularly build my CPython 2.7 with VS2012 and VS2015, if there's still interest in this issue I can take the time to submit PRs.
from tauthon.
Please submit that patch here. Any way to control the Visual Studio version used by "PCbuild/build.bat" and ".github/appveyor.yml"?
from tauthon.
@stefantalpalaru, not directly as the environment variables that point to the SDK and Header files are assigned by vcvarsall.bat via a parameter for 32-bit/64-bit. So one would need to locate that file based on which version the user has installed (probably searchable via the registry). But there isn't a general way as I think the user is expected to explicitly choose which version of VS they want to build under.
I'm not too familiar with appveyor, but docs seem to claim that you can specify the VS image to use via the "Image:" parameter like:
# Build worker image (VM template)
image: Visual Studio 2015
from tauthon.
Btw, PR #120 adds the support for other versions of VS to distutils.
from tauthon.
I submitted PR #121 which explicitly adds a platform-toolset
parameter to PCbuild/build.bat
. This should make it easier to specify the toolset to link with.
Keep in mind though that although later versions of Visual Studio do support C++11 (and more), Visual Studio 2015 and below don't fully support Expression SFINAE and a handful of other things that some of the cooler C++ libraries use. (Ran into this problem as using some of the cooler C++ libraries w/ Python was the primary reason for building it w/ later versions of Visual Studio).
from tauthon.
Keep in mind though that although later versions of Visual Studio do support C++11 (and more), Visual Studio 2015 and below don't fully support Expression SFINAE and a handful of other things that some of the cooler C++ libraries use. (Ran into this problem as using some of the cooler C++ libraries w/ Python was the primary reason for building it w/ later versions of Visual Studio).
@arizvisa , there is always mingw64-gcc :-).
from tauthon.
Implemented by #120
from tauthon.
Related Issues (20)
- Backport issue4761: POSIX openat, etc HOT 1
- proper releases HOT 13
- CVE-2019-9740 HOT 8
- backport venv module HOT 1
- be present on travis HOT 5
- make uninstall HOT 3
- C preprocessor symbol when building C extension modules for Tauthon? HOT 3
- Build a wheel for Tauthon? HOT 6
- Asynchronous for-loops not yet implemented HOT 1
- Python issue 1663329: subprocess/popen close_fds perform poor if SC_OPEN_MAX is hi HOT 1
- Plone 4 on Tauthon HOT 61
- like 10000 errors HOT 2
- Build error on Windows x64 HOT 1
- Formalize "batteries not included" availabiity HOT 1
- Some new packages are not installed by `make install`
- Fix security issues reported on bpo up to 2021/03/31 HOT 7
- Question about compilation for spidermonkey HOT 6
- Is it still developed? HOT 18
- Regression test hang in test.test_concurrent_futures.ProcessPoolAsCompletedTests HOT 2
- Regression test test_multiprocessing fails HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tauthon.