Skip to content

Commit bb35bbf

Browse files
joohwcursoragent
andcommitted
fix(desktop): use X_OK access check only on darwin
Linux CI lacks syscall.X_OK; fall back to mode bits so v0.1.33 release can build. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 6546e23 commit bb35bbf

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

core/internal/buildinfo/buildinfo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import "strings"
44

55
// Set at link time via -ldflags (see .goreleaser.yaml).
66
var (
7-
Version = "dev0.1.57"
7+
Version = "dev0.1.58"
88
Commit = "none"
99
Date = "unknown"
1010
)

core/internal/desktop/agents_executable_unix.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,19 @@
22

33
package desktop
44

5-
import "syscall"
5+
import (
6+
"os"
7+
"runtime"
8+
"syscall"
9+
)
610

711
func isExecutableFile(path string) bool {
8-
return syscall.Access(path, syscall.X_OK) == nil
12+
if runtime.GOOS == "darwin" {
13+
return syscall.Access(path, syscall.X_OK) == nil
14+
}
15+
info, err := os.Stat(path)
16+
if err != nil || info.IsDir() {
17+
return false
18+
}
19+
return info.Mode().Perm()&0o111 != 0
920
}

0 commit comments

Comments
 (0)