Repository navigation
Out-of-tree builds are not tested. #89858
Description
Activity
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.
- added3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixesbuildThe build process and cross-buildThe build process and cross-build
on Nov 2, 2021 FTR, I used to run all Windows builds out of tree on Azure Pipelines, but too many tests broke so I reverted it:
cpython/.azure-pipelines/windows-steps.yml
Lines 7 to 10 in 456e27a
# Relocate build outputs outside of source directory to make cleaning faster Write-Host '##vso[task.setvariable variable=Py_IntDir]$(Build.BinariesDirectory)\obj' # UNDONE: Do not build to a different directory because of broken tests Write-Host '##vso[task.setvariable variable=Py_OutDir]$(Build.SourcesDirectory)\PCbuild' 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.
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.
Reacted by Eric SnowGood 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_unicodedataWe have to live with read-only OOT builds and writable tests for now.
Nice trick with that RO bind mount. tests... yes we do have some writable source tree messes in there to be dealt with.
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
Test was added in #29904 so closing.
gh-78436 mentions that
test_embedis actually skipped on OOT.Reopening until there is agreement on whether this works as required.
Reacted by Erlend E. Aasland- added a commit that references this issue
on Jun 17, 2022 - added a commit that references this issue
on Jun 26, 2022
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: