-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
vcpkg's git strategy appears to neglect submodules #6886
Comments
COMMAND ${GIT} clone
or |
Nice. |
use as you want |
Thanks for the advice guys. I'm still on the fence about whether I think
From what I've seen so far, developers who use sub modules tend to want to freeze the code they are pulling from upstream (at a certain commit) to facilitate consistent reproducible builds. So a vcpkg port which compiles against code which is further ahead or behind in development than that of the position of the sub module checkout could maybe create undesirable results in the resulting compiled outputs. The solution here to use |
Some git repositories use submodules.
Submodules are external repositories which need to exist in the build tree at build time but which are not checked out along with the repo by git without a follow up command.
Although eventually, it makes sense to split out submodule dependencies into their own individual ports (for each individual piece of software,) initially: doing so might not be ideal.
To update sub modules within a repository : the following command should be run once a source tree has been downloaded:-
git submodule update --init
An "update submodule" switch for the vcpkg_from_git, vcpkg_from_github and vcpkg_from_gitlab functions would really help ports which need to do this. Especially for software which incorporates obscure libraries as sub modules (which serve no use as individual ports.)
https://github.com/microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_from_github.cmake#L114
A shallow clone, followed up by the sub module update command instead of an archive pull is my initial idea regarding a solution.
To try to solve this currently, for example, if you:-
Within a portfile; the result appears to be:
I'm fairly new to git submodules but I think this:
https://github.blog/2016-02-01-working-with-submodules/
is a pretty good place to begin to learn about them (for anyone else interested.)
Also of note, the file .gitmodules in the root of the repository holds the sub module information. Should you want to add them manually to a port file or to fork them out into their own respective individual ports.
So is git submodule support within vcpkg some thing that could happen or have I missed an existing way vcpkg already deals with this?
The text was updated successfully, but these errors were encountered: