fix(tool,cl): msgpack-c recursive discovery ends in duplicate atomic counter type
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with tool/gen.go, where TopHeaders runs recursive discovery when Files is absent, then tool/pputil/pputil.go for the include-based top-header selection. The collision involves msgpack's unpack_template.h, which needs caller-provided macros, and the duplicate X_atomicCounterT typedef from gcc_atomic.h and sysdep.h; the typedef path runs through loadTypedef and defineTypedef. Done means generation over the installed msgpack-c headers either discovers the public API without the panic or fails with a precise unsupported-input diagnostic, and the design choice needs maintainer input first.
索引モデルが issue の本文から書いたものです。
説明
Observed failure
With recursive installed-header discovery and no Files allowlist, msgpack-c generation emits preprocessing diagnostics for unpack_template.h, then panics on a duplicate generated type X_atomicCounterT.
msgpack/unpack_template.h: ... msgpack_unpack_func template is not defined
msgpack/unpack_template.h: ... msgpack_unpack_callback template is not defined
msgpack/unpack_template.h: ... msgpack_unpack_struct template is not defined
panic: .../msgpack/gcc_atomic.h:14:1: X_atomicCounterT redeclared in this block
previous declaration at .../msgpack/sysdep.h:84:5
The ordering above is observed in the log; it is not a claim that the template diagnostics have been proven to cause the type collision.
Confirmed jobs: Linux arm64 and macOS amd64. Both pass the Formula test, installed-input preparation, LLGo build, and llcppg build, then fail during Test llcppg generation with exit code 2. The other two platform jobs were pending when evidence was collected.
Versions and reproduction input
- llcppg:
8fc0f987e41ffe4b4f608e9541422b460ea89fea. - LLGo:
afe9a5407260348b18c7104e98d76cb5cdf48b29; LLVM 21. - Actual installed source: msgpack/msgpack-c
c-7.0.2, commite17beb371b59459a13b48e166a11e123bda5bf93. The Formula floor isc-6.1.0, but that is not the version used by these CI jobs. - Failed index head:
249c1573839532d54ca139e7de5dd03a375e8f39, index PR #34.
{
"Name": "msgpack",
"Language": "c",
"Dir": "./include/...",
"LLGoPackage": "link: $(pkg-config --libs msgpack-c)",
"FuncPrefix": ["msgpack_"],
"TypePrefix": ["msgpack_"]
}
The workflow stages the entire installed include tree under source/include, initializes the source Go module, and runs llcppg -v ./generated ./source. It does not restrict generation to the umbrella header.
Source evidence and expected behavior
unpack_template.h, lines 11–32, explicitly requires caller-provided template macros. include/msgpack/gcc_atomic.h:14 declares typedef int _msgpack_atomic_counter_t;; the installed sysdep.h:84 comes from cmake/sysdep.h.in:84, which declares typedef unsigned int _msgpack_atomic_counter_t; in its alternative branch.
The installed public API should be discoverable without treating context-dependent template/alternative implementation headers as unrelated translation units that collide, or the tool should report a precise unsupported-input diagnostic instead of panicking. The correct discovery/type-handling change still needs investigation; excluding public APIs is not proposed as the fix.
Main at aab6dbf0baedc47b42f9576a65dd79ce6715e31a was checked read-only: tool/gen.go still calls TopHeaders for recursive discovery when Files is absent; tool/pputil/pputil.go performs the include-based top-header selection; typedefs reach loadTypedef/defineTypedef. No latest-main runtime reproduction is claimed.
- 主要言語
- Go
- スター
- 41
- フォーク
- 13
- 平均マージ
- 2時間 17分
- マージ済み PR(30日)
- 178
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
goplus/llcppg のほかの issue
-
Proposal: `MacroFunc` Automatic Detection of Forwarding Macros対応中かも @fennoai が 1 日前に担当しました。 オープンArchitecture-Design configuration feature
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
goplus/llcppg#1109 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Proposal: `Define` — inject constants into the generated package対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンconfiguration feature proposal
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
goplus/llcppg#1067 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
goplus/llcppg#1035 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
feature proposal
難易度 5/5 1週間以上 初心者へのやさしさ 18/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 1/5 1〜3時間 初心者へのやさしさ 76/100
superplanehq/superplane#9007 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
yetone/magpie#3905 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信