Proposal: Use llarhub/libc as the default platform-specific C standard library
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 28/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- build-system, tooling
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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?
- Ngôn ngữ chính
- Go
- Star
- 40
- Fork
- 13
- Merge trung bình
- 2 giờ 44 phút
- Pull request đã merge (30 ngày)
- 112
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của goplus/llcppg
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
feature proposal
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
goplus/llcppg#1136 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của goplus/llcppg
Issue tương tự
-
agent-butler-finding bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
jordansmall/spindrift#6414 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Icinga/icinga-kubernetes#294 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Cluster details: the Control Plane version field has a different border color than its icon boxĐang mởkind/design sig/ui
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
kubermatic/dashboard#8449 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
cli/cli#14962 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Model conformance driftĐang mởmodel-drift
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày