Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

GitDownloadStrategy: Control submodule clones #17783

Closed
staticfloat opened this issue Feb 12, 2013 · 5 comments
Closed

GitDownloadStrategy: Control submodule clones #17783

staticfloat opened this issue Feb 12, 2013 · 5 comments
Assignees

Comments

@staticfloat
Copy link
Contributor

Is there a way to communicate to the GitDownloadStrategy that we don't want to clone submodules? Julia's buildsystem has moved to git submodules for dependencies (e.g. openlibm, nginx, Rmath, libuv) and I'd like to manually manage those dependencies with Homebrew. E.g. since we have an nginx formula in Homebrew, I'd like to use that nginx instead of having Julia download/build her own.

Once the install method of my formula is invoked, I can exercise control over Julia's build process (e.g. pass the proper flags to make to stop her from compiling her own nginx from the sources that have been downloaded) however I can't figure out how to exercise control over which submodules are downloaded. I would happily patch .gitmodules or somesuch if that would work, however submodules are automatically downloaded before any of my code runs, including patches. Is there a way to modify this behavior in Homebrew?

@adamv
Copy link
Contributor

adamv commented Feb 12, 2013

It will have to be done by writing code, I'm afraid. Checkout the existing download strategies for examples of how we use inheritance in them. Line 386 is where we do submodule things, will probably need to add some member flag that is checked as well.

@jacknagel
Copy link
Contributor

I'll take a crack at this, looks like a good opportunity to clean up the methods in this class.

@ghost ghost assigned jacknagel Feb 12, 2013
@staticfloat
Copy link
Contributor Author

Thanks, Jack! I am so busy this quarter, it would take me weeks to get this
done.
On Feb 12, 2013 8:30 AM, "Jack Nagel" [email protected] wrote:

I'll take a crack at this, looks like a good opportunity to clean up the
methods in this class.


Reply to this email directly or view it on GitHubhttps://github.com//issues/17783#issuecomment-13441087.

@jacknagel
Copy link
Contributor

Patches to Homebrew: https://github.com/jacknagel/homebrew/compare/git

formula-side changes:

class GitNoSubmoduleDownloadStrategy < GitDownloadStrategy
  def submodules?; false; end
end

class SomeFormula < Formula
  url '...', :using => GitNoSubmoduleDownloadStrategy

  # ...
end

I don't want to bother adding a flag to the DSL or anything yet.

@jacknagel
Copy link
Contributor

Merged my patches.

@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants