Skip to content

Repos specified by git should have an option to initialize submodules #1764

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

Closed
acfoltzer opened this issue Feb 9, 2016 · 3 comments
Closed

Comments

@acfoltzer
Copy link
Contributor

We probably don't want to wind up turning the location: block into a full git porcelain, but it would be very handy to at least have Stack to a git submodule update --init after checking out a particular revision, otherwise packages that have submodules won't build. I often run into this with FFI wrappers around a C library that don't have particularly sophisticated uses of submodules, so we might not need much configurability.

Maybe something like:

- location:
    git: https://github.com/acfoltzer/hs-ed25519-donna.git
    commit: 7e99a67cae6e3946873ca071536ff0ad3cb23948
    init-submodules: true
    extra-dep: true

If there's an equivalent for Mercurial, it would also be nice to support that while we're at it, I just am not familiar with it.

@mgsloan
Copy link
Contributor

mgsloan commented Feb 10, 2016

Agreed! I'm inclined to default to cloning with --recursive, so you only specify recursive: false if you want that. This would be a behavior change, but I think it's fine as long as it's noted in the ChangeLog.

I read a git mailinglist thread about this. Sounds to me like --recursive isn't a default because:

  • It's a change of behavior
  • The risk of accidentally using more network / disk resources than intended outweighs the inconvenience of needing to specify --recursive

This is a bit off topic, but it occurred to me that the parent repo will know if there are optional submodules which are large. In other words, to me it would be ideal if the .gitmodules file specified which modules to skip doing a recursive clone.

@mgsloan mgsloan added this to the P2: Should milestone Feb 11, 2016
@robrix
Copy link
Contributor

robrix commented Feb 28, 2016

Per the CONTRIBUTING.md document, I’ve opened #1852 to implement this as we’d very much like this for some of our packages.

@mgsloan
Copy link
Contributor

mgsloan commented Feb 29, 2016

PR merged, thanks @robrix !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants