-
Notifications
You must be signed in to change notification settings - Fork 192
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
"Easily" switch between HTTPS and SSH #357
Comments
The suggested global config options seem to me like a recipe for pain when testing and dealing with conflicting settings from the tree of dependencies. I think a better solution would be to just add more shorthand schemes like The shorthand syntax works with full uris as well. You could easily use: set(ghs "[email protected]")
# ...
CPMAddPackage("${ghs}:XXX/[email protected]") |
The thing is that which scheme to use does not depend on the project, but rather on the environment you are building on. Additional shorthand schemes would not really help for that. Also, can you elaborate on "dealing with conflicting settings from the tree of dependencies"? |
Hey, thanks for the issue! As this seems to be a machine dependent configuration option, have you looked into simply using the Supporting CI with this approach is also straightforward as illustrated in our README. Using |
@itavero overriding arguments via a configuration setting always leads to edge cases which hard to identify and hard to test. I'm not sure how this particular setting might affect things, but my gut tells me that it's a bad idea. A (somewhat contrived) is that on a system with several instances of package X which requires package Y and makes use of a global cache, in certain cases Still, it's the examples that I can't think of that make me weary of this proposal. Your suggestion only affects the shorthand syntax. Using the full syntax of I agree that additional schemes are not the best idea and I'm definitely not pushing for them. Using a custom variable for prefixing uris can also work and would even support relative paths (though in this case all affected uris must be touched by the team). Using .gitconfig as @TheLartians proposed seems like the best of all worlds, no? I personally am trying to think of a good way to handle package uris, which will support relative paths, redirection, and perhaps most importantly potential future CPM repos (allowing something in the lines of |
You both have valid points. I always forget about the rewrite option. I'll see if I can easily deploy a Group Policy in our domain to add these automatically for out engineers. With regards to the package URIs: I think you'd need some kind of registry for that. Anyway, I'll close this issue. Thanks for the feedback! 👍 |
I'm currently looking into deploying CPM.cmake within our organization.
The "shorthand" URIs look convenient, but I think it's a downside that they always resolve to an HTTPS link.
For public repositories, this is probably fine, as no authentication is needed.
For private repositories, we tend to stick to SSH keys for authentication (at least on our development machines; the CI pipeline is probably a different story).
I think, depending on the environment, you'd either use SSH for all of your GitLab repositories (or GitHub, or BitBucket, ...) or you'd want to stick with HTTPS.
If #333 would be merged and provide the relative URI mechanism in line with my expectations, we can probably use that to work around the different URI schemes on different environments.
Otherwise, I think it makes sense to be able to influence the URI scheme from an (environment) variable, something like:
CPM_URI_SCHEME_GL
, for GitLabCPM_URI_SCHEME_GH
, for GitHubCPM_URI_SCHEME_BB
, for BitBucketThese variables could either be unset, or set to
ssh
orhttps
.Based on this the
CPM_ARGS_GIT_REPOSITORY
can be set accordingly for these different providers inCPM.cmake
.How do you feel about such an addition?
The text was updated successfully, but these errors were encountered: