13
.github/workflows/go.yml
vendored
13
.github/workflows/go.yml
vendored
@@ -128,8 +128,17 @@ jobs:
|
|||||||
bash _lldb/runtest.sh -v
|
bash _lldb/runtest.sh -v
|
||||||
|
|
||||||
- name: Test demos
|
- name: Test demos
|
||||||
continue-on-error: true
|
run: |
|
||||||
run: bash .github/workflows/test_demo.sh
|
# 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: Show test result
|
- name: Show test result
|
||||||
run: cat result.md
|
run: cat result.md
|
||||||
|
|||||||
@@ -188,11 +188,18 @@ func parseCgo_(pkg *aPackage, files []*ast.File) (cfiles []string, preambles []c
|
|||||||
dirs[dir] = none{}
|
dirs[dir] = none{}
|
||||||
}
|
}
|
||||||
for dir := range dirs {
|
for dir := range dirs {
|
||||||
files, err := filepath.Glob(filepath.Join(dir, "*.c"))
|
matches, err := filepath.Glob(filepath.Join(dir, "*.c"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
cfiles = append(cfiles, files...)
|
for _, match := range matches {
|
||||||
|
if strings.HasSuffix(match, "_test.c") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if fi, err := os.Stat(match); err == nil && !fi.IsDir() {
|
||||||
|
cfiles = append(cfiles, match)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, file := range files {
|
for _, file := range files {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import (
|
|||||||
_ "unsafe"
|
_ "unsafe"
|
||||||
|
|
||||||
"github.com/goplus/llgo/c"
|
"github.com/goplus/llgo/c"
|
||||||
|
"github.com/goplus/llgo/c/os"
|
||||||
"github.com/goplus/llgo/c/syscall"
|
"github.com/goplus/llgo/c/syscall"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -114,7 +115,14 @@ func Pipe2(p []int, flags int) error {
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
||||||
panic("todo: syscall.Faccessat")
|
ret := faccessat(c.Int(dirfd), c.AllocaCStr(path), c.Int(mode), c.Int(flags))
|
||||||
|
if ret != 0 {
|
||||||
|
return Errno(os.Errno())
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//go:linkname faccessat C.faccessat
|
||||||
|
func faccessat(dirfd c.Int, path *c.Char, mode c.Int, flags c.Int) c.Int
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user