Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

Fix linux build: replace removed syscall.Fadvise with unix.Fadvise

Martin Vogel68fbfa4beebb
diff --git a/go.mod b/go.mod
index e3b55e98d..d5c9002e8 100644
--- a/go.mod
+++ b/go.mod
@@ -7,6 +7,7 @@ require (
github.com/modelcontextprotocol/go-sdk v1.4.0
github.com/zeebo/xxh3 v1.1.0
golang.org/x/sync v0.19.0
+ golang.org/x/sys v0.40.0
gopkg.in/yaml.v3 v3.0.1
)
@@ -17,5 +18,4 @@ require (
github.com/segmentio/encoding v0.5.3 // indirect
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
golang.org/x/oauth2 v0.34.0 // indirect
- golang.org/x/sys v0.40.0 // indirect
)
diff --git a/internal/pipeline/prefetch_linux.go b/internal/pipeline/prefetch_linux.go
index 5b0cd767a..d1facbcb9 100644
--- a/internal/pipeline/prefetch_linux.go
+++ b/internal/pipeline/prefetch_linux.go
@@ -4,7 +4,8 @@ package pipeline
import (
"os"
- "syscall"
+
+ "golang.org/x/sys/unix"
)
func advisePrefetch(f *os.File) {
@@ -13,5 +14,5 @@ func advisePrefetch(f *os.File) {
return
}
// POSIX_FADV_WILLNEED = 3: advise kernel to read file into page cache
- _ = syscall.Fadvise(int(f.Fd()), 0, fi.Size(), 3)
+ _ = unix.Fadvise(int(f.Fd()), 0, fi.Size(), unix.FADV_WILLNEED)
}