0

I am trying to generate HTML docs using meson build. I used gnome.gtkdoc() method for this from meson build system.

Following is my meson.build file

project('mydoc', 'c',
  version: '0.1.0')

gnome = import('gnome')

glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix')
glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
docpath = join_paths(get_option('datadir'), 'gtk-doc', 'html')

content_files = [
  'docbook-mydoc.xml',
]
gnome.gtkdoc('mydoc',
  main_xml : 'main-doc.xml',
  src_dir : [
      join_paths(meson.source_root())
   ],
  fixxref_args: [
      '--html-dir=' + (gnome.gtkdoc_html_dir(meson.project_name())),
      '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
      '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
      '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
    ],
  content_files: content_files,
  install : true,
  install_dir: join_paths(meson.source_root(), 'doc')
)

Above meson.build works fine and can generates HTML pages. I have problem when running above meson.build in Yocto. It gives me Permission denied error while do_install operation.

ERROR: ['gtkdoc-mkhtml', '--path=/home/user/yocto/build-zeus/tmp/work/cortexa7t2hf-neon-fslc-linux-gnueabi/mydoc/1.0.0-r0/git/:/home/user/yocto/build-zeus/tmp/work/cortexa7t2hf-neon-fslc-linux-gnueabi/mydoc/1.0.0-r0/build/', 'mydoc', '../main-doc.xml'] failed with status 1

Traceback (most recent call last):
  
File "/home/user/yocto/build-zeus/tmp/work/cortexa7t2hf-neon-fslc-linux-gnueabi/mydoc/1.0.0-r0/recipe-sysroot-native/usr/bin/gtkdoc-mkhtml", line 51, in <module>
    sys.exit(mkhtml.run(options))
File "/home/user/yocto/build-zeus/tmp/work/cortexa7t2hf-neon-fslc-linux-gnueabi/mydoc/1.0.0-r0/recipe-sysroot-native/usr/share/gtk-doc/python/gtkdoc/mkhtml.py", line 93, in run
    quiet] + remaining_args + [gtkdocdir + '/gtk-doc.xsl', document])
  
File "/home/user/yocto/build-zeus/tmp/work/cortexa7t2hf-neon-fslc-linux-gnueabi/mydoc/1.0.0-r0/recipe-sysroot-native/usr/share/gtk-doc/python/gtkdoc/mkhtml.py", line 42, in run_xsltproc
    return subprocess.call(command + args)
  
File "/home/user/yocto/build-zeus/tmp/work/cortexa7t2hf-neon-fslc-linux-gnueabi/mydoc/1.0.0-r0/recipe-sysroot-native/usr/lib/python3.7/subprocess.py", line 339, in call
    with Popen(*popenargs, **kwargs) as p:
  
File "/home/user/yocto/build-zeus/tmp/work/cortexa7t2hf-neon-fslc-linux-gnueabi/mydoc/1.0.0-r0/recipe-sysroot-native/usr/lib/python3.7/subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  
File "/home/user/yocto/build-zeus/tmp/work/cortexa7t2hf-neon-fslc-linux-gnueabi/mydoc/1.0.0-r0/recipe-sysroot-native/usr/lib/python3.7/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: ''

I am not sure why its gave me permission denied error. Any help will be appreciated.

evanhutomo
  • 627
  • 1
  • 11
  • 24
vishnumotghare
  • 591
  • 1
  • 5
  • 23

1 Answers1

0

It's a bit suspicious that you are trying to install into source root directory with

  install_dir: join_paths(meson.source_root(), 'doc')

Typically, it's just directory name relative to gtk-doc html dir (gnome.gtkdoc_html_dir()) or not set at all - then directory is module name. So try just remove it...

Update You might be missing prefix for project html dir (for --html-dir )and it should look like:

'--html-dir=' + join_paths(get_option('prefix'), gnome.gtkdoc_html_dir(meson.project_name()),

Note. And instead of generating gtk doc path, it should be more reliable to use above mentioned function:

'--extra-dir=' + join_paths(glib_prefix, gnome.gtkdoc_html_dir('glib')),
 ...
pmod
  • 10,450
  • 1
  • 37
  • 50
  • Tried removing "install_dir: join_paths(meson.source_root(), 'doc')". Getting same permission denied error. – vishnumotghare Apr 09 '20 at 05:50
  • @vm18553 Then it'd be worth looking at recipe as well, I assume you do use "inherit gtk-doc" ... – pmod Apr 09 '20 at 08:23
  • Yes "inherit gtk-doc" is present in recipe. I observed that Yocto is trying to install documents in "${D}/usr/share/gtk-doc" directory. I don't want to install docs in image. Is there anyway that I can tell meson.build or Yocto to install docs somewhere else e.g "/home/user/docs" – vishnumotghare Apr 10 '20 at 07:35
  • @vm18553 exactly, if you want, you can install in another directory (you'd most probably need to add that directory to FILES_${PN} in your recipe), but that directory will be still on target image. since Yocto is Linux image building system. If you want to install something on host - you can do it directly with meson, no need Yocto for that. – pmod Apr 13 '20 at 21:27