Skip to content

Commit 8b1e2e3

Browse files
authored
[remove-nixpkgs] Disable remove-nixpkgs to fix non-search fallback (#1463)
## Summary Restores functionality implemented by #1264 and refactored in #1279 which was accidentally broken by #1437 tldr: the `FillNarInfoCache` function breaks if packages are not in search, but we support non-search packages via fallback (.e.g. stdenv.cc.cc.lib) I'm keeping surface area as small as possible, but as a follow up I think we can remove the `devpkg.FillNarInfoCache` calls from `impl.Add` if we simply ignore the`IsInBinaryCache` errors in [ValidateExists](https://github.com/jetpack-io/devbox/blob/main/internal/devpkg/validation.go#L10-L26) or remove `IsInBinaryCache` from that function completely (I'm not convinced it is needed, @savil @ipince correct me if I'm wrong) ## How was it tested? `devbox add stdenv.cc.cc.lib`
1 parent 96a193e commit 8b1e2e3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

internal/boxcli/featureflag/remove_nixpkgs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ package featureflag
44
// It leverages the search index to directly map <package>@<version> to
55
// the /nix/store/<hash>-<package>-<version> that can be fetched from
66
// cache.nixpkgs.org.
7-
var RemoveNixpkgs = enable("REMOVE_NIXPKGS")
7+
var RemoveNixpkgs = disable("REMOVE_NIXPKGS")

internal/devpkg/narinfo_cache.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ func (p *Package) IsInBinaryCache() (bool, error) {
6262
// package in the list, and caches the result.
6363
// Callers of IsInBinaryCache must call this function first.
6464
func FillNarInfoCache(ctx context.Context, packages ...*Package) error {
65+
if !featureflag.RemoveNixpkgs.Enabled() {
66+
return nil
67+
}
6568

6669
// Pre-compute values read in fillNarInfoCache
6770
// so they can be read from multiple go-routines without locks

0 commit comments

Comments
 (0)