Optimize environment computation and/or improve cache hit rates
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- go
- Área
- build-system
Línea de trabajo
Start by tracing the Devbox shell environment computation and cache-key generation; the issue’s debug output points to nix print-dev-env, but does not name Devbox source files or tests. Compare how package order affects the cache key and identify the relevant tests before making changes. Done means reordering packages without changing versions does not trigger an unnecessary recomputation, with tests covering that behavior.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What problem are you trying to solve?
I've started using devbox for a project with a fair amount of packages. Python, Node, Docker, Terraform, Yarn, etc. Whenever the package list changes, it takes a non-trivial amount of time to run 'devbox shell'. At my current project size, something around 20-30s. It seems this will just increase the more I use devbox for packages.
I ran with DEVBOX_DEBUG=1 and see this:
time=2025-07-02T22:36:35.280-07:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/nix.go:84 msg="nix command starting" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' print-dev-env --json path:/path/to/myproject/.devbox/gen/flake"
⣻ Computing the Devbox environment...
time=2025-07-02T22:36:57.969-07:00 level=DEBUG source=go.jetify.com/devbox/internal/nix/nix.go:84 msg="nix command exited" cmd.args="nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' print-dev-env --json path:/path/to/myproject/.devbox/gen/flake" cmd.path=/run/current-system/sw/bin/nix cmd.pid=41301 cmd.code=0 cmd
✓ Computed the Devbox environment.
What solution would you like?
It seems the big problem is the print-dev-env command. I'm not sure what would be involved in trying to optimize that. I'm not too familiar with Nix internals.
But while trying to figure out what was wrong, I noticed simply reordering the packages (no version changes) in devbox.json was enough to cause devbox to recompute the environment.
Unless I'm missing something, I feel like the order of packages shouldn't really matter. So there's probably an separate, smallish optimization possible here - cache results based on a sorted list of the packages list. That won't fix the first issue though.
Alternatives you've considered
I'm not sure what alternatives are possible, aside from not using devbox.
- Lenguaje dominante
- Go
- Estrellas
- 12.4k
- Forks
- 358
- Merge medio
- 17 h 12 min
- PR fusionados (30 d)
- 31
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de jetify-com/devbox
-
feature triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
jetify-com/devbox#3038 ·
Los mantenedores suelen responder en 1 día
-
pulumi is outdatedAbiertobug p4 package processed triage unrelated
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
jetify-com/devbox#2898 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
p4 processed unrelated
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
jetify-com/devbox#2750 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
StorydenAbiertop4 package processed triage unrelated
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
jetify-com/devbox#2685 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Plugin Request]: apacheKafkaAbiertolooks easy p4 package processed triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
jetify-com/devbox#2656 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de jetify-com/devbox
Issues similares
-
Cluster details: the Control Plane version field has a different border color than its icon boxAbiertokind/design sig/ui
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
kubermatic/dashboard#8449 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
filecoin-project/curio#1632 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
-
compose: derived node options overwrite each other's targetsPosiblemente ocupada @yangjj-iso la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día