Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion internal/devpkg/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func patchGlibcFunc(canonicalName string, mode configfile.PatchMode) func() bool
}

// Check nix.SystemIsLinux() last because it's slow.
return patch && nix.SystemIsLinux()
return patch
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to update comment

})
}

Expand Down
2 changes: 1 addition & 1 deletion internal/patchpkg/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func (d *DerivationBuilder) needsGlibcPatch(file *bufio.Reader, filePath string)

func (d *DerivationBuilder) findRemovedRefs(ctx context.Context, pkg *packageFS) ([]fileSlice, error) {
var refs []fileSlice
matches, err := fs.Glob(pkg, "lib/python*/_sysconfigdata__linux*.py")
matches, err := fs.Glob(pkg, "lib/python*/_sysconfigdata_*.py")
if err != nil {
return nil, err
}
Expand Down
9 changes: 7 additions & 2 deletions internal/shellgen/tmpl/glibc-patch.nix.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@
builtins.map (drv: drv.outPath) mkTree;

# Programs needed by glibc-patch.bash.
inherit (nixpkgs-glibc.legacyPackages."${system}") bash coreutils glibc gnused patchelf ripgrep;
inherit (nixpkgs-glibc.legacyPackages."${system}") bash coreutils gnused patchelf ripgrep;

isLinux = (builtins.match ".*linux.*" system) != null;
glibc = if isLinux then nixpkgs-glibc.legacyPackages."${system}".glibc else null;

# Create a package that puts the local devbox binary in the conventional
# bin subdirectory. This also ensures that the executable is named
Expand All @@ -92,7 +95,9 @@

DEVBOX_DEBUG = 1;
builder = "${devbox}/bin/devbox";
args = [ "patch" "--restore-refs" "--glibc" glibc pkg ];
args = [ "patch" "--restore-refs" ] ++
(if glibc != null then [ "--glibc" "${glibc}" ] else [ ]) ++
[ pkg ];
};
in
{
Expand Down