goplus / goplus/llcppg

failed to generate due to missing of "limits.h"

Open
#219 23 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
33
Forks
11
Avg merge
1h 17m
Merged PRs (30d)
51

Description

log of llcppg:

2025/03/21 15:31:51 llcppg: cannot generate: 
go: creating new go.mod: module gmp
go: added github.com/goplus/llgo v0.10.0
2025/03/21 15:31:51 File "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/limits.h" not found in FileMap. Available files:
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_posix_availability.h
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/stddef.h
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/i386/_limits.h
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/__stddef_max_align_t.h
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/limits.h
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/i386/limits.h
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/syslimits.h
/Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/limits.h
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/cdefs.h
/Users/qiniu/.conan2/p/b/gmp0639b84a0b2df/p/include/gmp.h
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_symbol_aliasing.h
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/machine/limits.h
panic: File "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/limits.h" not found in FileMap. Available files:
        /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_posix_availability.h
        /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/stddef.h
        /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/i386/_limits.h
        /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/__stddef_max_align_t.h
        /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/limits.h
        /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/i386/limits.h
        /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/syslimits.h
        /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include/limits.h
        /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/cdefs.h
        /Users/qiniu/.conan2/p/b/gmp0639b84a0b2df/p/include/gmp.h
        /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/_symbol_aliasing.h
        /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/machine/limits.h

goroutine 1 [running]:
log.Panicf({0x2a9b2dd?, 0x3b9?}, {0xc00003db90?, 0x2b0f5f0?, 0x1?})
        /Users/qiniu/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.7.darwin-amd64/src/log/log.go:439 +0x65
github.com/goplus/llcppg/cmd/gogensig/convert.(*Converter).setCurFile(0xc0002e40d8, {0xc00002a6e0, 0x48})
        /Users/qiniu/llcppg/cmd/gogensig/convert/convert.go:154 +0x28d
github.com/goplus/llcppg/cmd/gogensig/convert.(*Converter).Process.func1({0xc00002a6e0?, 0xc00003ddd8?}, 0x2a766f8?, {0x2a891c2, 0x5}, 0xc00003dd88)
        /Users/qiniu/llcppg/cmd/gogensig/convert/convert.go:87 +0x71
github.com/goplus/llcppg/cmd/gogensig/convert.(*Converter).Process(0xc0002e40d8)
        /Users/qiniu/llcppg/cmd/gogensig/convert/convert.go:94 +0xf4
github.com/goplus/llcppg/cmd/gogensig/convert.(*Converter).Convert(0xc0002e40d8)
        /Users/qiniu/llcppg/cmd/gogensig/convert/convert.go:74 +0x18
main.main()
        /Users/qiniu/llcppg/cmd/gogensig/gogensig.go:80 +0x4f4
panic: exit status 2

goroutine 1 [running]:
main.check(...)
        /Users/qiniu/llcppg/llcppg.go:190
main.do({0x7ff7bc0545ff, 0xa}, 0x3, 0x0)
        /Users/qiniu/llcppg/llcppg.go:184 +0x34c
main.main()
        /Users/qiniu/llcppg/llcppg.go:158 +0x37c

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the llcppg generation failure on macOS, then start with setCurFile in cmd/gogensig/convert/convert.go and the callers in gogensig.go and llcppg.go. Trace how SDK header paths enter the FileMap and verify generation against the reported MacOSX and MacOSX13 paths. Done means the missing limits.h case is handled without a panic and generation completes.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.