Skip to content

Assertion failing when building morello-purecap on Morello #456

@kiancross

Description

@kiancross

When building on Morello for morello-purecap (and possibly for other targets - I haven't tested), the following error occurs:

Traceback (most recent call last):
  File "/home/kian/cheribuild/pycheribuild/__main__.py", line 365, in main
    run_and_kill_children_on_exit(real_main)
  File "/home/kian/cheribuild/pycheribuild/processutils.py", line 943, in run_and_kill_children_on_exit
    fn()
  File "/home/kian/cheribuild/pycheribuild/__main__.py", line 351, in real_main
    target.check_system_deps(cheri_config)
  File "/home/kian/cheribuild/pycheribuild/targets.py", line 132, in check_system_deps
    self._check_system_deps(config, self._get_or_create_project_no_setup(None, config, None))
  File "/home/kian/cheribuild/pycheribuild/targets.py", line 125, in _check_system_deps
    project.check_system_dependencies()
  File "/home/kian/cheribuild/pycheribuild/projects/build_qemu.py", line 160, in check_system_dependencies
    super().check_system_dependencies()
  File "/home/kian/cheribuild/pycheribuild/projects/project.py", line 617, in check_system_dependencies
    if self.make_args.command is None:
  File "/home/kian/cheribuild/pycheribuild/projects/project.py", line 221, in command
    cmd = self.__infer_command()
  File "/home/kian/cheribuild/pycheribuild/projects/project.py", line 242, in __infer_command
    self.__project.check_required_system_tool("gmake", homebrew="make")
  File "/home/kian/cheribuild/pycheribuild/projects/simple_project.py", line 1093, in check_required_system_tool
    assert instructions.fixit_hint() == existing.fixit_hint(), f"mismatched instructions for {executable}"
AssertionError: mismatched instructions for gmake
Fatal error: Unhandled exception: mismatched instructions for gmake

This is caused by the following assertion:

assert instructions.fixit_hint() == existing.fixit_hint(), f"mismatched instructions for {executable}"

Inserting prints on the line before shows a comparison between Possibly running `pkg64 install gmake` fixes this. Note: package name may not be correct. and Possibly running `pkg64c install gmake` fixes this. Note: package name may not be correct., causing the assertion failure.

Commenting out the line above allows the build to proceed as expected.

@jrtc27 notes on Slack that the root cause is the line below: it is a class member, not an instance member, and as such, instances of SimpleProjectBase for hybrid and purecap builds share the same dict.

__checked_system_tools: "dict[str, InstallInstructions]" = {}

I'm leaving this as an issue rather than proposing a PR, as I'm not sure whether it is best to (1) turn the above assertion into a non-fatal warning or (2) fix the root cause as outlined above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions