NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.35k stars 13.58k forks source link

python38Packages.scikit-build: tests fail on python 3.8 #83305

Closed drewrisinger closed 4 years ago

drewrisinger commented 4 years ago

Describe the bug python38Packages.scikit-build build fails on python3.8 due to test failures (see below)

To Reproduce Steps to reproduce the behavior:

  1. On branch: nixpkgs/master:
  2. nix-build -A python38Packages.scikit-build

Expected behavior scikit-build should build properly

Test Summary

Test Failures ``` =================================== FAILURES =================================== ____________________________ test_invalid_generator ____________________________ mocker = capfd = <_pytest.capture.CaptureFixture object at 0x7ffff4fed6d0> def test_invalid_generator(mocker, capfd): platform = get_platform() mocker.patch.object(type(platform), 'default_generators', new_callable=mocker.PropertyMock, return_value=[CMakeGenerator('Invalid')]) mocker.patch('skbuild.cmaker.get_platform', return_value=platform) with push_dir(), push_env(CMAKE_GENERATOR=None): @project_setup_py_test("hello-no-language", ["build"]) def should_fail(): pass failed = False message = "" try: > should_fail() tests/test_broken_project.py:166: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/__init__.py:269: in wrapped with execute_setup_py(wrapped.tmp_dir, wrapped.setup_args, disable_languages_test=disable_languages_test): /nix/store/k82p3h05vbca3k5f1in5iavgbqxq03bm-python3-3.8.2/lib/python3.8/contextlib.py:113: in __enter__ return next(self.gen) tests/__init__.py:251: in execute_setup_py six.exec_(setup_code) setup.py:3: in ??? skbuild/setuptools_wrap.py:570: in setup env = cmkr.configure(cmake_args, skbuild/cmaker.py:172: in configure generator = self.platform.get_best_generator( skbuild/platform_specifics/abstract.py:144: in get_best_generator installation_help=self.generator_installation_help) skbuild/platform_specifics/linux.py:48: in generator_installation_help distribution_name, cmd = self.build_essential_install_cmd() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ @staticmethod def build_essential_install_cmd(): """Return a tuple of the form ``(distribution_name, cmd)``. ``cmd`` is the command allowing to install the build tools in the current Linux distribution. It set to an empty string if the command is not known. ``distribution_name`` is the name of the current distribution. It is set to an empty string if the distribution could not be determined. """ # gentoo, slackware: Compiler is available by default. > distribution_name = platform.linux_distribution()[0] E AttributeError: module 'platform' has no attribute 'linux_distribution' skbuild/platform_specifics/linux.py:27: AttributeError ----------------------------- Captured stdout call ----------------------------- Initialized empty Git repository in /build/pytest-of-nixbld/pytest-6/should_fail0/.git/ [master (root-commit) 828d149] Initial commit 2 files changed, 14 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 setup.py -------------------------------------------------------------------------------- -- Trying "Invalid" generator -------------------------------- --------------------------- ---------------------- ----------------- ------------ ------- -- -- ------- ------------ ----------------- ---------------------- --------------------------- -------------------------------- -- Trying "Invalid" generator - failure -------------------------------------------------------------------------------- ----------------------------- Captured stderr call ----------------------------- CMake Error: Could not create named generator Invalid Generators * Unix Makefiles = Generates standard UNIX makefiles. Green Hills MULTI = Generates Green Hills MULTI files (experimental, work-in-progress). Ninja = Generates build.ninja files. Watcom WMake = Generates Watcom WMake makefiles. CodeBlocks - Ninja = Generates CodeBlocks project files. CodeBlocks - Unix Makefiles = Generates CodeBlocks project files. CodeLite - Ninja = Generates CodeLite project files. CodeLite - Unix Makefiles = Generates CodeLite project files. Sublime Text 2 - Ninja = Generates Sublime Text 2 project files. Sublime Text 2 - Unix Makefiles = Generates Sublime Text 2 project files. Kate - Ninja = Generates Kate project files. Kate - Unix Makefiles = Generates Kate project files. Eclipse CDT4 - Ninja = Generates Eclipse CDT 4.0 project files. Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files. ___________________ test_invalid_generator[generator_args0] ____________________ generator_args = ['-G', 'invalid'] @pytest.mark.parametrize( "generator_args", [ ["-G", "invalid"], ["--", "-G", "invalid"], ] ) def test_invalid_generator(generator_args): with push_dir(): build_args = ["build"] build_args.extend(generator_args) @project_setup_py_test("hello-no-language", build_args, disable_languages_test=True) def run(): pass failed = False message = "" try: > run() tests/test_skbuild.py:166: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/__init__.py:269: in wrapped with execute_setup_py(wrapped.tmp_dir, wrapped.setup_args, disable_languages_test=disable_languages_test): /nix/store/k82p3h05vbca3k5f1in5iavgbqxq03bm-python3-3.8.2/lib/python3.8/contextlib.py:113: in __enter__ return next(self.gen) tests/__init__.py:248: in execute_setup_py six.exec_(setup_code) setup.py:3: in ??? skbuild/setuptools_wrap.py:570: in setup env = cmkr.configure(cmake_args, skbuild/cmaker.py:172: in configure generator = self.platform.get_best_generator( skbuild/platform_specifics/abstract.py:144: in get_best_generator installation_help=self.generator_installation_help) skbuild/platform_specifics/linux.py:48: in generator_installation_help distribution_name, cmd = self.build_essential_install_cmd() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ @staticmethod def build_essential_install_cmd(): """Return a tuple of the form ``(distribution_name, cmd)``. ``cmd`` is the command allowing to install the build tools in the current Linux distribution. It set to an empty string if the command is not known. ``distribution_name`` is the name of the current distribution. It is set to an empty string if the distribution could not be determined. """ # gentoo, slackware: Compiler is available by default. > distribution_name = platform.linux_distribution()[0] E AttributeError: module 'platform' has no attribute 'linux_distribution' skbuild/platform_specifics/linux.py:27: AttributeError ----------------------------- Captured stdout call ----------------------------- Initialized empty Git repository in /build/pytest-of-nixbld/pytest-148/run0/.git/ [master (root-commit) 92355ed] Initial commit 2 files changed, 14 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 setup.py -------------------------------------------------------------------------------- -- Trying "invalid" generator -------------------------------- --------------------------- ---------------------- ----------------- ------------ ------- -- -- ------- ------------ ----------------- ---------------------- --------------------------- -------------------------------- -- Trying "invalid" generator - failure -------------------------------------------------------------------------------- ----------------------------- Captured stderr call ----------------------------- CMake Error: Could not create named generator invalid Generators * Unix Makefiles = Generates standard UNIX makefiles. Green Hills MULTI = Generates Green Hills MULTI files (experimental, work-in-progress). Ninja = Generates build.ninja files. Watcom WMake = Generates Watcom WMake makefiles. CodeBlocks - Ninja = Generates CodeBlocks project files. CodeBlocks - Unix Makefiles = Generates CodeBlocks project files. CodeLite - Ninja = Generates CodeLite project files. CodeLite - Unix Makefiles = Generates CodeLite project files. Sublime Text 2 - Ninja = Generates Sublime Text 2 project files. Sublime Text 2 - Unix Makefiles = Generates Sublime Text 2 project files. Kate - Ninja = Generates Kate project files. Kate - Unix Makefiles = Generates Kate project files. Eclipse CDT4 - Ninja = Generates Eclipse CDT 4.0 project files. Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files. ___________________ test_invalid_generator[generator_args1] ____________________ generator_args = ['--', '-G', 'invalid'] @pytest.mark.parametrize( "generator_args", [ ["-G", "invalid"], ["--", "-G", "invalid"], ] ) def test_invalid_generator(generator_args): with push_dir(): build_args = ["build"] build_args.extend(generator_args) @project_setup_py_test("hello-no-language", build_args, disable_languages_test=True) def run(): pass failed = False message = "" try: > run() tests/test_skbuild.py:166: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/__init__.py:269: in wrapped with execute_setup_py(wrapped.tmp_dir, wrapped.setup_args, disable_languages_test=disable_languages_test): /nix/store/k82p3h05vbca3k5f1in5iavgbqxq03bm-python3-3.8.2/lib/python3.8/contextlib.py:113: in __enter__ return next(self.gen) tests/__init__.py:248: in execute_setup_py six.exec_(setup_code) setup.py:3: in ??? skbuild/setuptools_wrap.py:570: in setup env = cmkr.configure(cmake_args, skbuild/cmaker.py:172: in configure generator = self.platform.get_best_generator( skbuild/platform_specifics/abstract.py:144: in get_best_generator installation_help=self.generator_installation_help) skbuild/platform_specifics/linux.py:48: in generator_installation_help distribution_name, cmd = self.build_essential_install_cmd() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ @staticmethod def build_essential_install_cmd(): """Return a tuple of the form ``(distribution_name, cmd)``. ``cmd`` is the command allowing to install the build tools in the current Linux distribution. It set to an empty string if the command is not known. ``distribution_name`` is the name of the current distribution. It is set to an empty string if the distribution could not be determined. """ # gentoo, slackware: Compiler is available by default. > distribution_name = platform.linux_distribution()[0] E AttributeError: module 'platform' has no attribute 'linux_distribution' skbuild/platform_specifics/linux.py:27: AttributeError ----------------------------- Captured stdout call ----------------------------- Initialized empty Git repository in /build/pytest-of-nixbld/pytest-149/run0/.git/ [master (root-commit) 92355ed] Initial commit 2 files changed, 14 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 setup.py -------------------------------------------------------------------------------- -- Trying "invalid" generator -------------------------------- --------------------------- ---------------------- ----------------- ------------ ------- -- -- ------- ------------ ----------------- ---------------------- --------------------------- -------------------------------- -- Trying "invalid" generator - failure -------------------------------------------------------------------------------- ----------------------------- Captured stderr call ----------------------------- CMake Error: Could not create named generator invalid Generators * Unix Makefiles = Generates standard UNIX makefiles. Green Hills MULTI = Generates Green Hills MULTI files (experimental, work-in-progress). Ninja = Generates build.ninja files. Watcom WMake = Generates Watcom WMake makefiles. CodeBlocks - Ninja = Generates CodeBlocks project files. CodeBlocks - Unix Makefiles = Generates CodeBlocks project files. CodeLite - Ninja = Generates CodeLite project files. CodeLite - Unix Makefiles = Generates CodeLite project files. Sublime Text 2 - Ninja = Generates Sublime Text 2 project files. Sublime Text 2 - Unix Makefiles = Generates Sublime Text 2 project files. Kate - Ninja = Generates Kate project files. Kate - Unix Makefiles = Generates Kate project files. Eclipse CDT4 - Ninja = Generates Eclipse CDT 4.0 project files. Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files. ```

Additional context Trying to build pythonPackages.qiskit for #80662

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 5.3.0-42-generic, Ubuntu, 18.04.4 LTS (Bionic Beaver)`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.3`
 - channels(drew): `"nixpkgs-20.09pre217039.13e7a3e1127"`
 - nixpkgs: `/home/drew/.nix-defexpr/channels/nixpkgs`
drewrisinger commented 4 years ago

cc @FlorianFranzen (maintainer)

drewrisinger commented 4 years ago

Looks like failures are related to python3.8 deprecation of platform.linux_distribution(). https://github.com/scikit-build/scikit-build/pull/458 PR Incoming.