This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: 'make clinic' does not work for out of tree builds / clinic.py is not in the devguide
Type: compile error Stage: resolved
Components: Argument Clinic, Documentation Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, gregory.p.smith, iritkatriel, larry, nascheme, vstinner, zach.ware
Priority: normal Keywords:

Created on 2017-05-27 18:28 by gregory.p.smith, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 1836 merged gregory.p.smith, 2017-05-27 19:45
Messages (8)
msg294604 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2017-05-27 18:28
I never do in-tree builds anymore because they make me feel dirty and leave build artifacts cluttering up my source tree.

make clinic does not work for out of tree builds.

To reproduce:

~$ git clone ...cpython repo...
~$ mkdir build && cd build
~/build$ ../cpython/configure --with-pydebug
~/build$ make clinic
./python -E ./Tools/clinic/clinic.py --make
./python: can't open file './Tools/clinic/clinic.py': [Errno 2] No such file or directory
Makefile:545: recipe for target 'clinic' failed
make: *** [clinic] Error 2

Per https://docs.python.org/3/howto/clinic.html it looks like I can just manually run clinic.py on the files I have modified.  Ideally the build system would take care of that for me.  But all I really want is a single command that keeps me up to date.

python3 Tools/clinic/clinic.py  appears to be that command.  Even if it isn't fixed for out of tree builds, use of clinic needs to be in the devguide.
msg294605 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2017-05-27 19:15
I don't know how to fix it.  "make clinic" needs to be run in-tree anyway as it's modifying the C source code in place.

Can you suggest a patch?
msg294606 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2017-05-27 19:26
The Makefile knows where the source tree is, I think we can make it tell clinic.py.  Let me whip something up.
msg294607 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2017-05-27 19:48
My PR doesn't address the potential issue of needing to have done a make all before doing a make clinic.  I'll leave that for something else, there could be bootstrapping issues in that situation depending on what the developer is doing.

In that less common case, running clinic.py oneself under a stable python3 interpreter is probably advisable.

The devguide docs still need to mention 'make clinic' and point to the argument clinic docs in some section talking about the Modules/ tree.
msg294617 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2017-05-27 23:40
New changeset 178418ad6791b6ef5ba610ed93fab75fc1567ad2 by Gregory P. Smith in branch 'master':
bpo-30492: Allow make clinic to work out of tree. (#1836)
https://github.com/python/cpython/commit/178418ad6791b6ef5ba610ed93fab75fc1567ad2
msg308795 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2017-12-20 19:57
Thanks for fixing this.  I always do my builds in subfolders as well.  It is handy to have multiple builds (debug, opt, profiled) that all use a single source tree.

I don't like to hijack this issue but could we get some of the build bots to do their builds in a subfolder?  I don't know who would be able to make that change.  It would be good to smoke out these kinds of problems early.  Otherwise wierdo's like gps and I don't notice them until later.

If we don't keep this working, we should just rip the ability to do builds outside of the source tree out of the Makefile.  There is no point to maintaining the extra complication if it doesn't actually work.  With git shallow clones, I could live with that.  However, it seems a shame to lose it when it basically currently works fine.
msg308799 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2017-12-20 20:05
> I don't like to hijack this issue but could we get some of the build bots to do their builds in a subfolder?

The buildmaster config is at https://github.com/python/buildmaster-config, feel free to submit a pull request that sets the ware-gentoo bot building out-of-tree.  Victor or I can merge and deploy, but I don't have the bandwidth to make the change myself currently.
msg410830 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2022-01-17 23:03
I'm closing because the original issue was fixed and testing out of tree build issue is the subject of Issue45695.
History
Date User Action Args
2022-04-11 14:58:46adminsetgithub: 74677
2022-01-17 23:03:31iritkatrielsetstatus: open -> closed

nosy: + iritkatriel
messages: + msg410830

resolution: fixed
stage: needs patch -> resolved
2017-12-20 20:05:52zach.waresetnosy: + vstinner, zach.ware
messages: + msg308799
2017-12-20 19:57:22naschemesetnosy: + nascheme
messages: + msg308795
2017-05-27 23:40:48gregory.p.smithsetmessages: + msg294617
2017-05-27 19:48:38gregory.p.smithsetmessages: + msg294607
2017-05-27 19:45:50gregory.p.smithsetpull_requests: + pull_request1920
2017-05-27 19:26:48gregory.p.smithsetmessages: + msg294606
2017-05-27 19:15:46larrysetmessages: + msg294605
2017-05-27 18:28:10gregory.p.smithcreate