Skip to content
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

devbox update fail when git flake are present #1868

Closed
kadaan opened this issue Mar 1, 2024 · 3 comments · Fixed by #1870
Closed

devbox update fail when git flake are present #1868

kadaan opened this issue Mar 1, 2024 · 3 comments · Fixed by #1870
Labels
bug Something isn't working

Comments

@kadaan
Copy link
Contributor

kadaan commented Mar 1, 2024

What happened?

Running devbox update fails when git flakes are present in the devbox.json.

Steps to reproduce

  1. Add git flake to devbox.json
  2. Run devbox shell
  3. Exit shell
  4. 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

@kadaan kadaan added bug Something isn't working triage Issue needs triage labels Mar 1, 2024
@kadaan
Copy link
Contributor Author

kadaan commented Mar 1, 2024

There seem to be multiple problems here:

  1. func (f *File) FetchResolvedPackage(pkg string) (*Package, error) { fails skip flakes
  2. If devbox shell has not been run then devbox update will fail because the ./.devbox/gen/flake/flake.nix file is missing
  3. Devbox issues nix build calls with --impure, but nix flake update is not specified with --impure. That said, I don't know if the semantics of nix flake update will be the same as devbox update performing nix build --refresh ... for flakerefs

@kadaan
Copy link
Contributor Author

kadaan commented Mar 1, 2024

Might this be solved by:

  1. adding a new method like IsRunX called IsFlake and skipping flakes in FetchResolvedPackage
  2. pass installMode down from ensureStateIsUpToDate to installNixPackagesToStore and if installMode == update add --refresh to the command args

@kadaan
Copy link
Contributor Author

kadaan commented Mar 1, 2024

@Lagoja FYI

@gcurtis gcurtis removed the triage Issue needs triage label Mar 11, 2024
@gcurtis gcurtis linked a pull request Mar 11, 2024 that will close this issue
@savil savil closed this as completed in b437a73 Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants