-
Notifications
You must be signed in to change notification settings - Fork 709
cabal.project: source-package-repository with submodule #5536
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
Comments
Found while referencing hlibgit2 from https://github.com/jwiegley/gitlib/. /cc @23Skidoo. |
From
|
@Tuncer ...would you be willing to try creating a PR? The tricky part is probably making sure that submodules are properly updated/setup/removed/added when you change the |
Don't think I can get to it in time for 2.5, so feel free to take over. Concerning the implementation:
|
@Tuncer maybe the following would be a reasonable 80/20 solution to sync submodules after having checked out a new commit:
this should work in most case and only choke on corner cases ...and there's of course also the brutal but robust approach: whenever a different commit needs to be checked out, start from scratch; i.e. remove the git checkout completely and or we could remove everything but the top-level |
The four git invocations look good to me. Since you suggest to additionally remove clones explicitly, I wonder why you wrote What do you think about generally using As an always-works/brute-force method, I can see the advantage of nuking everything but |
Extra idea that's not required for the initial implementation: Rust's cargo manages git dependencies by storing them in |
I suggested
What cargo does sounds interesting, but it also sounds more complicated to implement? do you happen to know what steps would be involved in maintaining a global git cache? how well does this work w/ cargo? can we steal the logic from cargo? |
In that case, we can just nuke everything but the outer I just noticed cargo's git repo sharing and it reminded me of how Darcs shares patches, but I don't know the details of their implementation. Since I suspect users would demand a cache in different levels/places, perhaps starting with a bare+checkout model inside dist-newstyle would be sufficient and easy enough? Later we could look into a shared cache and the complexity involved with that.
|
Hrm, but if I'm starting to think we should just start w/ the basic idea of
and see how far we get with that approach; cabal can easily keep track of which Does this sound reasonable? Does it address your requirements? PS: Btw, another kind of tooling we could look at is how CI buildbots manage to clone new states of a Git repo while keeping a cache the git objects |
Yes, the simple method we discussed ought to work. Since smart caching is a secondary concern and unrelated to recursive clones, let's tackle submodules first. In fact, smart caching is an optimization and won't block 2.5. So, maybe we should open a separate ticket. I don't think all CI systems reuse git objects, but it's interesting to investigate, sure. |
Still an issue with a recent version of cabal. |
This is currently blocking |
Upon reflection, would it be possible to simulate this with a custom Setup.hs? |
/cc @dcoutts |
If you have a source-repository-package of type git in cabal.project, and that project has a submodule, then the current arguments passed in
VCS.vcsGit
are insufficient. I think vcsGit'scloneArgs
ought to, by default, use--recursive
. Otherwise, files needed for building might be missing.The text was updated successfully, but these errors were encountered: