[Bug 2111595] Re: FTBFS in questing: setup.cfg command 'build_java' has no such option 'minimum-java-release'

Benjamin Drung 2111595 at bugs.launchpad.net
Fri May 23 15:18:25 UTC 2025


That can be fixed by cherry-picking from upstream, but it needs more
changes:

```
=================================== FAILURES ===================================
___________________________ T.test_find_file_package ___________________________

self = <tests.integration.test_fileutils.T
testMethod=test_find_file_package>

    def test_find_file_package(self) -> None:
        """find_file_package()"""
        self.assertEqual(apport.fileutils.find_file_package("/bin/bash"), "bash")
>       self.assertEqual(apport.fileutils.find_file_package("/bin/cat"), "coreutils")
E       AssertionError: 'coreutils-from-gnu' != 'coreutils'
E       - coreutils-from-gnu
E       + coreutils

tests/integration/test_fileutils.py:152: AssertionError
___________________ T.test_get_dependencies_pre_depends_only ___________________

self = <tests.integration.test_packaging_apt_dpkg.T
testMethod=test_get_dependencies_pre_depends_only>

    def test_get_dependencies_pre_depends_only(self) -> None:
        """get_dependencies() on package with Pre-Depends only."""
        d = impl.get_dependencies("coreutils")
        self.assertGreaterEqual(len(d), 1)
>       self.assertIn("libc6", d)
E       AssertionError: 'libc6' not found in ['coreutils-from-gnu']

tests/integration/test_packaging_apt_dpkg.py:102: AssertionError
___________________________ T.test_get_file_package ____________________________

self = <tests.integration.test_packaging_apt_dpkg.T
testMethod=test_get_file_package>

    def test_get_file_package(self) -> None:
        """get_file_package() on installed files."""
        self.assertEqual(impl.get_file_package("/usr/bin/bash"), "bash")
>       self.assertEqual(impl.get_file_package("/usr/bin/cat"), "coreutils")
E       AssertionError: 'coreutils-from-gnu' != 'coreutils'
E       - coreutils-from-gnu
E       + coreutils

tests/integration/test_packaging_apt_dpkg.py:157: AssertionError
_____________________________ T.test_add_proc_info _____________________________

self = <tests.integration.test_report.T testMethod=test_add_proc_info>

    def test_add_proc_info(self) -> None:
        # TODO: Split into separate test cases
        # pylint: disable=too-many-statements
        """add_proc_info()."""
        # check without additional safe environment variables
        pr = apport.report.Report()
        self.assertIsNone(pr.pid)
        pr.add_proc_info()
        self.assertEqual(pr.pid, os.getpid())
        self.assertTrue(
            set(["ProcEnviron", "ProcMaps", "ProcCmdline", "ProcMaps"]).issubset(
                set(pr.keys())
            ),
            "report has required fields",
        )
        if "LANG" in os.environ:
            self.assertIn("LANG=" + os.environ["LANG"], pr["ProcEnviron"])
        else:
            self.assertNotIn("LANG=", pr["ProcEnviron"])
        self.assertNotIn("USER", pr["ProcEnviron"])
        self.assertNotIn("PWD", pr["ProcEnviron"])
        self.assertRegex(pr["ExecutablePath"], rf"^({re.escape(sys.argv[0])}|.*\.py)$")
        self.assertEqual(
            int(pr["ExecutableTimestamp"]), int(os.stat(pr["ExecutablePath"]).st_mtime)
        )
    
        # check with one additional safe environment variable
        pr = apport.report.Report()
        pr.add_proc_info(extraenv=["PWD"])
        self.assertNotIn("USER", pr["ProcEnviron"])
        if "PWD" in os.environ:
            self.assertIn("PWD=" + os.environ["PWD"], pr["ProcEnviron"])
    
        # check process from other user
        restore_root = False
        if os.getuid() == 0:
            # temporarily drop to normal user "mail"
            os.setresuid(8, 8, -1)
            restore_root = True
        pr = apport.report.Report()
        self.assertRaises(ValueError, pr.add_proc_info, 1)  # EPERM for init process
        if restore_root:
            os.setresuid(0, 0, -1)
    
        self.assertEqual(pr.pid, 1)
        self.assertIn("Pid:\t1", pr["ProcStatus"])
        self.assertTrue(pr["ProcEnviron"].startswith("Error:"), pr["ProcEnviron"])
        self.assertNotIn("InterpreterPath", pr)
    
        # check escaping of ProcCmdline
        with subprocess.Popen(
            ["cat", "/foo bar", "\\h", "\\ \\", "-"],
            stdin=subprocess.PIPE,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
        ) as cat:
            self.wait_for_proc_cmdline(cat.pid)
            pr = apport.report.Report()
            pr.add_proc_info(pid=cat.pid)
            self.assertEqual(pr.pid, cat.pid)
            cat.communicate(b"\n")
        self.assertEqual(pr["ProcCmdline"], "cat /foo\\ bar \\\\h \\\\\\ \\\\ -")
>       self.assertEqual(pr["ExecutablePath"], "/usr/bin/cat")
E       AssertionError: '/usr/bin/gnucat' != '/usr/bin/cat'
E       - /usr/bin/gnucat
E       ?          ---
E       + /usr/bin/cat

tests/integration/test_report.py:203: AssertionError
_________________________ T.test_parse_argv_apport_bug _________________________

self = <tests.integration.test_ui.T testMethod=test_parse_argv_apport_bug>
stderr_mock = <_io.StringIO object at 0x795179e34dc0>

    @unittest.mock.patch("sys.stderr", new_callable=io.StringIO)
    def test_parse_argv_apport_bug(self, stderr_mock: MagicMock) -> None:
        """parse_args() option inference when invoked as *-bug"""
    
        def _chk(
            args: list[str],
            expected_opts: dict[str, bool | int | str | list[str] | None],
        ) -> None:
            ui = apport.ui.UserInterface(["apport-bug"] + args)
            expected_opts["version"] = False
            self.assertEqual(ui.args.__dict__, expected_opts)
            self.assertEqual(stderr_mock.getvalue(), "")
    
        #
        # no arguments: default to 'ask for symptom' bug mode
        #
        _chk(
            [],
            {
                "filebug": True,
                "package": None,
                "pid": None,
                "crash_file": None,
                "symptom": None,
                "update_report": None,
                "save": None,
                "window": False,
                "tags": [],
                "hanging": False,
            },
        )
    
        #
        # single arguments
        #
    
        # package
        _chk(
            ["coreutils"],
            {
                "filebug": True,
                "package": "coreutils",
                "pid": None,
                "crash_file": None,
                "symptom": None,
                "update_report": None,
                "save": None,
                "window": False,
                "tags": [],
                "hanging": False,
            },
        )
    
        # symptom (preferred over package)
        self._write_symptom_script(
            "coreutils.py",
            textwrap.dedent(
                """\
                description = 'foo does not work'
                def run(report, ui):
                    return 'bash'
                """
            ),
        )
        _chk(
            ["coreutils"],
            {
                "filebug": True,
                "package": None,
                "pid": None,
                "crash_file": None,
                "symptom": "coreutils",
                "update_report": None,
                "save": None,
                "window": False,
                "tags": [],
                "hanging": False,
            },
        )
        os.unlink(os.path.join(apport.ui.symptom_script_dir, "coreutils.py"))
    
        # PID
        _chk(
            ["1234"],
            {
                "filebug": True,
                "package": None,
                "pid": "1234",
                "crash_file": None,
                "symptom": None,
                "update_report": None,
                "save": None,
                "window": False,
                "tags": [],
                "hanging": False,
            },
        )
    
        # .crash/.apport files; check correct handling of spaces
        for suffix in (".crash", ".apport"):
            _chk(
                [f"/tmp/f oo{suffix}"],
                {
                    "filebug": False,
                    "package": None,
                    "pid": None,
                    "crash_file": f"/tmp/f oo{suffix}",
                    "symptom": None,
                    "update_report": None,
                    "save": None,
                    "window": False,
                    "tags": [],
                    "hanging": False,
                },
            )
    
        # executable name
>       _chk(
            ["/usr/bin/tail"],
            {
                "filebug": True,
                "package": "coreutils",
                "pid": None,
                "crash_file": None,
                "symptom": None,
                "update_report": None,
                "save": None,
                "window": False,
                "tags": [],
                "hanging": False,
            },
        )

tests/integration/test_ui.py:2391: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/integration/test_ui.py:2284: in _chk
    self.assertEqual(ui.args.__dict__, expected_opts)
E   AssertionError: {'filebug': True, 'window': False, 'update_report': None, 's[137 chars]alse} != {'filebug': True, 'package': 'coreutils', 'pid': None, 'cras[128 chars]alse}
E     {'crash_file': None,
E      'filebug': True,
E      'hanging': False,
E   -  'package': 'coreutils-from-gnu',
E   ?                       ---------
E   
E   +  'package': 'coreutils',
E      'pid': None,
E      'save': None,
E      'symptom': None,
E      'tags': [],
E      'update_report': None,
E      'version': False,
E      'window': False}
_________________________ T.test_parse_argv_single_arg _________________________

self = <tests.integration.test_ui.T testMethod=test_parse_argv_single_arg>
stderr_mock = <_io.StringIO object at 0x79517b6dc7c0>

    @unittest.mock.patch("sys.stderr", new_callable=io.StringIO)
    def test_parse_argv_single_arg(self, stderr_mock: MagicMock) -> None:
        """parse_args() option inference for a single argument"""
    
        def _chk(
            program_name: str,
            arg: str | None,
            expected_opts: dict[str, bool | int | str | list[str] | None],
        ) -> None:
            argv = [program_name]
            if arg:
                argv.append(arg)
            ui = apport.ui.UserInterface(argv)
            expected_opts["version"] = False
            self.assertEqual(ui.args.__dict__, expected_opts)
            self.assertEqual(stderr_mock.getvalue(), "")
    
        # no arguments -> show pending crashes
        _chk(
            "apport-gtk",
            None,
            {
                "filebug": False,
                "package": None,
                "pid": None,
                "crash_file": None,
                "symptom": None,
                "update_report": None,
                "save": None,
                "window": False,
                "tags": [],
                "hanging": False,
            },
        )
        # updating report not allowed without args
        self.assertRaises(SystemExit, _chk, "apport-collect", None, {})
        self.assertIn(
            "error: the following arguments are required: report_number",
            stderr_mock.getvalue(),
        )
        stderr_mock.truncate(0)
    
        # package
        _chk(
            "apport-kde",
            "coreutils",
            {
                "filebug": True,
                "package": "coreutils",
                "pid": None,
                "crash_file": None,
                "symptom": None,
                "update_report": None,
                "save": None,
                "window": False,
                "tags": [],
                "hanging": False,
            },
        )
    
        # symptom is preferred over package
        self._write_symptom_script(
            "coreutils.py",
            textwrap.dedent(
                """\
                description = 'foo does not work'
                def run(report, ui):
                    return 'bash'
                """
            ),
        )
        _chk(
            "apport-cli",
            "coreutils",
            {
                "filebug": True,
                "package": None,
                "pid": None,
                "crash_file": None,
                "symptom": "coreutils",
                "update_report": None,
                "save": None,
                "window": False,
                "tags": [],
                "hanging": False,
            },
        )
    
        # PID
        _chk(
            "apport-cli",
            "1234",
            {
                "filebug": True,
                "package": None,
                "pid": "1234",
                "crash_file": None,
                "symptom": None,
                "update_report": None,
                "save": None,
                "window": False,
                "tags": [],
                "hanging": False,
            },
        )
    
        # .crash/.apport files; check correct handling of spaces
        for suffix in (".crash", ".apport"):
            _chk(
                "apport-cli",
                f"/tmp/f oo{suffix}",
                {
                    "filebug": False,
                    "package": None,
                    "pid": None,
                    "crash_file": f"/tmp/f oo{suffix}",
                    "symptom": None,
                    "update_report": None,
                    "save": None,
                    "window": False,
                    "tags": [],
                    "hanging": False,
                },
            )
    
        # executable
>       _chk(
            "apport-cli",
            "/usr/bin/tail",
            {
                "filebug": True,
                "package": "coreutils",
                "pid": None,
                "crash_file": None,
                "symptom": None,
                "update_report": None,
                "save": None,
                "window": False,
                "tags": [],
                "hanging": False,
            },
        )

tests/integration/test_ui.py:2229: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/integration/test_ui.py:2117: in _chk
    self.assertEqual(ui.args.__dict__, expected_opts)
E   AssertionError: {'filebug': True, 'window': False, 'update_report': None, 's[137 chars]alse} != {'filebug': True, 'package': 'coreutils', 'pid': None, 'cras[128 chars]alse}
E     {'crash_file': None,
E      'filebug': True,
E      'hanging': False,
E   -  'package': 'coreutils-from-gnu',
E   ?                       ---------
E   
E   +  'package': 'coreutils',
E      'pid': None,
E      'save': None,
E      'symptom': None,
E      'tags': [],
E      'update_report': None,
E      'version': False,
E      'window': False}
__________________________ T.test_run_report_hanging ___________________________

self = <tests.integration.test_ui.T testMethod=test_run_report_hanging>

    def test_run_report_hanging(self) -> None:
        with run_test_executable() as pid:
            self.ui = UserInterfaceMock(["ui-test", "--hanging", str(pid)])
            self.ui.present_details_response = apport.ui.Action(report=True)
            self.assertTrue(self.ui.run_argv())
    
        assert self.ui.report
        for expected_key in (
            "ProblemType",
            "ExecutablePath",
            "Package",
            "SourcePackage",
        ):
            self.assertIn(expected_key, self.ui.report)
        self.assertEqual(self.ui.report["ProblemType"], "Hang")
        self.assertEqual(self.ui.report["ExecutablePath"], self.TEST_EXECUTABLE)
>       self.assertEqual(self.ui.report["Package"].split(" ")[0], "coreutils")
E       AssertionError: 'gnu-coreutils' != 'coreutils'
E       - gnu-coreutils
E       ? ----
E       + coreutils

tests/integration/test_ui.py:825: AssertionError
```

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apport in Ubuntu.
https://bugs.launchpad.net/bugs/2111595

Title:
  FTBFS in questing: setup.cfg command 'build_java' has no such option
  'minimum-java-release'

Status in apport package in Ubuntu:
  New

Bug description:
  Apport 2.32.0-0ubuntu5 FTBFS on questing due to an error in a custom
  setuptools command:

  ```
  error: error in setup.cfg: command 'build_java' has no such option 'minimum-java-release'
  E: pybuild pybuild:389: build: plugin distutils failed with: exit code=1: /usr/bin/python3 setup.py build 
  dh_auto_build: error: pybuild --build -i python{version} -p 3.13 returned exit code 13
  make: *** [debian/rules:4: binary] Error 25
  dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
  debuild: fatal error at line 1185:
  dpkg-buildpackage -us -uc -ui failed
  ```

  I tried to sidestep this by commenting out the relevant option in
  setup.cfg:

  ```
   [build_java_subdir]
  -minimum-java-release=8
  +# minimum-java-release=8
  ```

  and hardcoding the release in setuptools_apport/java.py:

  ```
       def initialize_options(self) -> None:
           """Set or (reset) all options/attributes/caches to their default values"""
  -        self.minimum_java_release = "7"
  +        self.minimum_java_release = "8"
  ```

  and I still got the following error:

  ```
  make[1]: Entering directory '/home/octavio/apport-2.32.0'
  tests/run-linters --errors-only
  Running mypy...
  Success: no issues found in 98 source files
  Success: no issues found in 21 source files
  Running pylint...
  ************* Module debian
  debian/__init__.py:1:0: F0010: error while code parsing: Unable to load file debian/__init__.py:
  [Errno 2] No such file or directory: 'debian/__init__.py' (parse-error)
  make[1]: *** [debian/rules:8: override_dh_auto_test] Error 1
  make[1]: Leaving directory '/home/octavio/apport-2.32.0'
  make: *** [debian/rules:4: binary] Error 2
  dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
  debuild: fatal error at line 1185:
  dpkg-buildpackage -us -uc -ui failed
  ```

  Let me know if I can provide further information.

  Thanks!

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apport/+bug/2111595/+subscriptions




More information about the foundations-bugs mailing list