Proposal: Use llarhub/libc as the default platform-specific C standard library
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 28/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 領域
- build-system, tooling
調査の方向性
Read the dependency resolver and header lookup behavior described in the issue, along with the platform-specific layout from #1125. Trace how standard headers map to Go types through the existing github.com/goplus/lib/c association. Done means target-specific llarhub/libc headers are selected consistently, with clear handling for unavailable targets, explicit Stdlib, and generating libc itself.
索引モデルが issue の本文から書いたものです。
説明
Summary
Make github.com/llarhub/libc a default dependency when llcppg parses C/C++ headers, and select its headers for the requested GOOS and GOARCH. This builds on the platform-specific layout in #1125.
Motivation
When Stdlib is empty, llcppg currently discovers the host Clang's standard include directories. A platform-specific conversion can pass a different target to libclang while still adding those host directories. For example, generating Linux ARM64 bindings on a Linux AMD64 host may encounter host system headers instead of the target's headers.
When generating for a different target, projects currently must prepare and configure matching standard-library headers themselves to avoid relying on host headers. A default libc dependency would make the target header source consistent across projects and avoid repeating that configuration.
Proposal
Use llarhub/libc as an implicit dependency for header parsing, without requiring every project to add libc to Deps. Resolve its include directory for the selected target platform. For the same target and libc version, the selected libc headers should not depend on the machine running llcppg.
For example, given a platform-specific project containing:
#include <sys/types.h>
struct file_info {
off_t offset;
};
| Target | libc header used for <sys/types.h> |
|---|---|
linux/amd64 |
libc/c/linux-amd64/include/sys/types.h |
linux/arm64 |
libc/c/linux-arm64/include/sys/types.h |
darwin/arm64 |
libc/c/darwin-arm64/include/sys/types.h |
These paths illustrate the current platform directories in llarhub/libc. The target selection follows #1125; the same Linux host can request Linux ARM64 or Darwin ARM64 generation.
Current limitations
The current dependency resolver appends include to the dependency's C module directory and does not select a platform subdirectory. Separately, standard headers are associated with github.com/goplus/lib/c by the current generator. Defaulting to llarhub/libc therefore needs to account for both header lookup and the Go types associated with those headers.
The libc repository currently contains linux-amd64, linux-arm64, and darwin-arm64 C header directories; darwin-amd64 is not present in its c branch.
Open questions
- How should llcppg select the libc version and handle a target whose headers are unavailable?
- How should the default dependency work when generating
llarhub/libcitself? - How should it interact with an explicitly configured
Stdliband the existinggithub.com/goplus/lib/ctype mappings?
- 主要言語
- Go
- スター
- 40
- フォーク
- 13
- 平均マージ
- 2時間 22分
- マージ済み PR(30日)
- 125
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
goplus/llcppg のほかの issue
-
feature proposal
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
goplus/llcppg#1136 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
fix(cl): preserve null callback arguments in automatically detected forwarding macros対応中かも @MeteorsLiu が今日担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
SAP/crossplane-provider-btp#1175 ·
メンテナーはふだん 1 日以内に返信
-
adk: stream concatenation errors bypass retry and failover対応中かも @OUAO-FRANK が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
google/osv-scalibr#2586 ·
メンテナーはふだん 2 日以内に返信
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
stacklok/toolhive-catalog#1890 ·
メンテナーはふだん 1 日以内に返信
-
heap: pushing an item that is already queued corrupts the index対応中かも @lbarrosby が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
kubernetes-sigs/kwok#1800 ·
メンテナーはふだん 1 日以内に返信