diff --git a/v2/jam/store/disk.go b/v2/jam/store/disk.go index 9a46876..c90202a 100644 --- a/v2/jam/store/disk.go +++ b/v2/jam/store/disk.go @@ -288,6 +288,9 @@ func (d *Disk) Close() error { ip = filepath.Dir(d.DBPath) srcs := internal.GoPaths() srcs = append(srcs, build.Default.SrcDirs()...) + sort.SliceStable(srcs, func(i, j int) bool { + return len(srcs[i]) > len(srcs[j]) + }) for _, x := range srcs { ip = strings.TrimPrefix(ip, "/private") ip = strings.TrimPrefix(ip, x)