mirage / ocaml-github

GitHub APIv3 OCaml bindings
ISC License
100 stars 61 forks source link

github-unix depends on lambda-term just for the executables #237

Closed emillon closed 3 years ago

emillon commented 3 years ago

Hi,

I'm using github-unix in a project with few dependencies, but I noticed that it pulls lambda-term.

After having a look, it seems that it's not used by the github-unix library itself, but by the executables built under gist/ and jar/ (that are attached to the github-unix package).

What do you think about adding a new package github-unix-bin (or github-unix-tools?) that just contains these executables in order to remove the github-unix -> lambda-term dependency? I'm happy to provide a patch.

Thanks!

avsm commented 3 years ago

It would be less churn to just snip the lambda term dependency; it's only for reading passwords https://github.com/mirage/ocaml-github/blob/master/jar/passwd.ml

avsm commented 3 years ago

If you want a very quick workaround, you can just apply the core functor yourself very easily:

https://github.com/mirage/ocaml-github/blob/master/unix/github.ml

emillon commented 3 years ago

Thanks for the workaround. It's not a hard blocker, but I found the dependency a bit strange.

I'm not sure there's an easy way to read a password without echo from the console without lambda-term. What do you suggest?

avsm commented 3 years ago

What does dune-release do?

emillon commented 3 years ago

It calls tcsetattr by hand. According to the docs, this is not implemented on windows so I suppose there's a local echo.