[issue35156] Consider revising documentation on Python Builds from source

New submission from Jorge Ramos <neyuru@gmail.com>: I want to build from source a 3.6 Python, using PGO for windows. Followed instructions at https://devguide.python.org/setup/ (the original search from google was "build python from source windows"). From a newbie perspective there are several problems: 1) it is suggested that you should build first a "debug" python (header 1.3) but they don't tell you how. 2) it is suggested that you should first build via "PCBuild\build.bat" but they don't tell you that this builds a win32 platform. What if I want to build a x64 version? (lost much time here figuring out how) 3) I ran into problems when building with "PCBuild\build.bat" (header 1.3.2) because the dependencies where not all downloaded in the first pass (but this is a bug I could fill later). Lost much time here figuring why the build did not succeed. 4) in (1.3.2) it is suggested you keep reading in a readme file: https://github.com/python/cpython/blob/master/PCbuild/readme.txt This is the first time an optimization is mentioned (other than simply compiling from your machine. I did not know that using PGO was mandatory for real speedups compared to the downloadable “general” binaries). 5) In this very same readme, it says that there are other "subprojects" that you need to consider building with Python. Lost much time here trying to figure out that these subprojects are downloaded via "get_externals.bat" in the "Getting External Sources" section. Why not simply put the "Getting External Sources" section first and avoid worrying the newcomer of potential projects that are "not included with python"? 6) They tell you that PGO is automated via a "build_pgo.bat" file. But this does not exist. 7) They tell you that first, you have to run the PGInstrument option in the build, but it is not clear what should be run next: PCBuild\build.bat -c PGUpdate -p x64" or "PCBuild\build.bat --pgo -p x64" 8) After 2 days of trying to build (and learn in the process by trial and error) I stumble upon YET ANOTHER WAY TO BUILD: the one found in "cpython\Tools\msi" NOT the first one: "cpython\PCbuild" And this is the one I was interested in the first place: building an installable version of python (yet I have to figure out how to pack all cab files and such into one exe), not a developer’s python for testing. And after now 3 days with this, I noticed that all previous testing and building techniques are indeed reachable from "cpython\Tools\msi\buildrelease.bat -x64" which tries to build a python in x64 version AND using GPO (by default -in the x64 but not in the win32-, which is not mentioned in the documentation, by the way) also generating the dependencies required (I could have avoided losing some time if knowing this from the very beginning- see point 5) As you can see, I lost few hours here, few there. And because I am not a developer (my intention is to have an optimized python for my PC for AI research) I lost much time trying to figure out things that are not explicitly said in the documentation: I managed to learn from other sources (googling around), by careful observation of the compilation results, and digging into the help section of each of the files used. Hope I successfully communicated Python’s lack of proper documentation (just for the case of building from source!) ---------- assignee: docs@python components: Documentation messages: 329211 nosy: docs@python, neyuru priority: normal severity: normal status: open title: Consider revising documentation on Python Builds from source type: enhancement versions: Python 3.6 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue35156> _______________________________________

Change by Karthikeyan Singaravelan <tir.karthi@gmail.com>: ---------- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue35156> _______________________________________

Steve Dower <steve.dower@python.org> added the comment: Most people building Python from the devguide are doing it for contributions, so I'd be very hesitant to change the default recommendations. But we should highlight how to make a working installable build (including the extra dependencies) and the common options on our scripts, as well as their -h options. I also have a "layout" script coming that will make it easier for people to produce their own custom installers by at least copying the files into the right place. ---------- stage: -> needs patch versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue35156> _______________________________________

Jorge Ramos <neyuru@gmail.com> added the comment: Thank you, I think that will suffice. At least guide folks like myself who want to build from source and with optimizations in the right direction (on which folder to work on and which commands to issue to the terminal) Please keep me posted. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue35156> _______________________________________

Jorge Ramos <neyuru@gmail.com> added the comment: One more thing: point in case #6 does credit a revision IMO. The build_pgo.bat file does not exist. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue35156> _______________________________________

Steve Dower <steve.dower@python.org> added the comment: If you're able, you might be the best person to do some of those updates right now :) The rest of us will have to set aside time to get back up to speed on some of the details, and while we'll likely have to do that to review changes anyway, at least that's one less person to wait for. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue35156> _______________________________________

Jorge Ramos <neyuru@gmail.com> added the comment: Although I appreciate the confidence placed in me, I think I'm not exactly the most competent person to make changes to such an important project. I know what -probably- could be improved (from my very narrow point of view) but I don't even know where or how to start so to not screw things up. Don't get me wrong, participating in a project like this (no matter how minor the contribution) is an exciting thought but I ignore so many things that I'm afraid I would probably make it worse rather than making it better. Those things where written for a reason and I'm not even close to know or understand the context on why it was so, as to make a meaningful contribution. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue35156> _______________________________________

Change by Jorge Ramos <neyuru@gmail.com>: ---------- stage: needs patch -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue35156> _______________________________________
participants (3)
-
Jorge Ramos
-
Karthikeyan Singaravelan
-
Steve Dower