-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
Failed to compile static python3.7.12 #91010
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
Comments
I compile static version of python3.7.12, I added the static standard library that I want to compile in Modules/Setup, reference Modules/Setup.dist in python source, like this: static Modules that should always be present (non UNIX dependent): But there are still many modules that fail to compile, these modules with no commented out build definitions in the Modules/Setup.dist file. How do I add these modules build definitions to the Modules/Setup, yes they compile successfully ? Failed to build these modules: |
I have signed the contributor agreement |
Successfully building a statically-linked version of Python depends greatly on the environment in which you are trying to build it and is really beyond the scope of this bug tracker. You don't say on which OS platform and version you are attempting this so it is hard to give any meaningful suggestions other than to make sure you have installed development versions (those including header files) of the various third-party libraries Python builds depend on (like libssl and libcrypto from OpenSSL), if your platform has a package manager, or build the required third-party libraries yourself. In any case, you will probably need to further edit the Setup file to reflect the location of the various third-party headers and libraries. As a rule, we don't do a lot of testing of static builds using Setup directly but some of the downstream distributors of Python do. Also note that Python 3.7 is now in the security-fix-only phase of its lifecycle prior to end-of-life in 2023, so further changes to the build process in 3.7 at this point would be out-of-scope. For what it's worth, there has been a significant amount of work in this area that is going into the next Python feature release, 3.11.0, planned for later this year so it should be significantly easier to do static builds and the like in 3.11. If you still run into problems with 3.7, suggest you ask in help forums like StackOverflow. Good luck! |
The platform i build python3.7.12 on is Ubuntu18.04, I would like to know how the modules I fail to build, like _ctypes, should be added in Modules/Setup. How to build python3.7 statically without relying on editing Modules/Setup? |
As shown in the attachment, how should I add the definition of module _ctypes to Modules/Setup? Modules like _ctypes are not given in Modules/Setup.dist, I really don't know what they depend on |
Sorry, I'll repeat: "Successfully building a statically-linked version of Python depends greatly on the environment in which you are trying to build it and is really beyond the scope of this bug tracker." Note, a quick web search found this page which should give you some suggestions on what dev packages need to be installed in an Ubuntu 18.04 environment. But also note that the directions there are for a normal, non-static Python build using setup.py and not Modules/Setup which, again, we don't normally test for 3.7. Good luck! https://linuxize.com/post/how-to-install-python-3-7-on-ubuntu-18-04/ |
P.S. One other suggestion: try building a non-static version of Python 3.7 first, i.e. without modifying Modules/Setup, and, once you get that working, it should be easier to examine the output from the build and copy those paths that setup.py found into your Modules/Setup. |
I'm really sorry, I would like to know what environment is the official recommendation for static python3.7 compilation? What are the steps and commands for compilation officially required? Because the static python3.7 is very important to me, it has been a week and it has not been compiled successfully.Hope to get official help.Thanks |
“I would like to know what environment is the official recommendation for static python3.7 compilation.” There is no official recommendation. As I’ve mentioned, we normally do not build with modified Modules/Setup configurations when developing and releasing Python. It’s complicated. That’s why setup.py and using Distutils to build the standard library modules was introduced years ago. Most users don’t need a statically linked Python. Please accept that you need to look elsewhere for assistance. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: