Skip to content

Commit

Permalink
llcppg&ci:use llgo@main
Browse files Browse the repository at this point in the history
  • Loading branch information
luoliwoshang committed Jan 10, 2025
1 parent 29aa45c commit 3d519d3
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 9 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.23'

- name: Install dependencies
if: startsWith(matrix.os, 'macos')
Expand All @@ -44,18 +44,26 @@ jobs:
echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-${{matrix.llvm}} main" | sudo tee /etc/apt/sources.list.d/llvm.list
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y llvm-${{matrix.llvm}}-dev clang-${{matrix.llvm}} libclang-${{matrix.llvm}}-dev lld-${{matrix.llvm}} pkg-config libgc-dev libssl-dev zlib1g-dev libffi-dev libcjson-dev
sudo apt-get install -y llvm-${{matrix.llvm}}-dev clang-${{matrix.llvm}} libunwind-dev libclang-${{matrix.llvm}}-dev lld-${{matrix.llvm}} pkg-config libgc-dev libssl-dev zlib1g-dev libffi-dev libcjson-dev
echo "/usr/lib/llvm-${{matrix.llvm}}/bin" >> $GITHUB_PATH
- name: Install LLGO
run: |
go install github.com/goplus/llgo/cmd/llgo@latest
git clone https://github.com/goplus/llgo.git
echo $PWD
cd llgo/compiler
go install -v ./cmd/...
export LLGO_ROOT=$GITHUB_WORKSPACE/llgo
echo "LLGO_ROOT=$LLGO_ROOT" >> $GITHUB_ENV
- name: Build
run: go build -v ./...

- name: Install llcppg modules
run: bash ./install.sh
run: |
echo "Using LLGO_ROOT: $LLGO_ROOT"
bash ./install.sh
- name: Test llcppsymg & llcppsigfetch
run: |
Expand All @@ -64,7 +72,18 @@ jobs:
# llgo cmptest ./_xtool/llcppsymg/_cmptest/... causes
# panic: runtime error: index out of range [0] with length 0
cd _xtool/llcppsymg/_cmptest
llgo cmptest ./...
# llgo cmptest ./... cause lld: error: undefined symbol: sort.init
# https://github.com/goplus/llgo/issues/944
llgo cmptest ./args_test
llgo cmptest ./clangutils_test
llgo cmptest ./config_test
llgo cmptest ./names_test
llgo cmptest ./parse_test
llgo cmptest ./symbol_test
llgo cmptest ./symg_test
cd ../../../
- name: Test
Expand Down
2 changes: 1 addition & 1 deletion cmd/gogensig/convert/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ func ModInit(name string) (string, error) {
if err != nil {
return "", err
}
err = config.RunCommand(outputDir, "go", "get", "github.com/goplus/llgo@latest")
err = config.RunCommand(outputDir, "go", "get", "github.com/goplus/llgo@main")
if err != nil {
return "", err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/gogensig/gogensig.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,5 @@ func runGoCmds(wd, pkg string) error {
return err
}

return config.RunCommand(dir, "go", "get", "github.com/goplus/llgo@latest")
return config.RunCommand(dir, "go", "get", "github.com/goplus/llgo@main")
}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ go 1.20

require (
github.com/google/go-cmp v0.6.0
github.com/goplus/gogen v1.16.3
github.com/goplus/llgo v0.9.9-0.20241220231339-070d64f365ef
github.com/goplus/gogen v1.16.4
github.com/goplus/llgo v0.9.10-0.20250110015923-745eff07836d
github.com/goplus/mod v0.13.12
)

Expand Down

0 comments on commit 3d519d3

Please sign in to comment.