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: Build CPython out of tree with a read-only source tree
Type: Stage: resolved
Components: Build Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: cstratak, vstinner
Priority: normal Keywords:

Created on 2017-05-05 16:27 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 1481 merged vstinner, 2017-05-05 16:36
PR 2244 merged vstinner, 2017-06-16 11:35
Messages (6)
msg293121 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-05 16:27
I tried to build CPython out of the source tree with a customized read-only source tree (chmod -R -w). I got an error when running tests: tests want to write into a build/ directory... in the source tree.

Attached patch fixes this issue.
msg293125 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-05 16:59
Ah, there is one and only one failing test:

======================================================================
ERROR: test_synopsis_sourceless (test.test_pydoc.PydocDocTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/haypo/prog/python/ro.master/Lib/test/test_pydoc.py", line 586, in test_synopsis_sourceless
    synopsis = pydoc.synopsis(filename)
  File "/home/haypo/prog/python/ro.master/Lib/pydoc.py", line 253, in synopsis
    mtime = os.stat(filename).st_mtime
FileNotFoundError: [Errno 2] No such file or directory: '/home/haypo/prog/python/ro.master/Lib/__pycache__/os.cpython-37.pyc'
msg293126 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-05-05 17:00
test_synopsis_sourceless() should create a script, build it and test the generated .pyc file. So we control how the .pyc file is created.
msg296044 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-06-14 22:44
New changeset f7e07840d725f2ebb469129cb5e6574ce61725ef by Victor Stinner in branch 'master':
bpo-30284: Fix regrtest for out of tree build (#1481)
https://github.com/python/cpython/commit/f7e07840d725f2ebb469129cb5e6574ce61725ef
msg296052 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-06-15 00:24
I don't think that the test_pydoc failure is very important. I'm not interested to fix it right now.

The main blocker issue was regrtest and it's now fixed in the master branch.

I don't recall any user complaining about issues with read-only source tree, so I don't think that it's worth it to backport the fix. If I'm wrong, please comment the issue ;-)
msg296186 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-06-16 12:39
New changeset a0ccc54e6dffacf9e7c06f2a3e9056d2d35d21eb by Victor Stinner in branch '3.6':
Synchronize libregrtest from master to 3.6 (#2244)
https://github.com/python/cpython/commit/a0ccc54e6dffacf9e7c06f2a3e9056d2d35d21eb
History
Date User Action Args
2022-04-11 14:58:46adminsetgithub: 74470
2017-06-16 12:39:11vstinnersetmessages: + msg296186
2017-06-16 11:35:58vstinnersetpull_requests: + pull_request2289
2017-06-15 00:24:18vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg296052

stage: resolved
2017-06-14 22:44:07vstinnersetmessages: + msg296044
2017-05-05 17:00:21vstinnersetmessages: + msg293126
2017-05-05 16:59:15vstinnersetmessages: + msg293125
2017-05-05 16:36:52vstinnersetpull_requests: + pull_request1581
2017-05-05 16:27:44vstinnersetnosy: + cstratak
2017-05-05 16:27:13vstinnercreate