JakubAndrysek / MkDoxy

📖 Automatically generates API documentation for your project based on Doxygen comments and code snippets in your markdown files.
https://mkdoxy.kubaandrysek.cz/
MIT License
60 stars 16 forks source link

how to find an execution issue #75

Closed andboss closed 2 months ago

andboss commented 10 months ago

I'm integrating the MkDoxy and it's generates in local build with mkdocs serve but not in a pipeline with same docker image as development environment with this exception:

INFO    -  -> Start project 'rscApi'
Traceback (most recent call last):
  File "/usr/local/bin/mkdocs", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1[68](https://[my-repo-path]/-/jobs/134908210#L68)8, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mkdocs/__main__.py", line 286, in build_command
    build.build(cfg, dirty=not clean)
  File "/usr/local/lib/python3.11/site-packages/mkdocs/commands/build.py", line 304, in build
    files = config.plugins.on_files(files, config=config)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mkdocs/plugins.py", line 533, in on_files
    return self.run_event('files', files, config=config)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mkdocs/plugins.py", line 507, in run_event
    result = method(item, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mkdoxy/plugin.py", line 116, in on_files
    if doxygenRun.checkAndRun():
       ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mkdoxy/doxyrun.py", line 133, in checkAndRun
    self.run()
  File "/usr/local/lib/python3.11/site-packages/mkdoxy/doxyrun.py", line 122, in run
    doxyBuilder = Popen([self.doxygenBinPath, '-'], stdout=PIPE, stdin=PIPE, stderr=PIPE, cwd=self.runPath)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/lib/python3.11/subprocess.py", line 1[95](https://[my-repo-path]/-/jobs/134908210#L95)0, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: ''

How can i analyze the issue from the error message? What is exactly missing? doxygen executable or some config file?

JakubAndrysek commented 10 months ago

Hi, i think you don't have installed Doxygen.

andboss commented 10 months ago

Hi @JakubAndrysek thanks, doxygen is installed (same container locally and for CI).

I think the CI calls it differently via poetry run mkdocs ... and there it looks like something is different...

Will try to find the difference...

JakubAndrysek commented 9 months ago

Have you found the solution?

Could I close the issue?

andboss commented 9 months ago

Still not working, but had to switch to other urgent topics and will continue in october with this investigation :)

We can close if you want and re-open if continue with this topic...

JakubAndrysek commented 9 months ago

Ok, I will close it at this time. Good luck with finding a solution.

wu-vincent commented 2 months ago

I've recently encountered the same issue when generating documentation on RTD, and I've found a simple way to reproduce it.

The following command runs perfectly fine:

mkdocs build

However, this command does not:

mkdocs build --config-file mkdocs.yml

The problem seems to reside here

It appears as though if cwd is set to a specific path instead of None, Popen fails to locate the executable.

In the plugin.py file, located here, the runPath will be set to config_file_path if config_file_path is not None. This could be the reason for the failure when executing the command mkdocs build --config-file mkdocs.yml.

JakubAndrysek commented 2 months ago

Thank you for your investigation. If you know how to fix it, feel free to make PR. I don't have time to fix it soon. Thanks

wu-vincent commented 2 months ago

Thank you. Just opened a PR that would fix this issue.

andboss commented 2 months ago

@wu-vincent thank you for deep investigation and resolution 👍 @JakubAndrysek with the new possibility passing the config files (Thanks!) i will try new version if this fix is also applied.