devenv icon indicating copy to clipboard operation
devenv copied to clipboard

git submodule imports

Open bdj opened this issue 1 year ago • 0 comments

Describe the bug Using git submodules as imports in devenv.yaml results in an error.

To reproduce

  1. Create a git repository
  2. Add git submodules
git submodule add <BACKEND_URL> backend
git submodule add <FRONTEND_URL> frontend
  1. Run devenv init
  2. Change devenv.yaml https://gist.github.com/bdj/8cceb2af38c6a6cde33148619984aaf2
  3. Run devenv shell

Fails with the following output https://gist.github.com/bdj/6275dd3c7f9ed85e800c0d17638ce9c0

Version devenv 1.0.1 (aarch64-darwin)

bdj avatar Mar 22 '24 06:03 bdj

Is there anything new on this issue? Still there on devenv 1.3.1 (x86_64-linux)

loics2 avatar Nov 02 '24 14:11 loics2

Going to be addressed by #1548

domenkozar avatar Nov 12 '24 05:11 domenkozar

https://github.com/cachix/devenv/pull/1928 adds support for inputs.self.submodules, but it's very broken, possibly because of lazy trees.

sandydoo avatar Jun 13 '25 01:06 sandydoo

 /nix/store/ma2fs2a60gz04xsgxkdxqhqxxvinwn5h-nix-devenv-2.30.0pre20250626_afa41b0/bin/nix --extra-experimental-features flakes --option lazy-trees true --option warn-dirty false --keep-going --max-jobs 8 --option eval-cache false print-dev-env --profile /home/domen/dev/cachix/devenv/.devenv/gc/shell -vv --log-format internal-json
@nix {"action":"msg","level":4,"msg":"evaluating file '<nix/derivation-internal.nix>'"}
@nix {"action":"start","id":5924662571696128,"level":4,"parent":0,"text":"evaluating derivation 'git+file:///home/domen/dev/cachix/devenv#devShells.x86_64-linux.default'","type":0}
@nix {"action":"msg","level":4,"msg":"evaluating file '/home/domen/dev/cachix/devenv/.devenv.flake.nix'"}
nix: ../canon-path.cc:56: nix::CanonPath nix::CanonPath::removePrefix(const nix::CanonPath&) const: Assertion `isWithin(prefix)' failed.
Aborted (core dumped)

domenkozar avatar Jun 27 '25 18:06 domenkozar

Any news on this? It's a real show-stopper for my use case.

voodooattack avatar Sep 28 '25 12:09 voodooattack

Currently, you can still add the repo of the submodule as input and then import it from there, as described in https://devenv.sh/composing-using-imports/. But of course I'd also love to see to import from the submodule directly! ❤️

pbek avatar Oct 10 '25 19:10 pbek

We're going to fix this one soon :)

domenkozar avatar Nov 01 '25 16:11 domenkozar