Repository navigation
Clone submodules over HTTPS, not SSH - #635
Conversation
Important for build systems that don't have an SSH key tied to GitHub.
xylar
left a comment
There was a problem hiding this comment.
This worked great for me and does seem like a useful change.
philipwjones
left a comment
There was a problem hiding this comment.
This is a good step. To fully eliminate the message for standalone builds with the regular Make system, we also need the following in src/core_ocean/Makefile:
replace:
(pwd ; echo "Missing core_ocean/cvmix/.git, did you forget to 'git submodule update --init --recursive' ?"; exit 1)
with:
(echo "Retrieving ocean submodules"; git submodule update --init --recursive; cd cvmix/src/shared; make all FC="$(FC)" FCFLAGS="$(FFLAGS)" FINCLUDES="$(FINCLUDES)")
and similarly:
(echo "Missing core_ocean/BGC/.git, did you forget to 'git submodule update --init --recursive' ?"; exit 1)
with
(echo "Retrieving ocean submodules"; git submodule update --init --recursive; cd BGC; make all FC="$(FC)" FCFLAGS="$(FFLAGS)" FINCLUDES="$(FINCLUDES)") \
I tested this on both NERSC and Summit. With those changes, the model successfully built without needing an explicit submodule update command and did not trigger any ssh key passwords. So finally does what @pwolfram wanted. It will still fail if people don't have a git module loaded or git in their path, but think that'll be rare.
|
Thanks for reviewing. @philipwjones, will that cause issues if someone updates the references for your submodules? For people who have already built MPAS, the Would it be better to drop the conditional and always run the update as part of the |
|
Actually, I would really appreciate it if the build system didn't try to automatically update the submodules. Doing so will cause a couple issues in container-based environments:
So, for what it's worth, I'd much prefer the explicit error to implicitly trying to download the submodules. |
|
@Helumpago - that's fine with me. I don't have a problem with the current setup and don't think it's too much of a burden to either remember to update after checkout or get a reminder if you don't. I think others have found it more of an annoyance, so we had been exploring alternatives. But I do think we should make your change at least - that does save some extra password queries and allows you to walk away from a long build without it hanging up waiting for you to enter a password. And yes, you're correct that the changes to the makefile would not pick up an update in the submodule reference so you might be running with an old submodule. But that's also true of the current situation. |
mark-petersen
left a comment
There was a problem hiding this comment.
@Helumpago this is great, thanks for your contribution. I'll merge it soon.
This PR updates the
.gitmodulessettings so that Git will clone the CVMix and BGC repositories over HTTPS instead of SSH.This is important for systems (e.g., build servers) that don't have an SSH key associated with GitHub. These systems need to clone public repositories using anonymous HTTPS.
Prior to this change, attempts to build this repository would emit the following error:
Missing core_ocean/cvmix/.git, did you forget to 'git submodule update --init --recursive' ?Due to not having an SSH key registered with GitHub, running the requestedgit submodule update --init --recursiveline fails due to insufficient access rights.After this PR, the update command works correctly on anonymous systems.