classification
Title: 6 tests fail using SOURCE_DATE_EPOCH env var
Type: Stage: resolved
Components: Tests Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Elvis.Pranskevichus, benjamin.peterson, doko, eschwartz, mcepl, miss-islington, serhiy.storchaka, thehesiod, vstinner, yan12125
Priority: normal Keywords: patch

Created on 2018-07-02 12:18 by vstinner, last changed 2018-11-29 00:11 by vstinner. This issue is now closed.

Files
File name Uploaded Description Edit
osc-build-log.txt mcepl, 2018-07-02 22:46
Pull Requests
URL Status Linked Edit
PR 9484 closed Elvis.Pranskevichus, 2018-09-21 22:37
PR 9607 merged Elvis.Pranskevichus, 2018-09-27 17:19
PR 10327 merged Elvis.Pranskevichus, 2018-11-04 23:20
PR 10775 merged miss-islington, 2018-11-28 17:19
Messages (35)
msg320875 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-07-02 12:18
https://build.opensuse.org/package/show/home:mcepl:work/python3

6 tests failed:
    test_cmd_line_script test_compileall test_importlib
    test_multiprocessing_main_handling test_py_compile test_runpy

======================================================================
ERROR: test_zipfile_compiled (test.test_runpy.RunPathTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/runpy.py", line 153, in _get_module_details
    code = loader.get_code(mod_name)
zipimport.ZipImportError: can't find module '__main__'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/runpy.py", line 219, in _get_main_module_details
    return _get_module_details(main_name)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/runpy.py", line 155, in _get_module_details
    raise error(format(e)) from e
ImportError: can't find module '__main__'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_runpy.py", line 715, in test_zipfile_compiled
    mod_name=mod_name, check_loader=False)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_runpy.py", line 631, in _check_script
    self.check_code_execution(create_ns, expected_ns)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_runpy.py", line 130, in check_code_execution
    result_ns = create_namespace(None)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_runpy.py", line 606, in create_ns
    return run_path(script_name, init_globals)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/runpy.py", line 275, in run_path
    mod_name, mod_spec, code = _get_main_module_details()
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/runpy.py", line 223, in _get_main_module_details
    (main_name, sys.path[0])) from exc
ImportError: can't find '__main__' module in '/tmp/tmp40k8q99u/test_zip.zip'

======================================================================
FAIL: test_zipfile_compiled (test.test_cmd_line_script.CmdLineTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_cmd_line_script.py", line 268, in test_zipfile_compiled
    zipimport.zipimporter)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_cmd_line_script.py", line 129, in _check_script
    *run_args, __isolated=False, __cwd=cwd, **env_vars
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/support/script_helper.py", line 157, in assert_python_ok
    return _assert_python(True, *args, **env_vars)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/support/script_helper.py", line 143, in _assert_python
    res.fail(cmd_line)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/support/script_helper.py", line 84, in fail
    err))
AssertionError: Process return code is 1
command line: ['/home/abuild/rpmbuild/BUILD/Python-3.7.0/python', '-X', 'faulthandler', '-E', '/tmp/tmpwlsj3czm/test_zip.zip', 'test1', 'test2', 'test3']

stdout:
---

---

stderr:
---
/home/abuild/rpmbuild/BUILD/Python-3.7.0/python: can't find '__main__' module in '/tmp/tmpwlsj3czm/test_zip.zip'
---

======================================================================
FAIL: test_overiden_unchecked_hash_based_pyc (test.test_importlib.source.test_file_loader.Frozen_SimpleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_importlib/util.py", line 303, in wrapper
    to_return = fxn(*args, **kwargs)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_importlib/source/test_file_loader.py", line 349, in test_overiden_unchecked_hash_based_pyc
    self.assertEqual(int.from_bytes(data[4:8], 'little'), 0b1)
AssertionError: 3 != 1

======================================================================
FAIL: test_unchecked_hash_based_pyc (test.test_importlib.source.test_file_loader.Frozen_SimpleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_importlib/util.py", line 303, in wrapper
    to_return = fxn(*args, **kwargs)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_importlib/source/test_file_loader.py", line 315, in test_unchecked_hash_based_pyc
    self.assertEqual(mod.state, 'old')
AssertionError: 'new' != 'old'
- new
+ old


======================================================================
FAIL: test_old_timestamp (test.test_importlib.source.test_file_loader.Frozen_SourceLoaderBadBytecodeTestPEP302)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_importlib/util.py", line 303, in wrapper
    to_return = fxn(*args, **kwargs)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_importlib/source/test_file_loader.py", line 635, in test_old_timestamp
    self.assertEqual(bytecode_file.read(4), source_timestamp)
AssertionError: b'\xf0%\x1e8' != b'\xe2L6['

======================================================================
FAIL: test_old_timestamp (test.test_importlib.source.test_file_loader.Frozen_SourceLoaderBadBytecodeTestPEP451)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_importlib/util.py", line 303, in wrapper
    to_return = fxn(*args, **kwargs)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_importlib/source/test_file_loader.py", line 635, in test_old_timestamp
    self.assertEqual(bytecode_file.read(4), source_timestamp)
AssertionError: b'\xf0%\x1e8' != b'\xe2L6['

======================================================================
FAIL: test_overiden_unchecked_hash_based_pyc (test.test_importlib.source.test_file_loader.Source_SimpleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_importlib/util.py", line 303, in wrapper
    to_return = fxn(*args, **kwargs)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_importlib/source/test_file_loader.py", line 349, in test_overiden_unchecked_hash_based_pyc
    self.assertEqual(int.from_bytes(data[4:8], 'little'), 0b1)
AssertionError: 3 != 1

======================================================================
FAIL: test_unchecked_hash_based_pyc (test.test_importlib.source.test_file_loader.Source_SimpleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_importlib/util.py", line 303, in wrapper
    to_return = fxn(*args, **kwargs)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_importlib/source/test_file_loader.py", line 315, in test_unchecked_hash_based_pyc
    self.assertEqual(mod.state, 'old')
AssertionError: 'new' != 'old'
- new
+ old


======================================================================
FAIL: test_old_timestamp (test.test_importlib.source.test_file_loader.Source_SourceLoaderBadBytecodeTestPEP302)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_importlib/util.py", line 303, in wrapper
    to_return = fxn(*args, **kwargs)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_importlib/source/test_file_loader.py", line 635, in test_old_timestamp
    self.assertEqual(bytecode_file.read(4), source_timestamp)
AssertionError: b'\xf0%\x1e8' != b'\xe2L6['

======================================================================
FAIL: test_old_timestamp (test.test_importlib.source.test_file_loader.Source_SourceLoaderBadBytecodeTestPEP451)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_importlib/util.py", line 303, in wrapper
    to_return = fxn(*args, **kwargs)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_importlib/source/test_file_loader.py", line 635, in test_old_timestamp
    self.assertEqual(bytecode_file.read(4), source_timestamp)
AssertionError: b'\xf0%\x1e8' != b'\xe2L6['

======================================================================
FAIL: test_zipfile_compiled (test.test_multiprocessing_main_handling.ForkCmdLineTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_multiprocessing_main_handling.py", line 225, in test_zipfile_compiled
    self._check_script(zip_name)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_multiprocessing_main_handling.py", line 156, in _check_script
    rc, out, err = assert_python_ok(*run_args, __isolated=False)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/support/script_helper.py", line 157, in assert_python_ok
    return _assert_python(True, *args, **env_vars)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/support/script_helper.py", line 143, in _assert_python
    res.fail(cmd_line)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/support/script_helper.py", line 84, in fail
    err))
AssertionError: Process return code is 1
command line: ['/home/abuild/rpmbuild/BUILD/Python-3.7.0/python', '-X', 'faulthandler', '-E', '/tmp/tmpjsax7ksh/test_zip.zip', 'fork']

stdout:
---

---

stderr:
---
/home/abuild/rpmbuild/BUILD/Python-3.7.0/python: can't find '__main__' module in '/tmp/tmpjsax7ksh/test_zip.zip'
---

======================================================================
FAIL: test_zipfile_compiled (test.test_multiprocessing_main_handling.ForkServerCmdLineTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_multiprocessing_main_handling.py", line 225, in test_zipfile_compiled
    self._check_script(zip_name)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_multiprocessing_main_handling.py", line 156, in _check_script
    rc, out, err = assert_python_ok(*run_args, __isolated=False)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/support/script_helper.py", line 157, in assert_python_ok
    return _assert_python(True, *args, **env_vars)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/support/script_helper.py", line 143, in _assert_python
    res.fail(cmd_line)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/support/script_helper.py", line 84, in fail
    err))
AssertionError: Process return code is 1
command line: ['/home/abuild/rpmbuild/BUILD/Python-3.7.0/python', '-X', 'faulthandler', '-E', '/tmp/tmp50n_prgl/test_zip.zip', 'forkserver']

stdout:
---

---

stderr:
---
/home/abuild/rpmbuild/BUILD/Python-3.7.0/python: can't find '__main__' module in '/tmp/tmp50n_prgl/test_zip.zip'
---

======================================================================
FAIL: test_zipfile_compiled (test.test_multiprocessing_main_handling.SpawnCmdLineTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_multiprocessing_main_handling.py", line 225, in test_zipfile_compiled
    self._check_script(zip_name)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_multiprocessing_main_handling.py", line 156, in _check_script
    rc, out, err = assert_python_ok(*run_args, __isolated=False)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/support/script_helper.py", line 157, in assert_python_ok
    return _assert_python(True, *args, **env_vars)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/support/script_helper.py", line 143, in _assert_python
    res.fail(cmd_line)
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/support/script_helper.py", line 84, in fail
    err))
AssertionError: Process return code is 1
command line: ['/home/abuild/rpmbuild/BUILD/Python-3.7.0/python', '-X', 'faulthandler', '-E', '/tmp/tmp1npoq9bq/test_zip.zip', 'spawn']

stdout:
---

---

stderr:
---
/home/abuild/rpmbuild/BUILD/Python-3.7.0/python: can't find '__main__' module in '/tmp/tmp1npoq9bq/test_zip.zip'
---

======================================================================
FAIL: test_invalidation_mode (test.test_py_compile.PyCompileTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_py_compile.py", line 153, in test_invalidation_mode
    self.assertEqual(flags, 0b1)
AssertionError: 3 != 1

----------------------------------------------------------------------

======================================================================
FAIL: test_force (test.test_compileall.CommandLineTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_compileall.py", line 365, in test_force
    self.assertEqual(mtime, mtime2)
AssertionError: 1530285241.0427392 != 1530285301.18

======================================================================
FAIL: test_no_args_respects_force_flag (test.test_compileall.CommandLineTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_compileall.py", line 299, in test_no_args_respects_force_flag
    self.assertEqual(mtime, mtime2)
AssertionError: 1530285243.012693 != 1530285303.168

======================================================================
FAIL: test_pyc_invalidation_mode (test.test_compileall.CommandLineTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_compileall.py", line 533, in test_pyc_invalidation_mode
    self.assertEqual(int.from_bytes(data[4:8], 'little'), 0b01)
AssertionError: 3 != 1

======================================================================
FAIL: test_magic_number (test.test_compileall.CompileallTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_compileall.py", line 78, in test_magic_number
    self.recreation_check(b'\0\0\0\0')
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_compileall.py", line 61, in recreation_check
    self.assertEqual(*self.data())
AssertionError: b'B\r\r\n\x03\x00\x00\x00\\s\xa0J' != b'B\r\r\n\x00\x00\x00\x00\xfaL6['

======================================================================
FAIL: test_mtime (test.test_compileall.CompileallTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_compileall.py", line 74, in test_mtime
    0, 1))
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_compileall.py", line 61, in recreation_check
    self.assertEqual(*self.data())
AssertionError: b'B\r\r\n\x03\x00\x00\x00\\s\xa0J' != b'B\r\r\n\x00\x00\x00\x00\xfaL6['
msg320876 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-07-02 12:20
It seems like the same (or similar? I didn't check) tests fail on Debian:

https://buildd.debian.org/status/fetch.php?pkg=python3.7&arch=amd64&ver=3.7.0-1&stamp=1530136859&raw=0
msg320877 - (view) Author: Matej Cepl (mcepl) * Date: 2018-07-02 12:21
I would add that Debian doesn't seem to fare that much better ... https://buildd.debian.org/status/fetch.php?pkg=python3.7&arch=amd64&ver=3.7.0-1&stamp=1530136859&raw=0
msg320885 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-07-02 13:47
I'm unable to reproduce the issue on Fedora using the same configure command:

$ ./configure --host=x86_64-suse-linux-gnu --build=x86_64-suse-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/lib --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --docdir=/usr/share/doc/packages/python --enable-ipv6 --with-fpectl --enable-shared --with-ensurepip=no --with-system-ffi --with-system-expat --with-lto --enable-loadable-sqlite-extensions
$ make
$ LD_LIBRARY_PATH=$PWD ./python -m test -j0  test_cmd_line_script test_compileall test_importlib  test_multiprocessing_main_handling test_py_compile test_runpy
...
All 6 tests OK.
...
Tests result: SUCCESS
msg320886 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-07-02 13:57
Thread on python-dev:
"[Python-Dev] Failing tests [Was: Re: Python 3.7.0 is now available! (and so is 3.6.6)]"
https://mail.python.org/pipermail/python-dev/2018-July/154208.html

My reply:
https://mail.python.org/pipermail/python-dev/2018-July/154224.html

Extract:

"""
I'm running the Python test suite every day on Fedora and all tests
pass. We also run tests multiple times per day on Travis CI (Ubuntu)
and buildbots (Debian, Gentoo, RHEL, SLES).

Wait, there is a SLES buildbot and all tests pass except of
test_gdb.test_threads(). SLES is OpenSUSE no?

The Debian buildbot is green on all branches.
"""
msg320892 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-07-02 15:20
I also ran the Python test suite on Debian sid using the master branch of Python and all tests pass:
---
$ ./configure --prefix=/usr --enable-ipv6 --enable-loadable-sqlite-extensions --with-dbmliborder=bdb:gdbm --with-computed-gotos --without-ensurepip --with-system-expat --with-system-libmpdec  --with-system-ffi
$ make
$ LD_LIBRARY_PATH=$PWD ./python -m test -j0 test_cmd_line_script test_compileall test_importlib test_multiprocessing_main_handling test_py_compile test_runpy

All 6 tests OK.
---

I also ran the full test suite on Debian Stretch: again, all tests passed.

Maybe the package builder use a custom configuration or patches? Or issues are specific to Python 3.7? (again, I tested the master branch)
msg320894 - (view) Author: Matej Cepl (mcepl) * Date: 2018-07-02 15:46
Hmm, what about version of gcc? I suspect some troubles could be caused by gcc version 8 (we have in openSUSE), or LTO option switched on?
msg320895 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-07-02 15:47
> Hmm, what about version of gcc? I suspect some troubles could be caused by gcc version 8 (we have in openSUSE), or LTO option switched on?

For my tests on Fedora, I used gcc 8.1.1. I used the OpenSUSE configure command which includes --with-lto.
msg320903 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-07-02 17:40
I built and ran these tests using commands from msg320892 on openSUSE Leap 42.3, and all tests are passed.
msg320919 - (view) Author: Matej Cepl (mcepl) * Date: 2018-07-02 22:46
It's somehow complicated, in the build chroot I can make tests run only with LD_LIBRARY_PATH set to $(readlink -f Python-3.7.0) and PYTHONPATH to Lib directory. However, then the set of failed tests changes. For example test_runpy runs without problems, but other fails:

5 tests failed:
    test_asyncio test_concurrent_futures test_gdb test_logging
    test_multiprocessing_main_handling

(complete log is attached)
msg320924 - (view) Author: Matej Cepl (mcepl) * Date: 2018-07-02 23:01
Yes, it must be something in the chroot, because when run in the plain command line, all tests as well on openSUSE Tumbleweed (with the latest updates).

393 tests OK.

1 test failed:
    test_epoll

21 tests skipped:
    test_ctypes test_devpoll test_idle test_kqueue test_msilib
    test_nis test_ossaudiodev test_smtpnet test_sqlite test_ssl
    test_startfile test_tcl test_tix test_tk test_ttk_guionly
    test_ttk_textonly test_turtle test_winconsoleio test_winreg
    test_winsound test_zipfile64

Re-running failed tests in verbose mode
Re-running test 'test_epoll' in verbose mode
test_add (test.test_epoll.TestEPoll) ... ok
test_badcreate (test.test_epoll.TestEPoll) ... ok
test_close (test.test_epoll.TestEPoll) ... ok
test_context_manager (test.test_epoll.TestEPoll) ... ok
test_control_and_wait (test.test_epoll.TestEPoll) ... ok
test_create (test.test_epoll.TestEPoll) ... ok
test_errors (test.test_epoll.TestEPoll) ... ok
test_fd_non_inheritable (test.test_epoll.TestEPoll) ... ok
test_fromfd (test.test_epoll.TestEPoll) ... ok
test_unregister_closed (test.test_epoll.TestEPoll) ... ok

----------------------------------------------------------------------
Ran 10 tests in 2.106s

OK

== Tests result: FAILURE then SUCCESS ==

393 tests OK.

21 tests skipped:
    test_ctypes test_devpoll test_idle test_kqueue test_msilib
    test_nis test_ossaudiodev test_smtpnet test_sqlite test_ssl
    test_startfile test_tcl test_tix test_tk test_ttk_guionly
    test_ttk_textonly test_turtle test_winconsoleio test_winreg
    test_winsound test_zipfile64

1 re-run test:
    test_epoll
msg320937 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-07-03 07:16
> Yes, it must be something in the chroot, because when run in the plain command line, all tests as well on openSUSE Tumbleweed (with the latest updates).

Are you testing with patches? It may be interesting to try to get these patches upstream:

[   59s] Patch #1 (Python-3.0b1-record-rpm.patch):
[   59s] Patch #2 (python-3.6.0-multilib-new.patch):
[   59s] Patch #4 (python-3.3.0b1-localpath.patch):
[   59s] Patch #6 (python-3.3.0b1-fix_date_time_compiler.patch):
[   59s] Patch #7 (python-3.3.0b1-curses-panel.patch):
[   59s] Patch #9 (python-3.3.0b1-test-posix_fadvise.patch):
[   59s] Patch #12 (python-3.3.3-skip-distutils-test_sysconfig_module.patch):
[   59s] Patch #15 (subprocess-raise-timeout.patch):
[   59s] Patch #22 (distutils-reproducible-compile.patch):

Some patches seem old. Are they still needed? Where can I find these patches? I'm interested by patches modifying site.py for example.
msg320938 - (view) Author: Matej Cepl (mcepl) * Date: 2018-07-03 07:29
> Are you testing with patches? It may be interesting to try to get these patches upstream:

Tested both and without patches, the same results. Everything in openSUSE is done in open (rather strikingly similar to RH openness, although things are even more simple, because so much is web accessible), so the official project for development of openSUSE python3 is https://build.opensuse.org/package/show/devel:languages:python:Factory/python3 all patches are there (from there I can make push request to the https://build.opensuse.org/package/show/openSUSE:Factory/python3 which is where openSUSE packages come from).
msg320939 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-07-03 07:36
> Are you testing with patches? It may be interesting to try to get these patches upstream: (...)

I applied manually these patches on 3.7: the 6 tests still pass.
msg320941 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-07-03 07:47
> Some patches seem old. Are they still needed? Where can I find these patches? I'm interested by patches modifying site.py for example.

I created PR 8057 to upstream distutils-reproducible-compile.patch.

Matej Cepl: Would you mind to try to find the original author of this patch file? I would like to credit them.
msg320943 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-07-03 08:10
FAIL: test_invalidation_mode (test.test_py_compile.PyCompileTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/abuild/rpmbuild/BUILD/Python-3.7.0/Lib/test/test_py_compile.py", line 153, in test_invalidation_mode
    self.assertEqual(flags, 0b1)
AssertionError: 3 != 1


This failure looks suspicious. I looked at the code, and the tested function behaves differently depending of the SOURCE_DATE_EPOCH environment variable is set.

Aha! I found something:

$ SOURCE_DATE_EPOCH=1530605018 ./python -m test -j0
...
6 tests failed:
    test_cmd_line_script test_compileall test_importlib
    test_multiprocessing_main_handling test_py_compile test_runpy
...
msg320944 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-07-03 08:11
See bpo-29708 and PEP 552 for more info about reproducible builds.
msg321068 - (view) Author: Matej Cepl (mcepl) * Date: 2018-07-04 23:11
From https://mail.python.org/pipermail/python-dev/2018-July/154273.html
(by Nick Coghlan):

In particular, if a build system sets SOURCE_DATE_EPOCH without
specifying a pyc format for py_compile or compileall, Python 3.7 will
give you checked hashes by default:
https://docs.python.org/3/library/py_compile.html?highlight=source_date_epoch#py_compile.compile
msg321853 - (view) Author: Alexander Mohr (thehesiod) * Date: 2018-07-17 22:21
we're compiling similar to debian and getting the same issues now only with 3.7 so interested in what the resolution is.  I tried both w/ and w/o setting SOURCE_DATE_EPOCH and still get failures.
msg326053 - (view) Author: Elvis Pranskevichus (Elvis.Pranskevichus) * (Python triager) Date: 2018-09-21 22:49
> In particular, if a build system sets SOURCE_DATE_EPOCH without
specifying a pyc format for py_compile or compileall, Python 3.7 will
give you checked hashes by default

Actually, py_compile will _force_ the CHECKED_HASH mode if SOURCE_DATE_EPOCH is set, regardless of what you specified for py_compile or compileall.  I'm not sure if that's actually intended or a bug.

The fix for the tests is to actually be aware of py_compile behavior and control for SOURCE_DATE_EPOCH.  I submitted a PR with a fix.
msg326054 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2018-09-21 22:51
I dislike that having SOURCE_DATE_EPOCH set magically changes command line tools behavior. In my view, this problem should be fixed by reverting ccbe5818af2.
msg326057 - (view) Author: Elvis Pranskevichus (Elvis.Pranskevichus) * (Python triager) Date: 2018-09-21 23:04
Perhaps SOURCE_DATE_EPOCH should only be consulted to determine the default behavior if invalidation_mode was not passed explicitly to py_compile.compile().
msg326578 - (view) Author: Elvis Pranskevichus (Elvis.Pranskevichus) * (Python triager) Date: 2018-09-27 18:04
https://github.com/python/cpython/pull/9607 turns SOURCE_DATE_EPOCH into a *default* rather than absolute override.

test_cmd_line_script and test_runpy fail due to the lack of support for hash-based .pycs in zipimport, which needs fixing also.
msg326638 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-09-28 14:20
> https://github.com/python/cpython/pull/9607 turns SOURCE_DATE_EPOCH into a *default* rather than absolute override.

Once we decided to merge or reject this PR, we should maybe update the PEP 552 to clarify the interaction with the SOURCE_DATE_EPOCH environment variable.
msg327479 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-10-10 16:43
New changeset a6b3ec5b6d4f6387820fccc570eea08b9615620d by Victor Stinner (Elvis Pranskevichus) in branch 'master':
bpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH (GH-9607)
https://github.com/python/cpython/commit/a6b3ec5b6d4f6387820fccc570eea08b9615620d
msg327828 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-10-16 13:29
There are still tests which fail when SOURCE_DATE_EPOCH env var is defined:

$ SOURCE_DATE_EPOCH=0 ./python -m test -j0 -r
(...)
3 tests failed:
    test_cmd_line_script test_multiprocessing_main_handling test_runpy
(...)
msg329275 - (view) Author: Elvis Pranskevichus (Elvis.Pranskevichus) * (Python triager) Date: 2018-11-04 23:27
https://github.com/python/cpython/pull/10327 fixes the remaining test failures.
msg330499 - (view) Author: Chih-Hsuan Yen (yan12125) * Date: 2018-11-27 09:47
As https://github.com/python/cpython/pull/10327 has been merged, I think this issue can be closed?
msg330508 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-27 11:39
> As https://github.com/python/cpython/pull/10327 has been merged, I think this issue can be closed?

The Versions field of this issue is set to Python 3.7, but 7 tests are failing with:

$ SOURCE_DATE_EPOCH=0 ./python -m test -j0 -r -u all,-gui
(...)
7 tests failed:
    test_cmd_line_script test_compileall test_importlib
    test_multiprocessing_main_handling test_posix test_py_compile
    test_runpy

Note: the full test suite pass with SOURCE_DATE_EPOCH=0 on master.
msg330523 - (view) Author: Chih-Hsuan Yen (yan12125) * Date: 2018-11-27 14:20
Looks like in https://github.com/python/cpython/pull/10327, Serhiy Storchaka considers fixing these issues for 3.8 only - "It is easier to skip the test on 3.7." and then remove the "needs backport to 3.7" label. How about changing the target version to 3.8 only and close this issue?
msg330524 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-27 14:21
"What’s New In Python 3.7" mentions twice "build reproducibility":
https://docs.python.org/dev/whatsnew/3.7.html
msg330525 - (view) Author: Chih-Hsuan Yen (yan12125) * Date: 2018-11-27 14:32
Got it. Thanks for the pointer.
msg330619 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-28 17:26
test_compileall, test_importlib, test_py_compile: I created https://github.com/python/cpython/pull/10775 backport.

test_cmd_line_script, test_runpy and test_multiprocessing_main_handling failures are related to zipimport. They have been fixed in master by commit a6e956bcb0edbfe7f18af9be2215a5326ea6bf05 which modifies Lib/zipimport.py... but in 3.7, zipimport is written in C. It seems non-trivial to fix zipimport, and I'm not sure that it's worth it.

Note: test_posix now pass, no idea why it failed a few days ago.
msg330622 - (view) Author: miss-islington (miss-islington) Date: 2018-11-28 17:45
New changeset 24b51b1a4919e310d338629cc60371387f475a32 by Miss Islington (bot) in branch '3.7':
bpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH (GH-9607)
https://github.com/python/cpython/commit/24b51b1a4919e310d338629cc60371387f475a32
msg330640 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-29 00:11
> New changeset 24b51b1a4919e310d338629cc60371387f475a32 by Miss Islington (bot) in branch '3.7':

With this change, only 3 tests fail on 3.7, and all these 3 fail because of zipimport: test_cmd_line_script, test_multiprocessing_main_handling and test_runpy.

Chih-Hsuan Yen:
> Looks like in https://github.com/python/cpython/pull/10327, Serhiy Storchaka considers fixing these issues for 3.8 only - "It is easier to skip the test on 3.7." and then remove the "needs backport to 3.7" label. How about changing the target version to 3.8 only and close this issue?

Now I agree to close the issue :-)

I'm ok to not fix zipimport in 3.7.

Anyway, it's not like Python is perfect in the master branch: frozenset in marshal is still not reproducible. See bpo-29708.
History
Date User Action Args
2018-11-29 00:11:53vstinnersetstatus: open -> closed
versions: + Python 3.8
messages: + msg330640

resolution: fixed
stage: patch review -> resolved
2018-11-28 17:45:40miss-islingtonsetnosy: + miss-islington
messages: + msg330622
2018-11-28 17:26:41vstinnersetmessages: + msg330619
2018-11-28 17:19:03miss-islingtonsetpull_requests: + pull_request10018
2018-11-27 14:32:16yan12125setmessages: + msg330525
2018-11-27 14:21:26vstinnersetmessages: + msg330524
2018-11-27 14:20:00yan12125setmessages: + msg330523
2018-11-27 11:39:05vstinnersetmessages: + msg330508
2018-11-27 09:47:40yan12125setmessages: + msg330499
2018-11-04 23:27:34Elvis.Pranskevichussetmessages: + msg329275
2018-11-04 23:20:54Elvis.Pranskevichussetpull_requests: + pull_request9630
2018-10-16 13:29:09vstinnersetmessages: + msg327828
2018-10-10 16:43:20vstinnersetmessages: + msg327479
2018-09-28 14:20:48vstinnersetmessages: + msg326638
2018-09-27 18:04:44Elvis.Pranskevichussetmessages: + msg326578
2018-09-27 17:19:45Elvis.Pranskevichussetpull_requests: + pull_request9004
2018-09-26 19:53:20eschwartzsetnosy: + eschwartz
2018-09-21 23:04:46Elvis.Pranskevichussetmessages: + msg326057
2018-09-21 22:51:20benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg326054
2018-09-21 22:49:10Elvis.Pranskevichussetnosy: + Elvis.Pranskevichus
messages: + msg326053
2018-09-21 22:37:30Elvis.Pranskevichussetkeywords: + patch
stage: patch review
pull_requests: + pull_request8894
2018-08-03 07:33:47yan12125setnosy: + yan12125
2018-07-17 22:21:47thehesiodsetnosy: + thehesiod
messages: + msg321853
2018-07-04 23:11:45mceplsetmessages: + msg321068
2018-07-03 08:11:08vstinnersetmessages: + msg320944
2018-07-03 08:10:24vstinnersetmessages: + msg320943
title: Python 3.7: 6 tests failed on OpenSUSE and Debian -> 6 tests fail using SOURCE_DATE_EPOCH env var
2018-07-03 07:47:58vstinnersetmessages: + msg320941
2018-07-03 07:36:02vstinnersetmessages: + msg320939
2018-07-03 07:29:50mceplsetmessages: + msg320938
2018-07-03 07:16:00vstinnersetmessages: + msg320937
2018-07-02 23:01:28mceplsetmessages: + msg320924
2018-07-02 22:46:41mceplsetfiles: + osc-build-log.txt

messages: + msg320919
2018-07-02 17:40:46serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg320903
2018-07-02 15:47:46vstinnersetmessages: + msg320895
2018-07-02 15:46:12mceplsetmessages: + msg320894
2018-07-02 15:20:16vstinnersettitle: Python 3.7: 6 tests failed on OpenSUSE -> Python 3.7: 6 tests failed on OpenSUSE and Debian
2018-07-02 15:20:09vstinnersetmessages: + msg320892
2018-07-02 13:57:14vstinnersetmessages: + msg320886
2018-07-02 13:52:07ned.deilysetnosy: + doko
2018-07-02 13:47:08vstinnersetmessages: + msg320885
2018-07-02 12:21:39mceplsetnosy: + mcepl
messages: + msg320877
2018-07-02 12:20:23vstinnersetmessages: + msg320876
2018-07-02 12:18:35vstinnercreate