ci: Fix windows build (#14754)

Instead of relying on sh for wildcard, do it in Go for better windows
compatibility.
This commit is contained in:
Daniel Hiltgen
2026-03-09 19:27:59 -07:00
committed by GitHub
parent 10e51c5177
commit 62d1f01ab4
2 changed files with 12 additions and 2 deletions

View File

@@ -97,8 +97,18 @@ func main() {
qc := tree_sitter.NewQueryCursor()
defer qc.Close()
var funs []Function
var files []string
for _, arg := range flag.Args() {
matches, err := filepath.Glob(arg)
if err != nil {
fmt.Fprintf(os.Stderr, "Error expanding glob %s: %v\n", arg, err)
continue
}
files = append(files, matches...)
}
var funs []Function
for _, arg := range files {
bts, err := os.ReadFile(arg)
if err != nil {
fmt.Fprintf(os.Stderr, "Error reading file %s: %v\n", arg, err)

View File

@@ -1,6 +1,6 @@
package mlx
//go:generate sh -c "go run generator/main.go -output=. ./include/mlx/c/*.h"
//go:generate go run generator/main.go -output=. ./include/mlx/c/*.h
// #cgo CXXFLAGS: -std=c++17
// #cgo CPPFLAGS: -I${SRCDIR}/include