Open filipeom opened 3 weeks ago
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.
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 :smiley:
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:https://github.com/ocaml/opam/blob/f0ba0c2fb1145fc596c9cf6d997db7d91e36c432/src/repository/opamGit.ml#L178-L180
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 toopam 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!