Skip to content
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

use git submodules instead of copying dependencies #625

Closed
sgeisler opened this issue Oct 5, 2016 · 15 comments
Closed

use git submodules instead of copying dependencies #625

sgeisler opened this issue Oct 5, 2016 · 15 comments

Comments

@sgeisler
Copy link
Contributor

sgeisler commented Oct 5, 2016

Imo the project structure would be cleaner if dependencies weren't just copied into the git repo but linked as git submodules. Updates of dependencies would not produce large changes since only the references get updated.

The only downside of this is that people need to clone recursively git clone --recursive <repo> which is slightly uncommon and could lead to irritations if people forget to add the --recursive flag.

@haiqu
Copy link
Contributor

haiqu commented Oct 7, 2016

Can you give an example of the type of dependencies you're talking about, and how often they're updated? The only one I can think of currently is Java itself, and after the current bugs are ironed out in the next version and the patches are removed I can't see a need to ever change it again.

@sgeisler
Copy link
Contributor Author

sgeisler commented Oct 7, 2016

I'm talking about all modules which seemingly just got copied into this git repo from other repos, like:

  • jsocks
  • jtorctl
  • jtorproxy

if you update these dependencies you will have to replace these directories and produce a big diff. With submodules you could just "link" to another version.

@haiqu
Copy link
Contributor

haiqu commented Oct 7, 2016

Manfred, are we likely to change those?

@sgeisler
Copy link
Contributor Author

sgeisler commented Oct 7, 2016

It's not just about changing versions, it's also about a clean structure. I see that it isn't that urgent, but in the long run you want to decouple your project from it's dependencies.

If you want to see how submodules look like you can have a look at my project LogSim. You will see that I linked the project nlohmann/json at commit 0a81353. Once you clone it recursively you will be able to work with it like a directory (I include a header file from this project).

@haiqu
Copy link
Contributor

haiqu commented Oct 7, 2016

OK. Help me to understand this a bit better. If we do that, will a git pull also update dependencies? Because if that's the case we will end up with myriad variables in the build, which would be a Bad Thing(tm).

@sgeisler
Copy link
Contributor Author

sgeisler commented Oct 7, 2016

No, that's not how it works. Submodules are a link to a specific version of some git repository, they won't update automatically. You can update submodules as described in this StackOverflow answer.

We might want to have a fork of the linked repos in our organization namespace. This would keep our project intact no matter what happens to the original repo (deleting/force pushing). So for updating the submodule we would first pull all changes into the bitsquare forked repo and after that update the submodule.

@haiqu
Copy link
Contributor

haiqu commented Oct 7, 2016

OK, sounds sensible to me.

@ManfredKarrer
Copy link
Member

@sgeisler : Ah I also though you mean all modules. Those modules copied from other projects are definitely good to use as submodules. It would be also more clear to new devs that those are not core Bitsquare code base. We could even use just libraries of those, so compilation would be a bit faster (at first time, then its cached).
I just don't have time soon to work on that myself.

@haiqu
Copy link
Contributor

haiqu commented Oct 18, 2016

Manfred, if I add a lib subdirectory and put the prebuilt jar files in there would you be happy with that solution? I can do it today.

@sgeisler
Copy link
Contributor Author

sgeisler commented Oct 18, 2016

Please don't do this, pre built ‎binaries are really hard to audit. Furthermore it would be just a superficial improvement, since they would still be in the project.

@ManfredKarrer
Copy link
Member

Good point. Will use the sub module approach as soon I find time for it.

@haiqu
Copy link
Contributor

haiqu commented Oct 18, 2016

OK. It was harder to do than I anticipated anyhow, due to the need to convince Maven to distribute to the correct place from a local repo. I'll leave it for now.

@haiqu
Copy link
Contributor

haiqu commented Oct 19, 2016

I tried setting this up but it's really messy. jtorproxy relies on jsocks and jtorctl as submodules and pulls them in again. Since none of these projects have been worked on for many years I think we should dump the whole idea of adding them as submodules.

@stale
Copy link

stale bot commented Jan 18, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the was:dropped label Jan 18, 2019
@stale
Copy link

stale bot commented Jan 25, 2019

This issue has been automatically closed because of inactivity. Feel free to reopen it if you think it is still relevant.

@stale stale bot closed this as completed Jan 25, 2019
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