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: Out-of-tree builds are not tested.
Type: Stage: patch review
Components: Build Versions: Python 3.11, Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: gregory.p.smith Nosy List: christian.heimes, eric.snow, erlendaasland, gregory.p.smith, gvanrossum, steve.dower
Priority: normal Keywords: patch

Created on 2021-11-02 23:29 by eric.snow, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 29904 merged christian.heimes, 2021-12-03 13:20
Messages (7)
msg405568 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2021-11-02 23:29
Currently we don't test builds done outside the source tree, neither on GitHub nor the buildbots. [1]  As a result, such builds get broken occasionally.  I've certainly broken then a couple times, inadvertently.  It would be helpful if we tested out-of-tree builds on GitHub, or at least on a stable buildbot.

FTR, to do an out-of-tree build locally and test it:

mkdir ../build
cd ../build
../cpython/configure
make
./python -m test


[1] Actually I recently added test.test_tools.test_freeze.TestFreeze.test_freeze_simple_script which happens to do an out-of-tree build incidentally.  However, we should be testing out-of-tree builds explicitly.
msg405572 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-11-03 00:39
FTR, I used to run all Windows builds out of tree on Azure Pipelines, but too many tests broke so I reverted it: https://github.com/python/cpython/blob/456e27ac0ac6bc1cfd6da0191bd7802d8667457b/.azure-pipelines/windows-steps.yml#L7-L10

Setting $env:Py_OutDir before building is the easiest way to change it. You can also pass "/p:Py_OutDir=<path>" to build.bat, but you'll run into quoting issues almost immediately.
msg405573 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2021-11-03 00:47
I always do out of tree builds _(I find people who build anything in tree to be very weird - it makes a mess)_.

I intend to look into making sure a Linux buildbot runs this way but don't let that stop anyone else from doing so.
msg407591 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-12-03 14:16
Good news: I got a test case for OOT build with read-only sources

Bad news: 15 test cases are failing and testing takes much longer because pyc files are missing.

15 re-run tests:
    test__xxsubinterpreters test_ast test_bdb test_capi test_doctest
    test_import test_importlib test_interpreters test_pickle
    test_pydoc test_runpy test_support test_threading test_trace
    test_unicodedata

We have to live with read-only OOT builds and writable tests for now.
msg407594 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2021-12-03 17:18
Nice trick with that RO bind mount.  tests... yes we do have some writable source tree messes in there to be dealt with.
msg407595 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2021-12-03 18:09
FWIW, it is also impossible to build the docs OOT without cluttering the source tree.

    $ cd ../build
    $ make -C ../cpython.git/Doc venv
    $ make -C ../cpython.git/Doc html  # <= modifies Doc/build in the source tree
msg407652 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-12-04 10:08
New changeset cee07b162843694e8166ad8715162d4d5886b50f by Christian Heimes in branch 'main':
bpo-45695: Test out-of-tree builds on GHA (GH-29904)
https://github.com/python/cpython/commit/cee07b162843694e8166ad8715162d4d5886b50f
History
Date User Action Args
2022-04-11 14:59:52adminsetgithub: 89858
2021-12-04 10:08:03christian.heimessetmessages: + msg407652
2021-12-03 18:09:57erlendaaslandsetnosy: + erlendaasland
messages: + msg407595
2021-12-03 17:18:40gregory.p.smithsetmessages: + msg407594
2021-12-03 14:16:17christian.heimessetmessages: + msg407591
2021-12-03 13:20:29christian.heimessetkeywords: + patch
stage: test needed -> patch review
pull_requests: + pull_request28128
2021-11-03 00:47:54gregory.p.smithsetassignee: gregory.p.smith
2021-11-03 00:47:34gregory.p.smithsetmessages: + msg405573
2021-11-03 00:39:34steve.dowersetmessages: + msg405572
2021-11-02 23:29:45eric.snowcreate