From 252e58289a62394c4b611532913deced4c9f3749 Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Thu, 21 Aug 2025 12:08:42 +0800 Subject: [PATCH 1/3] update: llgo dependency to commit 6de3bdcdd9b3959d244e7b3b7e97fc4e3408cd78 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updates both go.mod and CI workflows to use the latest llgo version. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/end2end.yml | 2 +- .github/workflows/gentest.yml | 2 +- .github/workflows/go.yml | 2 +- go.mod | 4 ++-- go.sum | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/end2end.yml b/.github/workflows/end2end.yml index c49aaa57..e5226966 100644 --- a/.github/workflows/end2end.yml +++ b/.github/workflows/end2end.yml @@ -17,7 +17,7 @@ jobs: - ubuntu-24.04 - ubuntu-24.04-arm llvm: [19] - llgo: [f0728c4fe028fbc72455c1242cef638ebdf60454] + llgo: [6de3bdcdd9b3959d244e7b3b7e97fc4e3408cd78] go: [1.23] fail-fast: false runs-on: ${{matrix.os}} diff --git a/.github/workflows/gentest.yml b/.github/workflows/gentest.yml index f1a11e07..3909767c 100644 --- a/.github/workflows/gentest.yml +++ b/.github/workflows/gentest.yml @@ -17,7 +17,7 @@ jobs: - ubuntu-24.04 - ubuntu-24.04-arm llvm: [19] - llgo: [f0728c4fe028fbc72455c1242cef638ebdf60454] + llgo: [6de3bdcdd9b3959d244e7b3b7e97fc4e3408cd78] go: [1.23] fail-fast: false runs-on: ${{matrix.os}} diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 7825e034..048b8216 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -18,7 +18,7 @@ jobs: - macos-latest - ubuntu-24.04 llvm: [19] - llgo: [f0728c4fe028fbc72455c1242cef638ebdf60454] + llgo: [6de3bdcdd9b3959d244e7b3b7e97fc4e3408cd78] go: [1.23] fail-fast: false runs-on: ${{matrix.os}} diff --git a/go.mod b/go.mod index e8854b56..a0158bcd 100644 --- a/go.mod +++ b/go.mod @@ -5,9 +5,9 @@ go 1.23.0 require ( github.com/goplus/gogen v1.19.1 github.com/goplus/lib v0.2.0 - github.com/goplus/llgo v0.11.6-0.20250612045535-26aaa65c1d58 + github.com/goplus/llgo v0.11.6-0.20250821034534-6de3bdcdd9b3 github.com/goplus/mod v0.17.1 github.com/qiniu/x v1.15.1 ) -require golang.org/x/mod v0.25.0 // indirect +require golang.org/x/mod v0.27.0 // indirect diff --git a/go.sum b/go.sum index 71744c7a..38e5e111 100644 --- a/go.sum +++ b/go.sum @@ -2,11 +2,11 @@ github.com/goplus/gogen v1.19.1 h1:L7jz60azeowj8zUq48tozETriTPBLqHb0nDj6PheANc= github.com/goplus/gogen v1.19.1/go.mod h1:owX2e1EyU5WD+Nm6oH2m/GXjLdlBYcwkLO4wN8HHXZI= github.com/goplus/lib v0.2.0 h1:AjqkN1XK5H23wZMMlpaUYAMCDAdSBQ2NMFrLtSh7W4g= github.com/goplus/lib v0.2.0/go.mod h1:SgJv3oPqLLHCu0gcL46ejOP3x7/2ry2Jtxu7ta32kp0= -github.com/goplus/llgo v0.11.6-0.20250612045535-26aaa65c1d58 h1:q0Soyx8ym0wLaEJ/MrnERVrj/kgTJsGFqLMJoWqc6BY= -github.com/goplus/llgo v0.11.6-0.20250612045535-26aaa65c1d58/go.mod h1:blQqJ5hyxAuV7HFQCseqsNYfg/tfJu49wlmvkXLHqu0= +github.com/goplus/llgo v0.11.6-0.20250821034534-6de3bdcdd9b3 h1:2K/r3G4fGV8dsPp5XKXNBTqPsiJ2b7ng49e3jHeEyLU= +github.com/goplus/llgo v0.11.6-0.20250821034534-6de3bdcdd9b3/go.mod h1:IyNrokgi/szFv1Zcqv9nQTDIfUmoccizneyIXstqv2Y= github.com/goplus/mod v0.17.1 h1:ITovxDcc5zbURV/Wrp3/SBsYLgC1KrxY6pq1zMM2V94= github.com/goplus/mod v0.17.1/go.mod h1:iXEszBKqi38BAyQApBPyQeurLHmQN34YMgC2ZNdap50= github.com/qiniu/x v1.15.1 h1:avE+YQaowp8ZExjylOeSM73rUo3MQKBAYVxh4NJ8dY8= github.com/qiniu/x v1.15.1/go.mod h1:AiovSOCaRijaf3fj+0CBOpR1457pn24b0Vdb1JpwhII= -golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= -golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= +golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= From e0fb166b889c738ee0fbad1d357fbdfb14b060de Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Thu, 21 Aug 2025 15:58:11 +0800 Subject: [PATCH 2/3] abi=0 --- .github/actions/setup-llcppg/action.yml | 2 +- .github/workflows/go.yml | 105 ++++++++++++------------ .github/workflows/test_demo.sh | 6 +- _cmptest/llcppgend_test.go | 2 +- cmd/llcppgtest/demo/demo.go | 2 +- 5 files changed, 58 insertions(+), 59 deletions(-) diff --git a/.github/actions/setup-llcppg/action.yml b/.github/actions/setup-llcppg/action.yml index cb2b545e..490951eb 100644 --- a/.github/actions/setup-llcppg/action.yml +++ b/.github/actions/setup-llcppg/action.yml @@ -47,7 +47,7 @@ runs: shell: bash working-directory: .llgo run: | - go install -v ./cmd/llgo/... + go install -tags=dev -v ./cmd/llgo/... export LLGO_ROOT=$GITHUB_WORKSPACE/.llgo echo "LLGO_ROOT=$LLGO_ROOT" >> $GITHUB_ENV - name: Build diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 048b8216..6653a126 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -5,12 +5,11 @@ name: Go on: push: - branches: [ "**" ] + branches: ["**"] pull_request: - branches: [ "**" ] + branches: ["**"] jobs: - test: strategy: matrix: @@ -23,62 +22,62 @@ jobs: fail-fast: false runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v5 - - name: Setup llcppg environment - uses: ./.github/actions/setup-llcppg - with: - go: ${{ matrix.go }} - llvm: ${{ matrix.llvm }} - llgo: ${{ matrix.llgo }} + - uses: actions/checkout@v5 + - name: Setup llcppg environment + uses: ./.github/actions/setup-llcppg + with: + go: ${{ matrix.go }} + llvm: ${{ matrix.llvm }} + llgo: ${{ matrix.llgo }} - - name: Setup Test Dependencies - if: startsWith(matrix.os, 'macos') - run: brew install cjson + - name: Setup Test Dependencies + if: startsWith(matrix.os, 'macos') + run: brew install cjson - - name: Setup Test Dependencies - if: startsWith(matrix.os, 'ubuntu') - run: sudo apt install libcjson-dev + - name: Setup Test Dependencies + if: startsWith(matrix.os, 'ubuntu') + run: sudo apt install libcjson-dev - # only can compile with llgo - - name: Test xtool - run: | - llgo test ./_xtool/internal/... + # only can compile with llgo + - name: Test xtool + run: | + llgo test -abi=0 ./_xtool/internal/... - # only can compile with llgo - - name: Test llcppsymg & llcppsigfetch - run: | - llgo test ./_xtool/llcppsigfetch/internal/... - llgo test ./_xtool/llcppsymg/internal/... + # only can compile with llgo + - name: Test llcppsymg & llcppsigfetch + run: | + llgo test -abi=0 ./_xtool/llcppsigfetch/internal/... + llgo test -abi=0 ./_xtool/llcppsymg/internal/... - - name: Test For LLGo and Go - run: | - llgo test ./config - llgo test ./internal/arg - llgo test ./internal/name + - name: Test For LLGo and Go + run: | + llgo test -abi=0 ./config + llgo test -abi=0 ./internal/arg + llgo test -abi=0 ./internal/name - - name: Test - if: ${{!startsWith(matrix.os, 'macos')}} - run: go test -v ./... + - name: Test + if: ${{!startsWith(matrix.os, 'macos')}} + run: go test -v ./... - - name: Test with coverage - if: startsWith(matrix.os, 'macos') - run: go test -v -coverprofile="coverage.txt" -covermode=atomic ./... + - name: Test with coverage + if: startsWith(matrix.os, 'macos') + run: go test -v -coverprofile="coverage.txt" -covermode=atomic ./... - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v5 - with: - token: ${{secrets.CODECOV_TOKEN}} - slug: goplus/llcppg + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{secrets.CODECOV_TOKEN}} + slug: goplus/llcppg - - name: Test demos - run: | - # TODO(lijie): force python3-embed to be linked with python-3.12-embed - # Currently, python3-embed is python-3.13-embed, doesn't work with pytorch - # Will remove this after pytorch is fixed. - pcdir=$HOME/pc - mkdir -p $pcdir - libdir=$(pkg-config --variable=libdir python-3.12-embed) - echo "libdir: $libdir" - ln -s $libdir/pkgconfig/python-3.12-embed.pc $pcdir/python3-embed.pc - export PKG_CONFIG_PATH=$pcdir - bash .github/workflows/test_demo.sh + - name: Test demos + run: | + # TODO(lijie): force python3-embed to be linked with python-3.12-embed + # Currently, python3-embed is python-3.13-embed, doesn't work with pytorch + # Will remove this after pytorch is fixed. + pcdir=$HOME/pc + mkdir -p $pcdir + libdir=$(pkg-config --variable=libdir python-3.12-embed) + echo "libdir: $libdir" + ln -s $libdir/pkgconfig/python-3.12-embed.pc $pcdir/python3-embed.pc + export PKG_CONFIG_PATH=$pcdir + bash .github/workflows/test_demo.sh diff --git a/.github/workflows/test_demo.sh b/.github/workflows/test_demo.sh index 976cbc05..7af685fc 100644 --- a/.github/workflows/test_demo.sh +++ b/.github/workflows/test_demo.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -# llgo run subdirectories under _demo and _pydemo that contain *.go files +# llgo run -abi=0 subdirectories under _demo and _pydemo that contain *.go files total=0 failed=0 failed_cases="" @@ -9,8 +9,8 @@ for d in ./_demo/* ./_pydemo/*; do if [ -d "$d" ] && [ -n "$(ls "$d"/*.go 2>/dev/null)" ]; then total=$((total+1)) echo "Testing $d" - if ! (cd "$d" && llgo run .); then - if ! (go mod tidy && llgo run .); then + if ! (cd "$d" && llgo run -abi=0 .); then + if ! (go mod tidy && llgo run -abi=0 .); then echo "FAIL" failed=$((failed+1)) failed_cases="$failed_cases\n* :x: $d" diff --git a/_cmptest/llcppgend_test.go b/_cmptest/llcppgend_test.go index 6515a137..ba0148d3 100644 --- a/_cmptest/llcppgend_test.go +++ b/_cmptest/llcppgend_test.go @@ -289,7 +289,7 @@ func runDemos(t *testing.T, logFile *os.File, demosPath string, pkgname, pkgpath continue } demoPath := filepath.Join(tempDemosPath, demo.Name()) - demoCmd := command(logFile, demoPath, "llgo", "run", ".") + demoCmd := command(logFile, demoPath, "llgo", "run", "-abi=0", ".") demoCmd.Env = append(demoCmd.Env, llgoEnv()...) demoCmd.Env = append(demoCmd.Env, pcPathEnv(pcPath)...) demoCmd.Env = append(demoCmd.Env, tempDirEnv(llgoRunTempDir)...) diff --git a/cmd/llcppgtest/demo/demo.go b/cmd/llcppgtest/demo/demo.go index 103ec276..04f94332 100644 --- a/cmd/llcppgtest/demo/demo.go +++ b/cmd/llcppgtest/demo/demo.go @@ -182,7 +182,7 @@ func RunGenPkgDemo(demoRoot string, confDir string) error { tempLog, filepath.Join(demosPath, demo.Name()), llgoRunTempDir, - "llgo", "run", "-v", ".", + "llgo", "run", "-abi=0", "-v", ".", ); demoErr != nil { return fmt.Errorf("%s: failed to run demo: %s: %w", demoPkgName, demo.Name(), demoErr) } From 2227d0eed58e988291e8fda3b6c11c67c389bba3 Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Thu, 21 Aug 2025 16:44:32 +0800 Subject: [PATCH 3/3] llgo:component -abi=0 --- .github/workflows/go.yml | 105 ++++++++++++++++++++------------------- install.sh | 4 +- 2 files changed, 55 insertions(+), 54 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6653a126..d68d27e4 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -5,11 +5,12 @@ name: Go on: push: - branches: ["**"] + branches: [ "**" ] pull_request: - branches: ["**"] + branches: [ "**" ] jobs: + test: strategy: matrix: @@ -22,62 +23,62 @@ jobs: fail-fast: false runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v5 - - name: Setup llcppg environment - uses: ./.github/actions/setup-llcppg - with: - go: ${{ matrix.go }} - llvm: ${{ matrix.llvm }} - llgo: ${{ matrix.llgo }} + - uses: actions/checkout@v5 + - name: Setup llcppg environment + uses: ./.github/actions/setup-llcppg + with: + go: ${{ matrix.go }} + llvm: ${{ matrix.llvm }} + llgo: ${{ matrix.llgo }} - - name: Setup Test Dependencies - if: startsWith(matrix.os, 'macos') - run: brew install cjson + - name: Setup Test Dependencies + if: startsWith(matrix.os, 'macos') + run: brew install cjson - - name: Setup Test Dependencies - if: startsWith(matrix.os, 'ubuntu') - run: sudo apt install libcjson-dev + - name: Setup Test Dependencies + if: startsWith(matrix.os, 'ubuntu') + run: sudo apt install libcjson-dev - # only can compile with llgo - - name: Test xtool - run: | - llgo test -abi=0 ./_xtool/internal/... + # only can compile with llgo + - name: Test xtool + run: | + llgo test -abi=0 ./_xtool/internal/... - # only can compile with llgo - - name: Test llcppsymg & llcppsigfetch - run: | - llgo test -abi=0 ./_xtool/llcppsigfetch/internal/... - llgo test -abi=0 ./_xtool/llcppsymg/internal/... + # only can compile with llgo + - name: Test llcppsymg & llcppsigfetch + run: | + llgo test -abi=0 ./_xtool/llcppsigfetch/internal/... + llgo test -abi=0 ./_xtool/llcppsymg/internal/... - - name: Test For LLGo and Go - run: | - llgo test -abi=0 ./config - llgo test -abi=0 ./internal/arg - llgo test -abi=0 ./internal/name + - name: Test For LLGo and Go + run: | + llgo test -abi=0 ./config + llgo test -abi=0 ./internal/arg + llgo test -abi=0 ./internal/name - - name: Test - if: ${{!startsWith(matrix.os, 'macos')}} - run: go test -v ./... + - name: Test + if: ${{!startsWith(matrix.os, 'macos')}} + run: go test -v ./... - - name: Test with coverage - if: startsWith(matrix.os, 'macos') - run: go test -v -coverprofile="coverage.txt" -covermode=atomic ./... + - name: Test with coverage + if: startsWith(matrix.os, 'macos') + run: go test -v -coverprofile="coverage.txt" -covermode=atomic ./... - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v5 - with: - token: ${{secrets.CODECOV_TOKEN}} - slug: goplus/llcppg + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{secrets.CODECOV_TOKEN}} + slug: goplus/llcppg - - name: Test demos - run: | - # TODO(lijie): force python3-embed to be linked with python-3.12-embed - # Currently, python3-embed is python-3.13-embed, doesn't work with pytorch - # Will remove this after pytorch is fixed. - pcdir=$HOME/pc - mkdir -p $pcdir - libdir=$(pkg-config --variable=libdir python-3.12-embed) - echo "libdir: $libdir" - ln -s $libdir/pkgconfig/python-3.12-embed.pc $pcdir/python3-embed.pc - export PKG_CONFIG_PATH=$pcdir - bash .github/workflows/test_demo.sh + - name: Test demos + run: | + # TODO(lijie): force python3-embed to be linked with python-3.12-embed + # Currently, python3-embed is python-3.13-embed, doesn't work with pytorch + # Will remove this after pytorch is fixed. + pcdir=$HOME/pc + mkdir -p $pcdir + libdir=$(pkg-config --variable=libdir python-3.12-embed) + echo "libdir: $libdir" + ln -s $libdir/pkgconfig/python-3.12-embed.pc $pcdir/python3-embed.pc + export PKG_CONFIG_PATH=$pcdir + bash .github/workflows/test_demo.sh \ No newline at end of file diff --git a/install.sh b/install.sh index e2a8f3d5..3fe52df2 100755 --- a/install.sh +++ b/install.sh @@ -6,7 +6,7 @@ go install -v ./cmd/llcppcfg go install -v ./cmd/llcppgtest # main process required -llgo install ./_xtool/llcppsymg -llgo install ./_xtool/llcppsigfetch +llgo install -abi=0 ./_xtool/llcppsymg +llgo install -abi=0 ./_xtool/llcppsigfetch go install -v ./cmd/gogensig go install -v ./cmd/llcppg