Skip to content

test_tools: test_freeze_simple_script() fails on s390x SLES 3.x: [Errno 2] No such file or directory: (...) #109615

Description

@vstinner

s390x SLES 3.x:

test_freeze_simple_script (test.test_tools.test_freeze.TestFreeze.test_freeze_simple_script) ... ERROR

Stdout:
creating the script to be frozen at /tmp/test_python_3vf4i07o/tmp7pw_cxg6/app.py
copying the source tree into /tmp/test_python_3vf4i07o/tmp7pw_cxg6/cpython...

(...)

======================================================================
ERROR: test_freeze_simple_script (test.test_tools.test_freeze.TestFreeze.test_freeze_simple_script)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/test/test_tools/test_freeze.py", line 32, in test_freeze_simple_script
    outdir, scriptfile, python = helper.prepare(script, outdir)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Tools/freeze/test/freeze.py", line 146, in prepare
    copy_source_tree(srcdir, SRCDIR)
  File "/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Tools/freeze/test/freeze.py", line 95, in copy_source_tree
    shutil.copytree(oldroot, newroot, ignore=ignore_non_src)
  File "/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/shutil.py", line 588, in copytree
    return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/shutil.py", line 542, in _copytree
    raise Error(errors)
shutil.Error: [('/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/build/test_python_29475æ', '/tmp/test_python_3vf4i07o/tmp7pw_cxg6/cpython/build/test_python_29475æ', "[Errno 2] No such file or directory: '/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/build/test_python_29475æ'")]

Stdout:
creating the script to be frozen at /tmp/test_python_3vf4i07o/tmp7pw_cxg6/app.py
copying the source tree into /tmp/test_python_3vf4i07o/tmp7pw_cxg6/cpython...

----------------------------------------------------------------------
Ran 36 tests in 7.203s

FAILED (errors=1)
test test_tools failed

build: https://buildbot.python.org/all/#/builders/540/builds/6583

Linked PRs

Activity

  1. vstinner commented on Sep 21, 2023

    @vstinner
    MemberAuthor

    The test fails also on s390x Debian 3.x: https://buildbot.python.org/all/#builders/49/builds/6610

  2. serhiy-storchaka commented on Sep 26, 2023

    @serhiy-storchaka
    Member

    It tries to copy the source tree from /home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/build/test_python_29475æ, but the correct path is /home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/.

  3. vstinner commented on Sep 26, 2023

    @vstinner
    MemberAuthor

    build: https://buildbot.python.org/all/#/builders/540/builds/6583

    • Git was run in directory: /home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build.

    • configure command: ./configure --prefix '$(PWD)/target' --with-pydebug

    • test.pythoninfo:

      • sysconfig[abs_builddir]: /home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build
      • sysconfig[srcdir]: /home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build
    • Tests are run in directory: /home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/build/test_python_worker_8799æ

    Tools/freeze/freeze.py computes:

    SRCDIR = os.path.dirname(os.path.dirname(TOOL_ROOT))

    It tries to copy the source tree from /home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/build/test_python_29475æ, but the correct path is /home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/.

    Oh. Maybe the code defining SRCDIR is wrong.

  4. added a commit that references this issue on Sep 26, 2023
  5. vstinner commented on Sep 26, 2023

    @vstinner
    MemberAuthor

    I proposed PR #109935 to fix the issue. I'm not sure yet if my fix is correct.

  6. added a commit that references this issue on Sep 27, 2023
  7. vstinner commented on Sep 27, 2023

    @vstinner
    MemberAuthor

    It seems like freeze copy_source_tree() copies build/ directory which is modified by other tests running in parallel. So it's likely that the copy can fail. I updated my PR #109935 to ignore this directory in the copy. Recently, I fixed a similar issue in venv with __pycache__/ directories: see issue gh-109748.

  8. added 7 commits that reference this issue on Sep 27, 2023
  9. 18 remaining items

  10. added a commit that references this issue on Sep 29, 2023
  11. zooba commented on Sep 29, 2023

    @zooba
    Member

    There's a few fixes here waiting on 3.12 branch to open up before they'll be merged, so I'm leaving this open until they're done.

  12. added a commit that references this issue on Sep 29, 2023
  13. added a commit that references this issue on Oct 2, 2023
  14. added 4 commits that reference this issue on Oct 4, 2023
  15. vstinner commented on Oct 17, 2023

    @vstinner
    MemberAuthor

    Ok, all changes should now be backported. I close the issue.

  16. added 4 commits that reference this issue on Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dir

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions