python-build-standalone icon indicating copy to clipboard operation
python-build-standalone copied to clipboard

Just a heads up

Open hippylover opened this issue 5 years ago • 6 comments

There's a project tackling portable builds on linux called build-anywhere located here: https://github.com/theopolis/build-anywhere

I don't know if it is useful, just thought i should tell. Before i found python-build-standalone project i tried to build the _ctypes extension statically(still can't get it to work) through build-anywhere project.

There's another thing though. Following this: https://wiki.python.org/moin/BuildStatically in addition to build-anywhere i can build a python binary with no deps. I can't get _ctypes to compile though so i can't really test it. But isn't this better than the binary depending on a lot of stuff gotten through this project or am i confused. Maybe those deps are to static builds?

hippylover avatar Oct 09 '19 12:10 hippylover

Well actually i can't run this project either:

$ ./build-linux.py

[...]
Installing collected packages: certifi, pycparser, cffi, chardet, click, six, idna, urllib3, requests, websocket-client, docker, markupsafe, jinja2, pip-tools, zstandard
  Running setup.py install for pycparser ... done
Successfully installed certifi-2019.6.16 cffi-1.12.3 chardet-3.0.4 click-7.0 docker-4.0.2 idna-2.8 jinja2-2.10.1 markupsafe-1.1.1 pip-tools-4.0.0 pycparser-2.19 requests-2.22.0 six-1.12.0 urllib3-1.25.3 websocket-client-0.56.0 zstandard-0.11.1
You are using pip version 19.0.3, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Makefile:66: /home/kris/Downloads/python-build-standalone-master/build/versions/VERSION.*: No such file or directory
make: *** No rule to make target '/home/kris/Downloads/python-build-standalone-master/build/versions/VERSION.*'.  Stop.

hippylover avatar Oct 09 '19 12:10 hippylover

Thanks for the project pointers!

The _ctypes extension requires various patches to CPython for it to work properly. As do some other modules. You really need to build every transitive dependency from source in order to get the portability that you need. And even then it can be difficult to do right. There are known places where this project still isn't doing things completely properly.

indygreg avatar Oct 25 '19 05:10 indygreg

Cross-linking issues https://github.com/theopolis/build-anywhere/issues/3

It looks like it may be useful to grab some of the recipes from build-anywhere, as a basis for this projects build.

@hippylover , to go back to one of your questions, the reason for this project is primarily to build standalone Python as a bundle of bits, so that people can pick and choose which bits they want, and those decisions might be made due to licensing decisions. Just building static Python isnt enough - usually people want it to be redistributable, and that is where it gets difficult.

The tarballs at Releases are usually enough for anyone. They got me started, and as a result I never tried ./build-linux.py here.

fwiw, I have a static Python build setup at https://build.opensuse.org/project/show/home:jayvdb:python37-static , and ctypes wasnt a problem. It is based on static libs which were already avail in openSUSE + some mods because they tend to disable static libs.

And on top of that I have Nuitka doing a standalone build at https://build.opensuse.org/package/show/home:jayvdb:storyscript-standalone-static/python-story

The key element I needed was a more expansive Modules/Setup.local than the one here, but I used this one as a guide to get my own builds functional.

jayvdb avatar Oct 28 '19 12:10 jayvdb

Hi. Thanks for your response. I tried the musl build in Releases -- the glibc one gave me an error in centos 6. tried to install pyqt from pip but all it said was "Killed". I looked at a strace output and -- as far as i am able to comprehend -- it seems it cannot connect to the internet.

hippylover avatar Oct 30 '19 21:10 hippylover

I got the same error

make: *** No rule to make target '/home/kris/Downloads/python-build-standalone-master/build/versions/VERSION.*'.  Stop.

amosbird avatar Nov 08 '19 14:11 amosbird

Well actually i can't run this project either:

$ ./build-linux.py

[...]
Installing collected packages: certifi, pycparser, cffi, chardet, click, six, idna, urllib3, requests, websocket-client, docker, markupsafe, jinja2, pip-tools, zstandard
  Running setup.py install for pycparser ... done
Successfully installed certifi-2019.6.16 cffi-1.12.3 chardet-3.0.4 click-7.0 docker-4.0.2 idna-2.8 jinja2-2.10.1 markupsafe-1.1.1 pip-tools-4.0.0 pycparser-2.19 requests-2.22.0 six-1.12.0 urllib3-1.25.3 websocket-client-0.56.0 zstandard-0.11.1
You are using pip version 19.0.3, however version 19.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Makefile:66: /home/kris/Downloads/python-build-standalone-master/build/versions/VERSION.*: No such file or directory
make: *** No rule to make target '/home/kris/Downloads/python-build-standalone-master/build/versions/VERSION.*'.  Stop.

I got the same error

make: *** No rule to make target '/home/kris/Downloads/python-build-standalone-master/build/versions/VERSION.*'.  Stop.

Could you please provide more information in the dedicated issue?

I-AM-EXFOLIATING avatar Oct 16 '20 10:10 I-AM-EXFOLIATING