Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cmd/aima/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,13 @@ func localEngineOverlayCatalog(ctx context.Context, cat *knowledge.Catalog, db *
asset.Source.InstallType = "preinstalled"
changed = true
}
// A locally discovered binary is executable on this host even when the
// catalog's downloadable release list does not include this platform.
// Preserve the catalog platforms and add the verified local platform.
if !asset.Source.Supports(hwInfo.Platform) && hwInfo.Platform != "" {
asset.Source.Platforms = append(asset.Source.Platforms, hwInfo.Platform)
changed = true
}
before := 0
if asset.Source.Probe != nil {
before = len(asset.Source.Probe.Paths)
Expand Down
5 changes: 4 additions & 1 deletion cmd/aima/resolve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ func TestResolveCatalogWithLocalEngineOverlayUsesInstalledNativeBinary(t *testin
}},
}

hw := knowledge.HardwareInfo{GPUArch: "Ada", Platform: "linux/amd64", RuntimeType: "native"}
hw := knowledge.HardwareInfo{GPUArch: "Ada", Platform: "linux/arm64", RuntimeType: "native"}
merged := resolveCatalogWithLocalEngineOverlay(ctx, cat, db, hw, t.TempDir())
if merged == nil {
t.Fatal("merged catalog is nil")
Expand All @@ -568,6 +568,9 @@ func TestResolveCatalogWithLocalEngineOverlayUsesInstalledNativeBinary(t *testin
if got := resolved.Source.Binary; got != filepath.Base(binaryPath) {
t.Fatalf("resolved source binary = %q, want %q", got, filepath.Base(binaryPath))
}
if !resolved.Source.Supports("linux/arm64") {
t.Fatalf("resolved source does not support the locally discovered platform: %+v", resolved.Source.Platforms)
}
if strings.TrimSpace(resolved.EngineImage) != "" {
t.Fatalf("resolved engine image = %q, want empty for native overlay", resolved.EngineImage)
}
Expand Down
Loading