Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .claude/skills/update-llgo-version.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
---
name: update-llgo-version
description: Update the github.com/goplus/llgo dependency version across the llcppg project — Go module, CI workflows, and setup action. Use this skill whenever the user asks to bump, update, or upgrade the llgo version, or mentions changing the llgo dependency, even if they don't use the exact phrase "update llgo version".
description: Update the github.com/xgo-dev/llgo dependency version across the llcppg project — Go module, CI workflows, and setup action. Use this skill whenever the user asks to bump, update, or upgrade the llgo version, or mentions changing the llgo dependency, even if they don't use the exact phrase "update llgo version".
---

# Update LLGo Version

Update `github.com/goplus/llgo` to a new version across the entire project. Six files reference the llgo version and they all need to stay in sync.
Update `github.com/xgo-dev/llgo` to a new version across the entire project. Six files reference the llgo version and they all need to stay in sync.

## Instructions

Given a target version (e.g., `v0.14.0`):

### Step 1: Detect the current version

Read `go.mod` and note the current `github.com/goplus/llgo` version — you'll need it for the commit message.
Read `go.mod` and note the current `github.com/xgo-dev/llgo` version — you'll need it for the commit message.

### Step 2: Update Go module dependency

Use `go get` to update the module dependency, then tidy:

```bash
go get github.com/goplus/llgo@<target_version>
go get github.com/xgo-dev/llgo@<target_version>
go mod tidy
```

Expand Down Expand Up @@ -56,7 +56,7 @@ These are the fast unit tests. If they pass, the version bump is safe to commit.
## Commit Convention

```
build(deps): bump github.com/goplus/llgo from <old_version> to <new_version>
build(deps): bump github.com/xgo-dev/llgo from <old_version> to <new_version>
```

Replace `<old_version>` with the version you noted in Step 1 and `<new_version>` with the target version.
4 changes: 2 additions & 2 deletions .github/actions/setup-llcppg/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ description: "Install dependencies, set up Go, download LLGo release, install ll
inputs:
go:
description: "Go version to install"
default: "1.23"
default: "1.27"
llvm:
description: "LLVM version to install (e.g. 18)"
default: "19"
llgo:
description: "LLGo version to download (e.g. v0.13.0)"
default: "v0.13.0"
default: "v1.0.1"
runs:
using: "composite"
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-llcppg/download-llgo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ esac
# Remove 'v' prefix from version if present
VERSION_NUMBER="${VERSION#v}"
FILENAME="llgo${VERSION_NUMBER}.${OS}-${ARCH}.tar.gz"
URL="https://github.com/goplus/llgo/releases/download/${VERSION}/${FILENAME}"
URL="https://github.com/xgo-dev/llgo/releases/download/${VERSION}/${FILENAME}"

echo "Downloading LLGo ${VERSION} for ${OS}-${ARCH}..."
echo "URL: $URL"
Expand Down
4 changes: 2 additions & 2 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Always reference these instructions first and fallback to search or bash command
## Working Effectively

### Bootstrap Dependencies and Build
llcppg requires LLGo (https://github.com/goplus/llgo) and specific LLVM version. Follow these exact steps:
llcppg requires LLGo (https://github.com/xgo-dev/llgo) and specific LLVM version. Follow these exact steps:

- Install system dependencies (Ubuntu/Linux):
```bash
Expand All @@ -25,7 +25,7 @@ llcppg requires LLGo (https://github.com/goplus/llgo) and specific LLVM version.

- Clone and install LLGo (CRITICAL dependency):
```bash
git clone https://github.com/goplus/llgo.git .llgo
git clone https://github.com/xgo-dev/llgo.git .llgo
cd .llgo
git checkout 298669b02c41190b2be623fcacace56a01ced3d7
go install -v ./cmd/llgo/...
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/end2end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
strategy:
matrix:
os:
- macos-15-intel
- macos-latest
- ubuntu-latest
- ubuntu-24.04-arm
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/gentest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ jobs:
strategy:
matrix:
os:
- macos-15-intel
- macos-latest
- ubuntu-latest
- ubuntu-24.04-arm
llvm: [19]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
uses: codecov/codecov-action@v5
with:
token: ${{secrets.CODECOV_TOKEN}}
slug: goplus/llcppg
slug: xgo-dev/llcppg

- name: Test demos
run: bash .github/workflows/test_demo.sh
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
llcppg - LLGo autogen tool for C/C++ libraries
====

[![Build Status](https://github.com/goplus/llcppg/actions/workflows/go.yml/badge.svg)](https://github.com/goplus/llcppg/actions/workflows/go.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/goplus/llcppg)](https://goreportcard.com/report/github.com/goplus/llcppg)
[![GitHub release](https://img.shields.io/github/v/tag/goplus/llcppg.svg?label=release)](https://github.com/goplus/llcppg/releases)
[![Coverage Status](https://codecov.io/gh/goplus/llcppg/branch/main/graph/badge.svg)](https://codecov.io/gh/goplus/llcppg)
[![Language](https://img.shields.io/badge/language-XGo-blue.svg)](https://github.com/goplus/gop)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/goplus/llcppg)
[![Build Status](https://github.com/xgo-dev/llcppg/actions/workflows/go.yml/badge.svg)](https://github.com/xgo-dev/llcppg/actions/workflows/go.yml)
[![GitHub release](https://img.shields.io/github/v/tag/xgo-dev/llcppg.svg?label=release)](https://github.com/xgo-dev/llcppg/releases)
[![Coverage Status](https://codecov.io/gh/xgo-dev/llcppg/branch/main/graph/badge.svg)](https://codecov.io/gh/xgo-dev/llcppg)
[![GoDoc](https://pkg.go.dev/badge/github.com/xgo-dev/llcppg.svg)](https://pkg.go.dev/github.com/xgo-dev/llcppg)
[![XGo](https://img.shields.io/badge/project-XGo-blue.svg)](https://github.com/goplus/xgo)

llcppg aims to be a tool for automatically generating LLGo bindings for C/C++ libraries, enhancing the experience of integrating LLGo with C!
It is worth mentioning that the full llcppg package-generation pipeline is now built and orchestrated with LLGo.
Expand All @@ -17,7 +16,7 @@ This project depends on LLGo's C ecosystem integration capability, and the curre
llcppg currently follows the latest LLGo main-branch behavior. Please build and install LLGo from the `main` branch first, then install llcppg.

For LLGo installation, please refer to:
https://github.com/goplus/llgo?tab=readme-ov-file#how-to-install
https://github.com/xgo-dev/llgo?tab=readme-ov-file#how-to-install

```bash
llgo install ./cmd/llcppg
Expand Down Expand Up @@ -337,14 +336,14 @@ When a header file in the current project references types from third-party pack
* Otherwise, the user is notified of the missing type and its source header file for conversion.

#### Special Dependency Aliases
In llcppg, there is a consistent pattern for naming aliases related to the standard library. Any alias that starts with `c/` corresponds to a remote repository in the github.com/goplus/llgo.
In llcppg, there is a consistent pattern for naming aliases related to the standard library. Any alias that starts with `c/` corresponds to a remote repository in the github.com/xgo-dev/llgo.

For example:
* The alias `c` → `github.com/goplus/lib/c`
* The alias `c/os` → `github.com/goplus/lib/c/os`
* The alias `c/time` → `github.com/goplus/lib/c/time`

> Note: Standard library type conversion in LLGo is not comprehensive. For standard library types that cannot be found in LLGo, you will need to supplement these types in the corresponding package at https://github.com/goplus/llgo.
> Note: Standard library type conversion in LLGo is not comprehensive. For standard library types that cannot be found in LLGo, you will need to supplement these types in the corresponding package at https://github.com/xgo-dev/llgo.

#### Example
You can specify dependent package paths in the `deps` field of `llcppg.cfg`. For example, in the `_llcppgtest/libxslt` example, since libxslt depends on libxml2, its configuration file looks like this:
Expand Down
11 changes: 7 additions & 4 deletions _cmptest/go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
module github.com/goplus/llcppg/_cmptest
module github.com/xgo-dev/llcppg/_cmptest

go 1.23.4
go 1.27.0

require github.com/goplus/llpkgstore v0.0.0-20250514100530-dd449df83ebf
require (
github.com/goplus/llpkgstore v0.0.0-20250514100530-dd449df83ebf
github.com/xgo-dev/llcppg v0.0.0-00010101000000-000000000000
)

require github.com/goplus/llcppg v0.5.0
replace github.com/xgo-dev/llcppg => ../
2 changes: 0 additions & 2 deletions _cmptest/go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
github.com/goplus/llcppg v0.5.0 h1:IP4KUDOVw/JrkNvmCKbm9Kcv1lRIwPqeudSnt+nPC3g=
github.com/goplus/llcppg v0.5.0/go.mod h1:hC3O+B4dw6yQqjn+LpBC7Pw9eTPaDW+wXEfeAOyTqRo=
github.com/goplus/llpkgstore v0.0.0-20250514100530-dd449df83ebf h1:l/RnlMqN7Fv7jlhHC6iqbjlUZ+NXZjcr4e987S6cqlE=
github.com/goplus/llpkgstore v0.0.0-20250514100530-dd449df83ebf/go.mod h1:4VvozCteCpzqcoFbHW0dOcCjk3A7scMD9gCxjFggTkc=
24 changes: 12 additions & 12 deletions _cmptest/llcppgend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"sync"
"testing"

"github.com/goplus/llcppg/config"
"github.com/goplus/llpkgstore/upstream"
"github.com/goplus/llpkgstore/upstream/installer/conan"
"github.com/xgo-dev/llcppg/config"
)

const llcppgGoVersion = "1.20.14"
Expand All @@ -34,7 +34,7 @@ type testCase struct {

var testCases = []testCase{
{
modpath: "github.com/goplus/llcppg/_cmptest/testdata/cjson/1.7.18/cjson",
modpath: "github.com/xgo-dev/llcppg/_cmptest/testdata/cjson/1.7.18/cjson",
dir: "./testdata/cjson/1.7.18",
pkg: upstream.Package{Name: "cjson", Version: "1.7.18"},
config: map[string]string{
Expand All @@ -43,7 +43,7 @@ var testCases = []testCase{
demosDir: "./testdata/cjson/demo",
},
{
modpath: "github.com/goplus/llcppg/_cmptest/testdata/cjson/1.7.17/cjson",
modpath: "github.com/xgo-dev/llcppg/_cmptest/testdata/cjson/1.7.17/cjson",
dir: "./testdata/cjson/1.7.17",
pkg: upstream.Package{Name: "cjson", Version: "1.7.17"},
config: map[string]string{
Expand All @@ -52,7 +52,7 @@ var testCases = []testCase{
demosDir: "./testdata/cjson/demo",
},
{
modpath: "github.com/goplus/llcppg/_cmptest/testdata/libxml2/2.13.6/libxml2",
modpath: "github.com/xgo-dev/llcppg/_cmptest/testdata/libxml2/2.13.6/libxml2",
dir: "./testdata/libxml2/2.13.6",
pkg: upstream.Package{Name: "libxml2", Version: "2.13.6"},
config: map[string]string{
Expand All @@ -61,44 +61,44 @@ var testCases = []testCase{
demosDir: "./testdata/libxml2/demo",
},
{
modpath: "github.com/goplus/llcppg/_cmptest/testdata/sqlite3/3.49.1/sqlite3",
modpath: "github.com/xgo-dev/llcppg/_cmptest/testdata/sqlite3/3.49.1/sqlite3",
dir: "./testdata/sqlite3/3.49.1",
pkg: upstream.Package{Name: "sqlite3", Version: "3.49.1"},
demosDir: "./testdata/sqlite3/demo",
},
{
modpath: "github.com/goplus/llcppg/_cmptest/testdata/zlib/1.3.1/zlib",
modpath: "github.com/xgo-dev/llcppg/_cmptest/testdata/zlib/1.3.1/zlib",
dir: "./testdata/zlib/1.3.1",
pkg: upstream.Package{Name: "zlib", Version: "1.3.1"},
demosDir: "./testdata/zlib/demo",
},
{
modpath: "github.com/goplus/llcppg/_cmptest/testdata/bzip3/1.5.1/bzip3",
modpath: "github.com/xgo-dev/llcppg/_cmptest/testdata/bzip3/1.5.1/bzip3",
dir: "./testdata/bzip3/1.5.1",
pkg: upstream.Package{Name: "bzip3", Version: "1.5.1"},
demosDir: "./testdata/bzip3/demo",
},
{
modpath: "github.com/goplus/llcppg/_cmptest/testdata/cargs/1.2.0/cargs",
modpath: "github.com/xgo-dev/llcppg/_cmptest/testdata/cargs/1.2.0/cargs",
dir: "./testdata/cargs/1.2.0",
pkg: upstream.Package{Name: "cargs", Version: "1.2.0"},
demosDir: "./testdata/cargs/demo",
},
{
modpath: "github.com/goplus/llcppg/_cmptest/testdata/bzip2/1.0.8/bzip2",
modpath: "github.com/xgo-dev/llcppg/_cmptest/testdata/bzip2/1.0.8/bzip2",
dir: "./testdata/bzip2/1.0.8",
pkg: upstream.Package{Name: "bzip2", Version: "1.0.8"},
demosDir: "./testdata/bzip2/demo",
},
{
modpath: "github.com/goplus/llcppg/_cmptest/testdata/libxslt/1.1.42/libxslt",
modpath: "github.com/xgo-dev/llcppg/_cmptest/testdata/libxslt/1.1.42/libxslt",
dir: "./testdata/libxslt/1.1.42",
pkg: upstream.Package{Name: "libxslt", Version: "1.1.42"},
demosDir: "./testdata/libxslt/demo",
},

{
modpath: "github.com/goplus/llcppg/_cmptest/testdata/libtool/2.4.7/libtool",
modpath: "github.com/xgo-dev/llcppg/_cmptest/testdata/libtool/2.4.7/libtool",
dir: "./testdata/libtool/2.4.7",
pkg: upstream.Package{Name: "libtool", Version: "2.4.7"},
demosDir: "./testdata/libtool/demo",
Expand Down Expand Up @@ -312,7 +312,7 @@ func appendPCPath(path string) string {
// llgo env
func llgoEnv() []string {
return []string{
// for https://github.com/goplus/llgo/issues/1135
// for https://github.com/xgo-dev/llgo/issues/1135
"LLGO_RPATH_CHANGE=on",
}
}
Expand Down
2 changes: 1 addition & 1 deletion _cmptest/testdata/bzip2/1.0.8/bzip2/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/goplus/llcppg/_cmptest/testdata/bzip2/1.0.8/bzip2
module github.com/xgo-dev/llcppg/_cmptest/testdata/bzip2/1.0.8/bzip2

go 1.20

Expand Down
2 changes: 1 addition & 1 deletion _cmptest/testdata/bzip3/1.5.1/bzip3/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/goplus/llcppg/_cmptest/testdata/bzip3/1.5.1/bzip3
module github.com/xgo-dev/llcppg/_cmptest/testdata/bzip3/1.5.1/bzip3

go 1.20

Expand Down
2 changes: 1 addition & 1 deletion _cmptest/testdata/cargs/1.2.0/cargs/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/goplus/llcppg/_cmptest/testdata/cargs/1.2.0/cargs
module github.com/xgo-dev/llcppg/_cmptest/testdata/cargs/1.2.0/cargs

go 1.20

Expand Down
2 changes: 1 addition & 1 deletion _cmptest/testdata/cjson/1.7.17/cjson/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/goplus/llcppg/_cmptest/testdata/cjson/1.7.17/cjson
module github.com/xgo-dev/llcppg/_cmptest/testdata/cjson/1.7.17/cjson

go 1.20

Expand Down
2 changes: 1 addition & 1 deletion _cmptest/testdata/cjson/1.7.18/cjson/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/goplus/llcppg/_cmptest/testdata/cjson/1.7.18/cjson
module github.com/xgo-dev/llcppg/_cmptest/testdata/cjson/1.7.18/cjson

go 1.20

Expand Down
2 changes: 1 addition & 1 deletion _cmptest/testdata/libtool/2.4.7/libtool/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/goplus/llcppg/_cmptest/testdata/libtool/2.4.7/libtool
module github.com/xgo-dev/llcppg/_cmptest/testdata/libtool/2.4.7/libtool

go 1.20

Expand Down
2 changes: 1 addition & 1 deletion _cmptest/testdata/libxml2/2.13.6/libxml2/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/goplus/llcppg/_cmptest/testdata/libxml2/2.13.6/libxml2
module github.com/xgo-dev/llcppg/_cmptest/testdata/libxml2/2.13.6/libxml2

go 1.20

Expand Down
3 changes: 2 additions & 1 deletion _cmptest/testdata/libxslt/1.1.42/libxslt/attributes.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package libxslt

import (
"github.com/goplus/llcppg/_cmptest/testdata/libxml2/2.13.6/libxml2"
_ "unsafe"

"github.com/xgo-dev/llcppg/_cmptest/testdata/libxml2/2.13.6/libxml2"
)

//go:linkname ParseStylesheetAttributeSet C.xsltParseStylesheetAttributeSet
Expand Down
5 changes: 3 additions & 2 deletions _cmptest/testdata/libxslt/1.1.42/libxslt/documents.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package libxslt

import (
"github.com/goplus/lib/c"
"github.com/goplus/llcppg/_cmptest/testdata/libxml2/2.13.6/libxml2"
_ "unsafe"

"github.com/goplus/lib/c"
"github.com/xgo-dev/llcppg/_cmptest/testdata/libxml2/2.13.6/libxml2"
)

//go:linkname NewDocument C.xsltNewDocument
Expand Down
5 changes: 3 additions & 2 deletions _cmptest/testdata/libxslt/1.1.42/libxslt/extensions.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package libxslt

import (
"github.com/goplus/lib/c"
"github.com/goplus/llcppg/_cmptest/testdata/libxml2/2.13.6/libxml2"
_ "unsafe"

"github.com/goplus/lib/c"
"github.com/xgo-dev/llcppg/_cmptest/testdata/libxml2/2.13.6/libxml2"
)

/**
Expand Down
5 changes: 3 additions & 2 deletions _cmptest/testdata/libxslt/1.1.42/libxslt/extra.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package libxslt

import (
"github.com/goplus/lib/c"
"github.com/goplus/llcppg/_cmptest/testdata/libxml2/2.13.6/libxml2"
_ "unsafe"

"github.com/goplus/lib/c"
"github.com/xgo-dev/llcppg/_cmptest/testdata/libxml2/2.13.6/libxml2"
)

//go:linkname FunctionNodeSet C.xsltFunctionNodeSet
Expand Down
5 changes: 3 additions & 2 deletions _cmptest/testdata/libxslt/1.1.42/libxslt/functions.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package libxslt

import (
"github.com/goplus/lib/c"
"github.com/goplus/llcppg/_cmptest/testdata/libxml2/2.13.6/libxml2"
_ "unsafe"

"github.com/goplus/lib/c"
"github.com/xgo-dev/llcppg/_cmptest/testdata/libxml2/2.13.6/libxml2"
)

//go:linkname XPathFunctionLookup C.xsltXPathFunctionLookup
Expand Down
4 changes: 2 additions & 2 deletions _cmptest/testdata/libxslt/1.1.42/libxslt/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/goplus/llcppg/_cmptest/testdata/libxslt/1.1.42/libxslt
module github.com/xgo-dev/llcppg/_cmptest/testdata/libxslt/1.1.42/libxslt

go 1.20

require (
github.com/goplus/lib v0.3.1
github.com/goplus/llcppg/_cmptest/testdata/libxml2/2.13.6/libxml2 v0.0.0-20250605025807-6b6057874bf2
github.com/xgo-dev/llcppg/_cmptest/testdata/libxml2/2.13.6/libxml2 v0.0.0-20250605025807-6b6057874bf2
)
4 changes: 2 additions & 2 deletions _cmptest/testdata/libxslt/1.1.42/libxslt/go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github.com/goplus/lib v0.3.1 h1:Xws4DBVvgOMu58awqB972wtvTacDbk3nqcbHjdx9KSg=
github.com/goplus/lib v0.3.1/go.mod h1:SgJv3oPqLLHCu0gcL46ejOP3x7/2ry2Jtxu7ta32kp0=
github.com/goplus/llcppg/_cmptest/testdata/libxml2/2.13.6/libxml2 v0.0.0-20250605025807-6b6057874bf2 h1:zSC9XzQPizHzBfrFWYghjeYdjPjQpnSBKp63ELYNIxg=
github.com/goplus/llcppg/_cmptest/testdata/libxml2/2.13.6/libxml2 v0.0.0-20250605025807-6b6057874bf2/go.mod h1:0097o+5eelN3faOgyaWK3xXBqzYU68VCGLjbPyXtB0c=
github.com/xgo-dev/llcppg/_cmptest/testdata/libxml2/2.13.6/libxml2 v0.0.0-20250605025807-6b6057874bf2 h1:zSC9XzQPizHzBfrFWYghjeYdjPjQpnSBKp63ELYNIxg=
github.com/xgo-dev/llcppg/_cmptest/testdata/libxml2/2.13.6/libxml2 v0.0.0-20250605025807-6b6057874bf2/go.mod h1:0097o+5eelN3faOgyaWK3xXBqzYU68VCGLjbPyXtB0c=
Loading
Loading