Skip to content
Merged
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
10 changes: 0 additions & 10 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions internal/patchpkg/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,15 @@ func (d *DerivationBuilder) findCUDA(ctx context.Context, out *packageFS) error
return fmt.Errorf("patch flake didn't set $src to the path to its source tree")
}

glob, err := fs.Glob(d.src, "lib/libcuda.so*")
pattern := "lib/libcuda.so*"
slog.DebugContext(ctx, "looking for system CUDA libraries in flake", "glob", filepath.Join(d.src.storePath, "lib/libcuda.so*"))
glob, err := fs.Glob(d.src, pattern)
if err != nil {
return fmt.Errorf("glob system libraries: %v", err)
}
if len(glob) != 0 {
if len(glob) == 0 {
slog.DebugContext(ctx, "no system CUDA libraries found in flake")
} else {
err := d.copyDir(out, "lib")
if err != nil {
return fmt.Errorf("copy system library: %v", err)
Expand Down
12 changes: 6 additions & 6 deletions internal/patchpkg/elf.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,14 @@ func (lib SharedLibrary) CopyAndLink(dir string) error {
return err
}

sonameLink := filepath.Join(dir, lib.Soname)
sonameLink := filepath.Join(dir, filepath.Base(lib.Soname))
var sonameErr error
if lib.Soname != "" {
// Symlink must be relative.
sonameErr = os.Symlink(filepath.Base(lib.RealName), sonameLink)
}

linkerNameLink := filepath.Join(dir, lib.LinkerName)
linkerNameLink := filepath.Join(dir, filepath.Base(lib.LinkerName))
var linkerNameErr error
if lib.LinkerName != "" {
// Symlink must be relative.
Expand All @@ -209,9 +209,9 @@ func (lib SharedLibrary) CopyAndLink(dir string) error {

func (lib SharedLibrary) LogValue() slog.Value {
return slog.GroupValue(
slog.String("lib.path", lib.Name()),
slog.String("lib.linkername", lib.LinkerName),
slog.String("lib.soname", lib.Soname),
slog.String("lib.realname", lib.RealName),
slog.String("path", lib.Name()),
slog.String("linkername", lib.LinkerName),
slog.String("soname", lib.Soname),
slog.String("realname", lib.RealName),
)
}
2 changes: 1 addition & 1 deletion internal/shellgen/tmpl/glibc-patch.nix.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
gcc = if isLinux then nixpkgs-glibc.legacyPackages."${system}".stdenv.cc.cc.lib else null;

DEVBOX_DEBUG = 1;

src = self;
builder = "${devbox.packages.${system}.default}/bin/devbox";
args = [ "patch" "--restore-refs" ] ++
(if glibc != null then [ "--glibc" "${glibc}" ] else [ ]) ++
Expand Down