Skip to content

[remove nixpkgs] enable fallback for packages not in binary store #1236

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

Merged
merged 2 commits into from
Jul 7, 2023

Conversation

savil
Copy link
Collaborator

@savil savil commented Jun 29, 2023

Summary

Many testscript unit-tests were failing because they use unversioned legacy packages like "hello", as opposed to hello@latest, or hello@<version>.

These legacy packages do not use the Binary Cache Store.

I considered whether we should treat them automatically as upgraded to @latest, but decided against:

  1. We'll need this logic in the flake template regardless. There will be some packages that are not in binary store.
  2. This also keeps the Package.IsInBinaryStore easier to reason about.

We should instead encourage users to devbox update their packages: which our messaging already does.

The remaining three testscript unit-tests are failing due to "unable to find nix executable" errors. Will fix in followup.

How was it tested?

enabled feature-flag and ran testscripts: https://github.com/jetpack-io/devbox/actions/runs/5417704606/jobs/9848964717?pr=1236

@savil savil changed the title (Work in Progress) [remove nixpkgs] enable fallback for packages not in binary store [remove nixpkgs] enable fallback for packages not in binary store Jun 29, 2023
@savil savil requested a review from mikeland73 June 29, 2023 23:46
@savil savil marked this pull request as ready for review June 29, 2023 23:46
@savil savil force-pushed the savil/remove-nixpkgs-3 branch from 76f3bf1 to 60cefb4 Compare July 1, 2023 00:02
Copy link
Collaborator Author

savil commented Jul 1, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@savil savil force-pushed the savil/remove-nixpkgs-3 branch from 60cefb4 to a70becd Compare July 5, 2023 15:57
@savil
Copy link
Collaborator Author

savil commented Jul 5, 2023

@mikeland73 ping

config.allowUnfree = true;
});
{{- end }}
{{- end }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@LucilleH LucilleH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only for cases where the RemoveNixpkgs feature flag is on?

@savil
Copy link
Collaborator Author

savil commented Jul 7, 2023

This is only for cases where the RemoveNixpkgs feature flag is on?

yep

@savil savil merged commit 0467e39 into main Jul 7, 2023
@savil savil deleted the savil/remove-nixpkgs-3 branch July 7, 2023 00:55
savil added a commit that referenced this pull request Jul 7, 2023
## Summary

builds on top of #1236

Goal: 
We should be able to install the package without downloading nixpkgs.

Changes made to:
- `nixprofile.ProfileInstall`: use `/nix/store/<hash>` as `installable`
- `nixprofile.ProfileListIndex`: return index when `item.nixStorePath ==
pkg.PathInStore`
- `devpkgs.Package.ValidateExists`: `true` if `IsInBinaryStore`
- `devpkgs.Package.EnsureNixpkgsPrefetched`: skip if `IsInBinaryStore`.


## How was it tested?

`devbox add [email protected]` and `devbox rm [email protected]`
- [x] nixpkgs not downloaded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants