Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore:pkg origin; ci:llgo install #3

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
44 changes: 38 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@ name: Go

on:
push:
branches: [ "main" ]
branches: [ "**" ]
pull_request:
branches: [ "main" ]
branches: [ "**" ]

jobs:

build:
runs-on: ubuntu-latest
test:
strategy:
matrix:
os:
- macos-latest
- ubuntu-24.04
llvm: [18]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4

Expand All @@ -21,11 +27,37 @@ jobs:
with:
go-version: '1.20'

- name: Install dependencies
if: startsWith(matrix.os, 'macos')
run: |
brew update
brew install llvm@${{matrix.llvm}} bdw-gc openssl libffi
brew link --force libffi
echo "$(brew --prefix llvm@${{matrix.llvm}})/bin" >> $GITHUB_PATH
# llcppg dependencies
brew install cjson
- name: Install dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
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
echo "/usr/lib/llvm-${{matrix.llvm}}/bin" >> $GITHUB_PATH
- name: Install LLGO
run: |
go install github.com/goplus/llgo/cmd/llgo@main
- name: Build
run: go build -v ./...

- name: Install llcppg dependencies
run: bash .github/workflows/install_llcppg_depend.sh

- name: Test
run: go test -v ./...

# - name: Install llcppg dependencies
# run: bash .github/workflows/install_llcppg_depend.sh

6 changes: 3 additions & 3 deletions .github/workflows/install_llcppg_depend.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
set -e

llgo install ./chore/_xtool/llcppsymg
llgo install ./chore/_xtool/llcppsigfetch
go install ./chore/gogensig
llgo install ./_xtool/llcppsymg
llgo install ./_xtool/llcppsigfetch
go install ./cmd/gogensig
4 changes: 2 additions & 2 deletions _xtool/llcppsigfetch/parse/cvt_test/cvt.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package cvttest
import (
"fmt"

"github.com/goplus/llcppg/_xtool/llcppsigfetch/parse"
"github.com/goplus/llcppg/_xtool/llcppsymg/clangutils"
"github.com/goplus/llgo/c"
"github.com/goplus/llgo/c/cjson"
"github.com/goplus/llgo/c/clang"
"github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/clangutils"
)

func RunTest(testName string, testCases []string) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import test "github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse/cvt_test"
import test "github.com/goplus/llcppg/_xtool/llcppsigfetch/parse/cvt_test"

func main() {
TestClassDecl()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import test "github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse/cvt_test"
import test "github.com/goplus/llcppg/_xtool/llcppsigfetch/parse/cvt_test"

func main() {
TestDoc()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import test "github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse/cvt_test"
import test "github.com/goplus/llcppg/_xtool/llcppsigfetch/parse/cvt_test"

func main() {
TestEnumDecl()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import test "github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse/cvt_test"
import test "github.com/goplus/llcppg/_xtool/llcppsigfetch/parse/cvt_test"

func main() {
TestFuncDecl()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import test "github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse/cvt_test"
import test "github.com/goplus/llcppg/_xtool/llcppsigfetch/parse/cvt_test"

func main() {
TestScope()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import test "github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse/cvt_test"
import test "github.com/goplus/llcppg/_xtool/llcppsigfetch/parse/cvt_test"

func main() {
TestStructDecl()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import test "github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse/cvt_test"
import test "github.com/goplus/llcppg/_xtool/llcppsigfetch/parse/cvt_test"

func main() {
TestTypeDefDecl()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import test "github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse/cvt_test"
import test "github.com/goplus/llcppg/_xtool/llcppsigfetch/parse/cvt_test"

func main() {
TestUnionDecl()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package main

import (
test "github.com/goplus/llcppg/_xtool/llcppsigfetch/parse/cvt_test"
"github.com/goplus/llcppg/_xtool/llcppsymg/clangutils"
"github.com/goplus/llgo/c"
test "github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse/cvt_test"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/clangutils"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions _xtool/llcppsigfetch/parse/cvt_test/type_test/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"fmt"
"os"

"github.com/goplus/llcppg/_xtool/llcppsigfetch/parse"
test "github.com/goplus/llcppg/_xtool/llcppsigfetch/parse/cvt_test"
"github.com/goplus/llcppg/ast"
"github.com/goplus/llgo/c"
"github.com/goplus/llgo/c/cjson"
"github.com/goplus/llgo/c/clang"
"github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse"
test "github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse/cvt_test"
"github.com/goplus/llgo/chore/llcppg/ast"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion _xtool/llcppsigfetch/parse/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"os"

"github.com/goplus/llgo/c/cjson"
"github.com/goplus/llcppg/_xtool/llcppsymg/clangutils"
"github.com/goplus/llgo/c/cjson"
)

type dbgFlags = int
Expand Down
2 changes: 1 addition & 1 deletion _xtool/llcppsymg/_cmptest/args_test/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/goplus/llgo/chore/_xtool/llcppsymg/args"
"github.com/goplus/llcppg/_xtool/llcppsymg/args"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion _xtool/llcppsymg/_cmptest/clangutils_test/clangutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"os"

"github.com/goplus/llcppg/_xtool/llcppsymg/clangutils"
"github.com/goplus/llgo/c"
"github.com/goplus/llgo/c/clang"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/clangutils"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions _xtool/llcppsymg/_cmptest/config_test/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"runtime"
"strings"

"github.com/goplus/llgo/chore/_xtool/llcppsymg/config"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/config/cfgparse"
"github.com/goplus/llcppg/_xtool/llcppsymg/config"
"github.com/goplus/llcppg/_xtool/llcppsymg/config/cfgparse"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion _xtool/llcppsymg/_cmptest/parse_test/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"sort"

"github.com/goplus/llgo/chore/_xtool/llcppsymg/parse"
"github.com/goplus/llcppg/_xtool/llcppsymg/parse"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions _xtool/llcppsymg/_cmptest/symbol_test/symbol.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"os"
"sort"

"github.com/goplus/llgo/chore/_xtool/llcppsymg/parse"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/symbol"
"github.com/goplus/llgo/chore/llcppg/types"
"github.com/goplus/llcppg/_xtool/llcppsymg/parse"
"github.com/goplus/llcppg/_xtool/llcppsymg/symbol"
"github.com/goplus/llcppg/types"
"github.com/goplus/llgo/xtool/nm"
)

Expand Down
4 changes: 2 additions & 2 deletions _xtool/llcppsymg/_cmptest/symg_test/symg.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"os"

"github.com/goplus/llgo/chore/_xtool/llcppsymg/parse"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/symbol"
"github.com/goplus/llcppg/_xtool/llcppsymg/parse"
"github.com/goplus/llcppg/_xtool/llcppsymg/symbol"
"github.com/goplus/llgo/xtool/nm"
)

Expand Down
2 changes: 1 addition & 1 deletion _xtool/llcppsymg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"errors"
"unsafe"

"github.com/goplus/llcppg/types"
"github.com/goplus/llgo/c"
"github.com/goplus/llgo/c/cjson"
"github.com/goplus/llgo/chore/llcppg/types"
)

type Conf struct {
Expand Down
10 changes: 5 additions & 5 deletions _xtool/llcppsymg/llcppsymg.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
"io"
"os"

"github.com/goplus/llgo/chore/_xtool/llcppsymg/args"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/config"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/config/cfgparse"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/parse"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/symbol"
"github.com/goplus/llcppg/_xtool/llcppsymg/args"
"github.com/goplus/llcppg/_xtool/llcppsymg/config"
"github.com/goplus/llcppg/_xtool/llcppsymg/config/cfgparse"
"github.com/goplus/llcppg/_xtool/llcppsymg/parse"
"github.com/goplus/llcppg/_xtool/llcppsymg/symbol"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion _xtool/llcppsymg/parse/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"strconv"
"strings"

"github.com/goplus/llcppg/_xtool/llcppsymg/clangutils"
"github.com/goplus/llgo/c"
"github.com/goplus/llgo/c/clang"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/clangutils"
)

type SymbolInfo struct {
Expand Down
8 changes: 4 additions & 4 deletions _xtool/llcppsymg/symbol/symbol.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
"strings"
"unsafe"

"github.com/goplus/llcppg/_xtool/llcppsymg/config"
"github.com/goplus/llcppg/_xtool/llcppsymg/config/cfgparse"
"github.com/goplus/llcppg/_xtool/llcppsymg/parse"
"github.com/goplus/llcppg/types"
"github.com/goplus/llgo/c"
"github.com/goplus/llgo/c/cjson"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/config"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/config/cfgparse"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/parse"
"github.com/goplus/llgo/chore/llcppg/types"
"github.com/goplus/llgo/xtool/nm"
)

Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ module github.com/goplus/llcppg

go 1.20

require (
github.com/goplus/llgo v0.9.7
)
require github.com/goplus/llgo v0.9.8-0.20241127093550-38a7f4f7d589
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
github.com/goplus/llgo v0.9.7 h1:LRF2Fq9ts4QrVxOPZufexalbIoJ1oiBERjCWQ45wxbg=
github.com/goplus/llgo v0.9.7/go.mod h1:5Fs+08NslqofJ7xtOiIXugkurYOoQvY02ZkFNWA1uEI=
github.com/goplus/llgo v0.9.8-0.20241127093550-38a7f4f7d589 h1:u0aqHCN6z+Md1FYB052ROjP/6PVlFBtWWuTi/LGuifs=
github.com/goplus/llgo v0.9.8-0.20241127093550-38a7f4f7d589/go.mod h1:1phqPJEgr/uw59PRz/NB7s54OoP+NGjC6pz0HovT5JY=
Loading