-
Notifications
You must be signed in to change notification settings - Fork 183
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
[global] Unify nix profile install #695
Conversation
203260f
to
eb9162a
Compare
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.
needs a fix: see the priority problem below
internal/impl/packages.go
Outdated
return "5" | ||
} | ||
} | ||
return "4" |
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.
This should be the opposite: the raw packages from devbox.json
get highest priority compared to packages from elsewhere like global packages.
the lower the number, the higher the priority....
internal/impl/global.go
Outdated
stepMsg := fmt.Sprintf("[%d/%d] %s", stepNum, total, pkg) | ||
if err := nix.ProfileInstall(&nix.ProfileInstallArgs{ | ||
CustomStepMessage: stepMsg, | ||
NixpkgsCommit: plansdk.DefaultNixpkgsCommit, |
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.
shouldn't this take the nixpkgs commit hash from the global devbox.json?
if err := ensureNixpkgsPrefetched(args.Writer, args.NixpkgsCommit); err != nil { | ||
return err | ||
} | ||
stepMsg := args.Package |
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.
stepMsg := fmt.Sprintf("Installing %s\n", args.Package)
## Summary Fixes minor double error issue. (This was pulled out of #695) ## How was it tested? ```bash devbox global add hello hello is now installed Warning: the devbox global profile is not in your $PATH. Add the following line to your shell's rcfile (e.g., ~/.bashrc or ~/.zshrc) and restart your shell to fix this: eval "$(devbox global shellenv)" ```
## Summary I'm running into some weird CICD resource issue on #695 so I'm splitting that up into smaller PRs. ## How was it tested? ```bash devbox global add go_1_20 devbox add go_1_19 devbox shell ```
d53fd41
to
c946b74
Compare
Summary
This fixes a few global issues:
It does so by refactoring some code around:
nix profile install
, packageInstallIgnore, checking if nixpkgs is installed)What this does not fix: If we install a very large package (e.g.
bazel
) we block oncmd.Run()
and don't print any output. This affects all ways of installing.How was it tested?
Also tried changing hashes on global devbox.json, installing conflicting binaries, adding and removing large packages (e.g. pulumi, bazel, etc). Bazel was a bad experience.