nimble icon indicating copy to clipboard operation
nimble copied to clipboard

nimble install doesn't clone git submodules

Open johnnovak opened this issue 4 years ago • 5 comments

Probably you'll want to enable Git submodule cloning by default (--recurse-submodules option). Seems like a sensible default to me and I see no reason why Nimble should not clone submodules if the package developer decided to use them. The lack of submodule cloning currently breaks xxhash.nim, for example.

https://github.com/OpenSystemsLab/xxhash.nim

johnnovak avatar Nov 15 '19 23:11 johnnovak

Thought we already do this, there is a bunch of commands we have that appear to do this: https://github.com/nim-lang/nimble/blob/master/src/nimblepkg/download.nim#L28

dom96 avatar Nov 16 '19 10:11 dom96

@dom96 Well, try installing that module I mentioned and see what happens. It does not currently clone the submodule inside the private directory.

That link you sent is for update though, no? This seems to be the actual clone (install) command I think:

https://github.com/nim-lang/nimble/blob/16ba5db44e0a9132f966a2082012cc3520bfec06/src/nimblepkg/download.nim#L53

I'm not exactly a git expert and I know little about submodules, but using git clone --recurse-submodules did the trick for me to clone the repo manually so I could actually use the module.

johnnovak avatar Nov 16 '19 21:11 johnnovak

The submodule does get checked out in temp but does not get copied into ~/.nimble/pkgs. Looks like a workaround would be to use installDirs.

Should nimble be smart enough to copy submodules automatically? Will require it to parse the .gitmodules file.

genotrance avatar Feb 13 '20 21:02 genotrance

Why doesn't it get installed? The submodule is in the "srcDir" (since the srcDir is . in that package's case) so no reason Nimble should ignore it if it exists.

dom96 avatar Feb 19 '20 21:02 dom96

Unclear, probably after the code change a couple years ago where files are scanned before the before hook so any files generated after that get skipped. This broke nimgen.

Might be same root cause here but speculation.

genotrance avatar Feb 19 '20 21:02 genotrance