Skip to content

Commit ed240c1

Browse files
committed
Merge upstream/main into readme branch and resolve README install docs conflict
2 parents b48f3d7 + 136f197 commit ed240c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+202
-108
lines changed

.github/actions/setup-llcppg/action.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ inputs:
88
description: "LLVM version to install (e.g. 18)"
99
default: "19"
1010
llgo:
11-
description: "LLGo version to download (e.g. v0.12.1)"
12-
default: "v0.12.1"
11+
description: "LLGo version to download (e.g. v0.12.14)"
12+
default: "v0.12.14"
1313
runs:
1414
using: "composite"
1515
steps:
@@ -50,10 +50,6 @@ runs:
5050
echo "LLGO_ROOT: $LLGO_ROOT"
5151
llgo version
5252
clang --version
53-
- name: Build
54-
shell: bash
55-
run: go build -v ./...
56-
5753
- name: Install llcppg modules
5854
shell: bash
5955
run: |

.github/actions/setup-llcppg/download-llgo.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ esac
3939
# Remove 'v' prefix from version if present
4040
VERSION_NUMBER="${VERSION#v}"
4141
FILENAME="llgo${VERSION_NUMBER}.${OS}-${ARCH}.tar.gz"
42-
URL="https://github.com/goplus/llgo/releases/download/${VERSION}/${FILENAME}"
42+
# Use fork releases while upstream release is not available yet.
43+
URL="https://github.com/luoliwoshang/llgo/releases/download/${VERSION}/${FILENAME}"
4344

4445
echo "Downloading LLGo ${VERSION} for ${OS}-${ARCH}..."
4546
echo "URL: $URL"

.github/workflows/end2end.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- ubuntu-latest
2525
- ubuntu-24.04-arm
2626
llvm: [19]
27-
llgo: [v0.12.1]
27+
llgo: [v0.12.14]
2828
go: [1.23]
2929
fail-fast: false
3030
runs-on: ${{matrix.os}}

.github/workflows/gentest.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- ubuntu-latest
2525
- ubuntu-24.04-arm
2626
llvm: [19]
27-
llgo: [v0.12.1]
27+
llgo: [v0.12.14]
2828
go: [1.23]
2929
fail-fast: false
3030
runs-on: ${{matrix.os}}
@@ -69,4 +69,3 @@ jobs:
6969
path: ${{env.LLCPPG_TEST_LOG_DIR}}
7070
retention-days: 1
7171
include-hidden-files: true
72-

.github/workflows/go.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- macos-latest
2626
- ubuntu-latest
2727
llvm: [19]
28-
llgo: [v0.12.1]
28+
llgo: [v0.12.14]
2929
go: [1.23]
3030
fail-fast: false
3131
runs-on: ${{matrix.os}}
@@ -54,8 +54,8 @@ jobs:
5454
# only can compile with llgo
5555
- name: Test llcppsymg & llcppsigfetch
5656
run: |
57-
llgo test ./_xtool/llcppsigfetch/internal/...
58-
llgo test ./_xtool/llcppsymg/internal/...
57+
llgo test ./_xtool/parse/...
58+
llgo test ./_xtool/symg/...
5959
6060
- name: Test For LLGo and Go
6161
run: |

_xtool/internal/clangtool/inclusion.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,19 @@ func GetInclusions(conf *Config, fn func(fileName string, depth int)) error {
2828
if err != nil {
2929
return err
3030
}
31-
defer os.Remove(tmpFile.Name())
31+
tmpName := tmpFile.Name()
32+
if err := tmpFile.Close(); err != nil {
33+
_ = os.Remove(tmpName)
34+
return err
35+
}
36+
defer os.Remove(tmpName)
3237

3338
inc := fmt.Sprintf("#include <%s>", conf.HeaderFileName)
34-
_, err = tmpFile.Write([]byte(inc))
35-
if err != nil {
39+
if err := os.WriteFile(tmpName, []byte(inc), 0600); err != nil {
3640
return err
3741
}
3842

39-
file = tmpFile.Name()
43+
file = tmpName
4044
}
4145

4246
args := defaultArgs(conf.IsCpp)

_xtool/internal/header/header.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ func PkgHfileInfo(conf *Config) *PkgHfilesInfo {
5050
if err != nil {
5151
panic(err)
5252
}
53-
defer os.Remove(outfile.Name())
53+
outfileName := outfile.Name()
54+
if err := outfile.Close(); err != nil {
55+
panic(err)
56+
}
57+
defer os.Remove(outfileName)
5458

5559
inters := make(map[string]struct{})
5660
others := []string{} // impl & third
@@ -80,9 +84,9 @@ func PkgHfileInfo(conf *Config) *PkgHfilesInfo {
8084
}
8185
}
8286

83-
clangtool.ComposeIncludes(conf.Includes, outfile.Name())
87+
clangtool.ComposeIncludes(conf.Includes, outfileName)
8488
err = clangtool.GetInclusions(&clangtool.Config{
85-
ComposedHeaderFile: outfile.Name(),
89+
ComposedHeaderFile: outfileName,
8690
CompileArgs: conf.Args,
8791
}, retrieveComposedHeadersFn)
8892
if err != nil {

_xtool/llcppsigfetch/llcppsigfetch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"strings"
2424

2525
clangutils "github.com/goplus/llcppg/_xtool/internal/clang"
26-
"github.com/goplus/llcppg/_xtool/llcppsigfetch/internal/parse"
26+
"github.com/goplus/llcppg/_xtool/parse"
2727
llcppg "github.com/goplus/llcppg/config"
2828
args "github.com/goplus/llcppg/internal/arg"
2929
)

_xtool/llcppsymg/llcppsymg.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ import (
2121
"fmt"
2222
"os"
2323

24-
"github.com/goplus/llcppg/_xtool/internal/symbol"
25-
"github.com/goplus/llcppg/_xtool/llcppsymg/internal/symg"
24+
"github.com/goplus/llcppg/_xtool/symg"
2625
llcppg "github.com/goplus/llcppg/config"
2726
args "github.com/goplus/llcppg/internal/arg"
2827
)
@@ -65,11 +64,10 @@ func main() {
6564
fmt.Fprintln(os.Stderr, "Failed to parse config file:", ags.CfgFile)
6665
}
6766

68-
libMode := symbol.ModeDynamic
67+
libMode := symg.ModeDynamic
6968
if conf.StaticLib {
70-
libMode = symbol.ModeStatic
69+
libMode = symg.ModeStatic
7170
}
72-
7371
symbolTable, err := symg.Do(&symg.Config{
7472
Libs: conf.Libs,
7573
CFlags: conf.CFlags,

_xtool/llcppsigfetch/internal/parse/dump.go renamed to _xtool/parse/dump.go

File renamed without changes.

0 commit comments

Comments
 (0)