Skip to content

Commit d89a373

Browse files
authored
impl: PATH fix for multiple glibc-patched packages (#1608)
Prepend all glibc-patched packages to the PATH instead of just the last one.
1 parent 3de91dc commit d89a373

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

internal/impl/devbox.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -891,12 +891,12 @@ func (d *Devbox) computeNixEnv(ctx context.Context, usePrintDevEnvCache bool) (m
891891
// Motivation: if a user removes a package from their devbox it should no longer
892892
// be available in their environment.
893893
buildInputs := strings.Split(env["buildInputs"], " ")
894-
glibcPatchPath := ""
894+
var glibcPatchPath []string
895895
nixEnvPath = filterPathList(nixEnvPath, func(path string) bool {
896896
// TODO(gcurtis): this is a massive hack. Please get rid
897897
// of this and install the package to the profile.
898898
if strings.Contains(path, "patched-glibc") {
899-
glibcPatchPath = path
899+
glibcPatchPath = append(glibcPatchPath, path)
900900
return true
901901
}
902902
for _, input := range buildInputs {
@@ -913,8 +913,9 @@ func (d *Devbox) computeNixEnv(ctx context.Context, usePrintDevEnvCache bool) (m
913913

914914
// TODO(gcurtis): this is a massive hack. Please get rid
915915
// of this and install the package to the profile.
916-
if glibcPatchPath != "" {
917-
nixEnvPath = glibcPatchPath + ":" + nixEnvPath
916+
if len(glibcPatchPath) != 0 {
917+
patchedPath := strings.Join(glibcPatchPath, string(filepath.ListSeparator))
918+
nixEnvPath = envpath.JoinPathLists(patchedPath, nixEnvPath)
918919
debug.Log("PATH after glibc-patch hack is: %s", nixEnvPath)
919920
}
920921

0 commit comments

Comments
 (0)