dune icon indicating copy to clipboard operation
dune copied to clipboard

pkg: Pinning a package to a non-existent github repo prompts for a github login

Open gridbugs opened this issue 1 year ago • 6 comments

If the url of a pin stanza is a non-existent repo, running dune pkg lock will print Username for 'https://github.com':. Dune will then hang and not respond to ctrl+c.

E.g.

(pin
 (url "git+https://github.com/gridbugs/not-a-repo")
 (package
  (name foo)
  (version 1.0)))

gridbugs avatar Mar 15 '24 06:03 gridbugs

I suppose we could use: https://stackoverflow.com/questions/23563062/how-do-i-force-git-not-to-prompt-for-credentials for now

rgrinberg avatar Mar 15 '24 09:03 rgrinberg

This happens because there's no way to tell if the repo does not exist, or if it is a private one. So I guess a related question is, do we support private repositories in pin?

emillon avatar Mar 15 '24 11:03 emillon

It's possible to configure one's git client to authenticate itself automatically. It would be nice to offer the user that option interactively as part of a dune build, but it's not so easy, so I'd say the priority is low.

rgrinberg avatar Mar 15 '24 11:03 rgrinberg

Do you know if opam supports this?

emillon avatar Mar 15 '24 11:03 emillon

I don't know but perhaps @kit-ty-kate does

rgrinberg avatar May 08 '24 18:05 rgrinberg

I believe opam just leaves stdin open so it should be possible to authenticate but nothing is done automatically

kit-ty-kate avatar May 09 '24 11:05 kit-ty-kate