clang.cindex.TranslationUnitLoadError: Error parsing translation unit

オープン
#28 コメント 4 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
28/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python
領域
tooling

調査の方向性

score.h に対して示されている Windows コマンドを再現し、次に pybind11_mkdoc/mkdoc_lib.py の index.parse の呼び出しと、参照されている clang/cindex.py の解析パスを調べます。単一ヘッダー用のコマンドが、ファイルの読み取りエラーを報告したり TranslationUnitLoadError を発生させたりせずに score.h を処理すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Hi, I'm trying to run the pybind11_mkdoc in a single file called score.h, but I got this error below:

C:\Users\nyck\Desktop\maialib>python -m pybind11_mkdoc maiacore\include\maiacore\score.h
Processing "'maiacore\include\maiacore\score.h'" ..
Waiting for jobs to finish ..
error: error reading ''maiacore\include\maiacore\score.h''
Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\Program Files\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\Users\nyck\AppData\Roaming\Python\Python310\site-packages\pybind11_mkdoc\mkdoc_lib.py", line 246, in run
    tu = index.parse(self.filename, self.parameters)
  File "C:\Users\nyck\AppData\Roaming\Python\Python310\site-packages\clang\cindex.py", line 2722, in parse
    return TranslationUnit.from_source(path, args, unsaved_files, options,
  File "C:\Users\nyck\AppData\Roaming\Python\Python310\site-packages\clang\cindex.py", line 2837, in from_source
    raise TranslationUnitLoadError("Error parsing translation unit.")
clang.cindex.TranslationUnitLoadError: Error parsing translation unit.

The file score.h is a valid C++ header that contains a valid Doxygen documentation in it.

Please, could you help me?

My system:

  • Windows 10 x64
  • Clang LLVM 15.0.6 installed
  • Python 3.10
  • pybind11_mkdoc-2.6.2.dev1 (filename=pybind11_mkdoc-2.6.2.dev1-py3-none-any.whl)
主要言語
Python
スター
44
フォーク
24
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pybind/pybind11_mkdoc のほかの issue

pybind/pybind11_mkdoc の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。