Skip to content

include submodules with git clone --recursive #5882

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

Merged
merged 5 commits into from
Mar 21, 2019
Merged

include submodules with git clone --recursive #5882

merged 5 commits into from
Mar 21, 2019

Conversation

Juppit
Copy link
Contributor

@Juppit Juppit commented Mar 15, 2019

Since we have some submodules it is recomended to include them while cloning the project.

Since we have some submodules it is recomended to include them while cloning the project.
@d-a-v
Copy link
Collaborator

d-a-v commented Mar 16, 2019

This will include sub-sub modules like full lwIP repo, which is not necessary.
I recommend

git clone https://github.com./esp8266/Arduino.git esp8266
git submodule update --init

(and not git submodule update --init --recursive, just like in .travis.yml)

@Juppit
Copy link
Contributor Author

Juppit commented Mar 17, 2019

@d-a-v
My question is: do we know in each case whether sub-sub-modules are not needed?
Or is that only in this case?
I urge that the maintainer of the submodule decide what is needed.
So in this particular case, I would ask @d-a-v if he can remove the submodule upstream.
Or we decide here, e.g. via an entry in esp8266\ .gitignore

@d-a-v
Copy link
Collaborator

d-a-v commented Mar 18, 2019

do we know in each case whether sub-sub-modules are not needed?

Currently there are two sub-sub-modules: lwIP and BearSSL.
None of them are necessary for building sketches, because we already have precompiled libs in the core repository.
Even more, submodules "lwip2" and "bearssl adapter" (their parent) are not even needed for the same reason.

I would ask @d-a-v if he can remove the submodule upstream.

I don't understand why it is needed.
Goal of sub-(sub-)modules is to rebuild libs from original sources.
We were automatically pulling them but sometimes it fails (because not hosted on github and their respective website are sometimes down, which was breaking CI).

Or we decide here, e.g. via an entry in esp8266\ .gitignore

I don't know the implication of this, I'd think it would break rebuilding
(cd tools/sdk/lwip2|bearssl; make install will update both sub- and sub-sub-module and rebuild)

@Juppit
Copy link
Contributor Author

Juppit commented Mar 18, 2019

@d-a-v

Currently there are two sub-sub-modules: lwIP and BearSSL.
None of them are necessary for building sketches, because we already have precompiled libs in the core repository.
Even more, submodules "lwip2" and "bearssl adapter" (their parent) are not even needed for the same reason.

This part of Readme.md provides a standard procedure for creating the full repository from git.
For people only using it by Arduino or Platformio there is no need to do this.

I would ask @d-a-v if he can remove the submodule upstream.

I did not want to go that far with Upstream, I just meant your repo. :-)

Or we decide here, e.g. via an entry in esp8266\ .gitignore

I don't know the implication of this, I'd think it would break rebuilding
(cd tools/sdk/lwip2|bearssl; make install will update both sub- and sub-sub-module and rebuild)

At this point, I see the same problem when we exclude sub-sub-modules with "git submodule update --init".

Cons: In the specific case, an overhead of a few MByte unused sources
Pros: Avoid unknown implications of future submodule versions

The right decision can actually only be made within the sub-module
specifically by @d-a-v and @earlephilhower in there repos, but not in the more global recipe in the Readme.

So my opinion is clear: pro "git clone --recursive".

Your knowledge of Github is certainly greater than mine, as I take your various tips for easy patching the github sources in this repo.

@d-a-v
Copy link
Collaborator

d-a-v commented Mar 18, 2019

This will include sub-sub modules like full lwIP repo, which is not necessary.

So my opinion is clear: pro "git clone --recursive".
git clone --recursive https://github.com./esp8266/Arduino.git esp8266

Well you are right, it is documentation, I suggest adding this for completeness:

# mandatory:
git clone https://github.com./esp8266/Arduino.git esp8266
git submodule update --init

# or: with source for precompiled libraries: (fetching more repositories)
git clone --recursive https://github.com./esp8266/Arduino.git esp8266
# same as:
git clone https://github.com./esp8266/Arduino.git esp8266
git submodule update --init --recursive

Juppit added 2 commits March 18, 2019 16:14
Instead of 'git clone --recursive' (which also clones submodules of submodules) this is the minimum for a submodule update.
You may also need to run this update recursively ('git submodule update --init --recursive').
@d-a-v d-a-v mentioned this pull request Mar 21, 2019
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants