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

Option to skip cloning git submodules during opam installation of dependecies #6260

Open
filipeom opened this issue Oct 24, 2024 · 3 comments

Comments

@filipeom
Copy link

From this comment, I gather that opam automatically checks out submodules when it detects a .gitmodules file during the initial setup of the installation process:

clean repo_root @@+ fun () ->
if OpamFilename.exists (repo_root // ".gitmodules") then
git repo_root [ "submodule"; "update"; "--init"; "--recursive" ]

However, in my case, I want to handle submodules manually since they are not needed during the build process. This is causing issues in our CI, as the submodules we include are quite large, leading to CI failures.

To fix my issue, I’ve been removing the .git directory during the initial CI setup. However, this workaround introduces undesired behavior in another CI workflow.

I believe there is currently no way in opam to disable the behavior of fetching submodules when a .gitmodules file is present during a call to opam install . --deps-only. Could we add a flag, such as --ignore-git-submodules, to give users control over this behavior? Or would this cause futher issues I'm not aware?

Thanks in advance!

@kit-ty-kate
Copy link
Member

To fix my issue, I’ve been removing the .git directory during the initial CI setup. However, this workaround introduces undesired behavior in another CI workflow.

What about simply removing the .gitmodules then committing instead? This should get rid of the issue and avoid the unwanted submodule fetching.

@filipeom
Copy link
Author

What about simply removing the .gitmodules then committing instead? This should get rid of the issue and avoid the unwanted submodule fetching.

Yes for my use-case this fixes the issue 😃

@kit-ty-kate
Copy link
Member

if we end up adding an option disabling submodules, it could be nice to also have an option to disable git-lfs

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

2 participants