-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[UX] Better dedup packages we nix build, and improve UX printouts #1827
Conversation
Current dependencies on/for this PR: This stack of pull requests is managed by Graphite. |
1db57d9
to
2902a80
Compare
2902a80
to
c842714
Compare
You might want to try out Maybe I'm misunderstanding the downside, but it sounds like not seeing any output is okay if it's fast. Ideally things would be fast enough that we wouldn't need to output anything at all! |
@gcurtis to clarify, prior to this PR the de-duplication was happening based on the I added this to the Summary to clarify:
Regarding:
IIUC I think this would be useful to show the incremental progress being made while installing. @mikeland73 yesterday made a change to enable this output to be shown. See #1826 |
5d663fc
to
2415de2
Compare
For completeness, I'll share my findings.
but the format can change based on the
In contrast, |
Putting up for review. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Can you confirm that doing devbox install
on a fresh project with a few packages shows output.
Should we rename packagesToInstallInProfile
to packagesToInstallInStore
?
2415de2
to
c23bdcb
Compare
confirmed!
yes, done! |
Summary
We have two separate steps for "installing packages".
For the first step, we should only run
nix build
if the package's outputs are not in the nix store. For this, we checknix store ls <path>
. We get<path>
fromnix path-info <installable>
.Previously, we were checking if the packages were in the
nix profile
, rather than directly querying the nix store. This would lead to re-runningnix build
for when we've donedevbox add
outside a devbox-environment, and then started a devbox-environment (example: doingdevbox add
followed bydevbox shell
).For the second step, we can remove the
[1/3] <package>
being removed print outs. This was already removed for packages being added. Reason: this step should be quick! We've already added the packages to the nix store vianix build
. It also confuses users who are likely not aware of anix profile
concept, nor should we make them aware of it.Alternatives:
Also tried
nix build --profile <path> <installable>
but this doesn't seem to return the installed package innix profile list
. Not sure why, but it doesmean its not useful for de-duplicating packages that remain to be installed.Upside:
Ths store-path deduping is great. Works much faster. Re-doing
devbox add <package>
for a package already in/nix/store
is much faster since we skip thenix build
step entirely. As it should be.Downside:
A user adding or removing packages directly from editing the
devbox.json
will not see any nice per-package-steps installation output. (Note, this was changed when adding nix-proflile-from-flake, but mentioning for completeness of analyzing the UX)How was it tested?
devbox add
a package already in store no longer shows the per-package installation stepsdevbox shell
subsequently does not again show we are adding the package.devbox add
a package not in store does show the per-package-steps installation output.Need to do more rigorous testing: