devbox update fail when git flake are present
kadaan opened this issue · comments
What happened?
Running devbox update
fails when git flakes are present in the devbox.json
.
Steps to reproduce
- Add git flake to devbox.json
- Run devbox shell
- Exit shell
- Run devbox update
Command
No response
devbox.json
{
"packages": [
"git+ssh://git@bitbucket.org/foo/bar.git#baz"
],
}
Devbox version
0.9.1
Nix version
2.19.3
What system does this bug occur on?
macOS (Apple Silicon)
Debug logs
2024/02/29 17:53:38 findProjectDir: path is
2024/02/29 17:53:38 finding devbox config in dir: /source/work/joelb_test
2024/02/29 17:53:38 findProjectDir: path is
2024/02/29 17:53:38 finding devbox config in dir: /source/work/joelb_test
2024/02/29 17:53:38 findProjectDir: path is
2024/02/29 17:53:38 finding devbox config in dir: /source/work/joelb_test
Error: git+ssh://git@bitbucket.org/foo/bar.git#baz: package not found
2024/02/29 17:53:39
ExecutionID:2323d1a6d79f4977814fa853ea181384
package not found
go.jetpack.io/devbox/internal/nix.init
:1
runtime.doInit1
/nix/store/2022s0jnrn2iyxjaikfy51w5fvifp38b-go-1.22.0/share/go/src/runtime/proc.go:7176
runtime.doInit
/nix/store/2022s0jnrn2iyxjaikfy51w5fvifp38b-go-1.22.0/share/go/src/runtime/proc.go:7143
runtime.main
/nix/store/2022s0jnrn2iyxjaikfy51w5fvifp38b-go-1.22.0/share/go/src/runtime/proc.go:253
runtime.goexit
/nix/store/2022s0jnrn2iyxjaikfy51w5fvifp38b-go-1.22.0/share/go/src/runtime/asm_arm64.s:1222
2024/02/29 17:53:39 findProjectDir: path is
2024/02/29 17:53:39 finding devbox config in dir: /source/work/joelb_test
There seem to be multiple problems here:
func (f *File) FetchResolvedPackage(pkg string) (*Package, error) {
fails skip flakes- If
devbox shell
has not been run thendevbox update
will fail because the ./.devbox/gen/flake/flake.nix file is missing - Devbox issues
nix build
calls with--impure
, butnix flake update
is not specified with--impure
. That said, I don't know if the semantics ofnix flake update
will be the same asdevbox update
performingnix build --refresh ...
for flakerefs
Might this be solved by:
- adding a new method like
IsRunX
calledIsFlake
and skipping flakes inFetchResolvedPackage
- pass
installMode
down fromensureStateIsUpToDate
toinstallNixPackagesToStore
and ifinstallMode == update
add--refresh
to the command args
@Lagoja FYI