Skip to content

Commit 490bfe5

Browse files
committed
bail if patchDependencies is empty
1 parent de17905 commit 490bfe5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

internal/patchpkg/builder.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,14 @@ func (d *DerivationBuilder) findCUDA(ctx context.Context, out *packageFS) error
353353
slog.DebugContext(ctx, "added DT_NEEDED entry for system CUDA library", "path", need)
354354
}
355355

356-
slog.DebugContext(ctx, "looking for nix CUDA libraries in $patchDependencies")
356+
slog.DebugContext(ctx, "looking for nix libraries in $patchDependencies")
357357
deps := os.Getenv("patchDependencies")
358+
if strings.TrimSpace(deps) == "" {
359+
slog.DebugContext(ctx, "$patchDependencies is empty")
360+
return nil
361+
}
358362
for _, pkg := range strings.Split(deps, " ") {
359-
slog.DebugContext(ctx, "checking for nix CUDA libraries in package", "pkg", pkg)
363+
slog.DebugContext(ctx, "checking for nix libraries in package", "pkg", pkg)
360364

361365
pkgFS := newPackageFS(pkg)
362366
libs, err := fs.Glob(pkgFS, "lib*/*.so*")
@@ -375,7 +379,7 @@ func (d *DerivationBuilder) findCUDA(ctx context.Context, out *packageFS) error
375379
}
376380
d.glibcPatcher.needed = append(d.glibcPatcher.needed, need)
377381

378-
slog.DebugContext(ctx, "added DT_NEEDED entry for nix CUDA library", "path", need)
382+
slog.DebugContext(ctx, "added DT_NEEDED entry for nix library", "path", need)
379383
}
380384
}
381385
return nil

0 commit comments

Comments
 (0)