Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1728067

Summary: python-lit fails to build with Python 3.8
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-litAssignee: serge_sans_paille <sguelton>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: sguelton, tstellar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-19 17:10:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1686977, 1715016    

Description Miro Hrončok 2019-07-08 23:35:05 UTC
python-lit fails to build with Python 3.8.0b2.

+ /usr/bin/python3 setup.py test
warning: no files found matching 'TODO'
warning: no previously-included files matching '*pyc' found anywhere in distribution
warning: no previously-included files matching '*~' found anywhere in distribution
no previously-included directories found matching 'tests/Output'
no previously-included directories found matching 'tests/*/Output'
no previously-included directories found matching 'tests/*/*/Output'
no previously-included directories found matching 'tests/*/*/*/Output'
/builddir/build/BUILD/lit-0.8.0/lit/llvm/config.py:432: SyntaxWarning: invalid escape sequence \+
  (' clang\+\+ ', """\"*** Do not use 'clang++' in tests, use '%clangxx'. ***\""""))
Traceback (most recent call last):
  File "setup.py", line 12, in <module>
    setup(
  File "/usr/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib64/python3.8/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib64/python3.8/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.8/site-packages/setuptools/command/test.py", line 229, in run
    self.run_tests()
  File "/usr/lib/python3.8/site-packages/setuptools/command/test.py", line 247, in run_tests
    test = unittest.main(
  File "/usr/lib64/python3.8/unittest/main.py", line 100, in __init__
    self.parseArgs(argv)
  File "/usr/lib64/python3.8/unittest/main.py", line 124, in parseArgs
    self._do_discovery(argv[2:])
  File "/usr/lib64/python3.8/unittest/main.py", line 244, in _do_discovery
    self.createTests(from_discovery=True, Loader=Loader)
  File "/usr/lib64/python3.8/unittest/main.py", line 154, in createTests
    self.test = loader.discover(self.start, self.pattern, self.top)
  File "/usr/lib64/python3.8/unittest/loader.py", line 349, in discover
    tests = list(self._find_tests(start_dir, pattern))
  File "/usr/lib64/python3.8/unittest/loader.py", line 405, in _find_tests
    tests, should_recurse = self._find_test_path(
  File "/usr/lib64/python3.8/unittest/loader.py", line 483, in _find_test_path
    tests = self.loadTestsFromModule(package, pattern=pattern)
  File "/usr/lib/python3.8/site-packages/setuptools/command/test.py", line 55, in loadTestsFromModule
    tests.append(self.loadTestsFromName(submodule))
  File "/usr/lib64/python3.8/unittest/loader.py", line 191, in loadTestsFromName
    return self.loadTestsFromModule(obj)
  File "/usr/lib/python3.8/site-packages/setuptools/command/test.py", line 41, in loadTestsFromModule
    tests.append(TestLoader.loadTestsFromModule(self, module))
  File "/usr/lib64/python3.8/unittest/loader.py", line 124, in loadTestsFromModule
    tests.append(self.loadTestsFromTestCase(obj))
  File "/usr/lib64/python3.8/unittest/loader.py", line 93, in loadTestsFromTestCase
    loaded_suite = self.suiteClass(map(testCaseClass, testCaseNames))
  File "/usr/lib64/python3.8/unittest/suite.py", line 24, in __init__
    self.addTests(tests)
  File "/usr/lib64/python3.8/unittest/suite.py", line 57, in addTests
    for test in tests:
TypeError: __init__() missing 1 required positional argument: 'run'

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.8/fedora-rawhide-x86_64/00964954-python-lit/

For all our attempts to build python-lit with Python 3.8, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.8/package/python-lit/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.8:
https://copr.fedorainfracloud.org/coprs/g/python/python3.8/

Let us know here if you have any questions.

Comment 1 serge_sans_paille 2019-07-15 09:33:17 UTC
The bug is not reproducible with mock, even when following the instructions from https://copr.fedorainfracloud.org/coprs/g/python/python3.8/

Looks like the tests are not found under mock...

Comment 2 serge_sans_paille 2019-07-15 13:44:30 UTC
The %check test in lit spec file should be either removed (it currently tests nothing) or replaced by `lit.py tests` but in that case we should depend on llvm-test because of FileCheck. @tstellar, any thoughts?

Comment 3 Tom Stellard 2019-07-15 14:18:56 UTC
(In reply to serge_sans_paille from comment #2)
> The %check test in lit spec file should be either removed (it currently
> tests nothing) or replaced by `lit.py tests` but in that case we should
> depend on llvm-test because of FileCheck. @tstellar, any thoughts?

I think having it build depend on llvm-test to run lit.py tests should be fine.

Comment 4 serge_sans_paille 2019-07-15 15:07:47 UTC
Then we have the following dependency : llvm-test requires python3-lit that build-requires llvm-test. Isn't that an issue?

Comment 5 Tom Stellard 2019-07-15 15:15:01 UTC
(In reply to serge_sans_paille from comment #4)
> Then we have the following dependency : llvm-test requires python3-lit that
> build-requires llvm-test. Isn't that an issue?

I don't think it's a major issue, because llvm-lit (in theory) does not depend on a specific version of llvm-test.  The other alternative would be to not do any testing during RPM build time and add gating tests that run the llvm-test-suite or the tests in llvm-test.

Comment 6 Miro Hrončok 2019-07-15 15:57:28 UTC
You should probably add a bcond to bootstrap this problem.

%bcond_without check

...

%if %{with check}
BuildRequires: llvm-test
%endif

...

%if %{with check}
%check
...
%endif

Comment 7 serge_sans_paille 2019-07-16 08:09:39 UTC
@miro : can you confirm the srpm attached to that build https://koji.fedoraproject.org/koji/taskinfo?taskID=36283153 also works nice for py38?

Comment 8 Miro Hrončok 2019-07-16 08:16:46 UTC
Build was added to python3.8:
  https://copr.fedorainfracloud.org/coprs/build/972472

Comment 9 serge_sans_paille 2019-07-19 22:17:00 UTC
fixed by python-lit-0.8.0-3.fc31