This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

cheribuild - Adding a new target

Hi there,

I am trying to add Mosquitto (MQTT) as a cheribuild target. This is my current Python script:

from .crosscompileproject import CrossCompileCMakeProject, GitRepository
from ...config.compilation_targets import CompilationTargets

class BuildMqtt(CrossCompileCMakeProject):
    target = "mqtt"
    repository = GitRepository("">github.com/.../mosquitto")
    supported_architectures = CompilationTargets.ALL_FREEBSD_AND_CHERIBSD_TARGETS + [CompilationTargets.NATIVE]

When running ./cheribuild mqtt-morello-purecap to build the target, I run into this error message:

CMake Error at man/CMakeLists.txt:29 (message):
xsltproc not found: manpages cannot be built


-- Configuring incomplete, errors occurred!

Looking at the MQTT Git repository here and in the "Building from source" section, I can add the CMake option "WITH_DOCS=no" which disables checking for the optional build dependency xsltproc to generate man pages which I don't need. With these changes my build script now looks like this:

from .crosscompileproject import CrossCompileCMakeProject, GitRepository
from ...config.compilation_targets import CompilationTargets

class BuildMqtt(CrossCompileCMakeProject):
    target = "mqtt"
    repository = GitRepository("">github.com/.../mosquitto")
    supported_architectures = CompilationTargets.ALL_FREEBSD_AND_CHERIBSD_TARGETS + [CompilationTargets.NATIVE]

    def setup(self):
    super().setup()
    self.add_cmake_options(WITH_DOCS=no)

Now when I attempt to run ./cheribuild.py mqtt-morello-purecap again, I am presented with multiple errors:

Traceback (most recent call last):
File "./cheribuild.py", line 42, in <module>
main()
File "/home/ubuntu/cheribuild/pycheribuild/__main__.py", line 258, in main
run_and_kill_children_on_exit(real_main)
File "/home/ubuntu/cheribuild/pycheribuild/processutils.py", line 771, in run_and_kill_children_on_exit
fn()
File "/home/ubuntu/cheribuild/pycheribuild/__main__.py", line 248, in real_main
target_manager.run(cheri_config)
File "/home/ubuntu/cheribuild/pycheribuild/targets.py", line 435, in run
target.execute(config)
File "/home/ubuntu/cheribuild/pycheribuild/targets.py", line 129, in execute
self._do_run(config, msg="Built", func=lambda project: project.process())
File "/home/ubuntu/cheribuild/pycheribuild/targets.py", line 107, in _do_run
project.setup()
File "/home/ubuntu/cheribuild/pycheribuild/projects/cross/mqtt.py", line 11, in setup
self.add_cmake_options(WITH_DOCS=no)
NameError: name 'no' is not defined

Any ideas why this section below in particular is occurring? Or any ideas on how to skip the checking for the xsltproc optional dependency?

File "/home/ubuntu/cheribuild/pycheribuild/projects/cross/mqtt.py", line 11, in setup
self.add_cmake_options(WITH_DOCS=no)
NameError: name 'no' is not defined

Thanks!

Parents
  • Hi,

    In your code `no` is a python variable, which isn't defined. What you want to be using is either self.add_cmake_options(WITH_DOCS=False) if the project expects a CMake boolean (i.e. ON/OFF/TRUE/FALSE) or self.add_cmake_options(WITH_DOCS="no") if the project does a string comparison.

Reply
  • Hi,

    In your code `no` is a python variable, which isn't defined. What you want to be using is either self.add_cmake_options(WITH_DOCS=False) if the project expects a CMake boolean (i.e. ON/OFF/TRUE/FALSE) or self.add_cmake_options(WITH_DOCS="no") if the project does a string comparison.

Children