-
Notifications
You must be signed in to change notification settings - Fork 270
[bug fix] re-create nix-profile on each install of packages (workaround fix) #508
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
Conversation
Current dependencies on/for this PR: This comment was auto-generated by Graphite. |
For underlying cause, posting raw output for posterity:
I then run the nix-env --install command printed above:
|
To be clear, we only need to do this during some "transition time", right? Once we can expect most users to have upgraded their devbox (within reason), then we can stop deleting the profile every time. |
Yes, I would expect so... |
see #512 for an alternative approach to fixing this. |
closing in favor of #513 |
## Summary With the recent install-UX improvement of #491, we may run into issues for existing users. #508 summarizes the issue and has a workaround fix implemented. However, it had me thinking whether this is introducing more risk than we want for this week. To summarize, the improvements made in #491 and later in #506 are: 1. #491: use stepper. Install each package individually, instead of using `development.nix`. 2. #506: stream the output of `nix-env --install`. This PR makes it so we continue doing #506 to preserve some UX improvement, but revert #491 to minimize risk. When I try it in `devbox cloud shell` with `bazel` and `buf`, the streaming output helps preserve the feeling of progress being made. The viewer is no longer left pondering "is it stuck? is it broken?". ## How was it tested? - built a linux devbox binary and deployed a custom VM - did `devbox cloud shell` to that VM: The following output shows but is printed in a streaming fashion as opposed to blank for a long time and then shows up in one-go. ``` Devbox Cloud Remote development environments powered by Nix ✓ File syncing started → Connecting to virtual machine Installing nix packages. This may take a while... installing 'devbox-development' these 2 derivations will be built: /nix/store/9yk55y5ywvm4ihnllfa2kcz158bmbfbg-builder.pl.drv /nix/store/xwcvqhd7fd49dndn5wvn2hx2vcxlrkp0-devbox-development.drv these 59 paths will be fetched (919.80 MiB download, 1815.57 MiB unpacked): /nix/store/039g378vc3pc3dvi9dzdlrd0i4q93qwf-binutils-2.39 /nix/store/0zmylwn0sznzflf137hhqlnnyskr6cdk-openjdk-headless-11.0.15+10 /nix/store/1d6ian3r8kdzspw8hacjhl3xkp40g1lj-binutils-wrapper-2.39 /nix/store/1dgws25664p544znpc6f1nh9xmjf4ykc-pcre-8.45 /nix/store/1gf2flfqnpqbr1b4p4qz2f72y42bs56r-gcc-11.3.0 /nix/store/1i5ah27gxx3a3fyjyydfwwzqq8ni33i8-ncurses-6.3-p20220507 ... // omitted /nix/store/y6aj732zm9m87c82fpvf103a1xb22blp-file-5.43 /nix/store/zdba9frlxj2ba8ca095win3nphsiiqhb-python3-3.10.8 /nix/store/zlcnmqq14jz5x9439jf937mvayyl63da-xz-5.2.7-bin copying path '/nix/store/hlqzdmnprp3cqwmj4zpzllb8aarjkbvb-iana-etc-20220915' from 'https://cache.nixos.org'... copying path '/nix/store/2js892db4aspqb06b9hlxmcr0g97gf3z-bazel-deps' from 'https://cache.nixos.org'... copying path '/nix/store/039g378vc3pc3dvi9dzdlrd0i4q93qwf-binutils-2.39' from 'https://cache.nixos.org'... copying path '/nix/store/a8mhcagrsly7c7mpjrpsnaahk4aax056-bzip2-1.0.8-bin' from 'https://cache.nixos.org'... copying path '/nix/store/xwl6y60ffijfbhxb754dlxk3pkjgw0d2-ed-1.18' from 'https://cache.nixos.org'... copying path '/nix/store/a1ad8qiqqb9fpg5a9rhlkm44s02sr61p-expand-response-params' from 'https://cache.nixos.org'... ... // omitted ```
Summary
Problem:
nix-env --install development.nix
.This was subsequently changed to install each package individually as in
nix-env --install --attr <package>
./nix/store/<hash>-devbox-development/path/to/binary
which is now
/nix/store/<hash>-<package>/path/to/binary
.Fix #1:
A brute-force fix is to
rm -rf .devbox
directory but this is bad UXThis PR's Fix:
The fix for now is to always re-create the profile. This is not great but tolerable
since we are not currently using the profile's generations. (We rely on the nix-profile
to enable us to install the package upon
devbox add
so it is present right away and when theuser next does
devbox shell
).How was it tested?
Step 1: built
devbox
from a commit prior to #491 to build the "old style" nix profileStep 2: go to
main
and rundevbox shell
in thego-1.19
example project. This fails.Step 3: go to this branch, and run
devbox shell
again. This works.