tweag / topiary

https://topiary.tweag.io/
MIT License
579 stars 29 forks source link

Support grammars in private repositories / repositories accessed via Git+SSH #776

Closed Niols closed 1 month ago

Niols commented 1 month ago

Is your feature request related to a problem? Please describe.

When using Topiary and the newly-added dynamic support of grammars, and when I try to access a private repository (or any repository via Git+SSH), I get the following error:

[2024-10-23T09:38:46Z ERROR topiary] Error Fetching Language: Git(Error { code: -16, klass: 23, message: "authentication required but no callback set" })

My supposition is that Git tries to authenticate, finds a valid public SSH key, but my private SSH key has a password, and Git doesn't know where to request the unlocking of the key.

Describe the solution you'd like

Topiary should gracefully forward authentication to whatever mechanism the user uses. I have no idea how this works, so I cannot give details, but other utilities that rely on Git manage to trigger my password manager to unlock my SSH key properly. I suppose it might be something like passing the right terminal handle to the underlying Git process? :shrug:

Additional context

In fact, in my case, I was not trying to access private grammars, but my git configuration contains

[url "ssh://git@github.com"]
    insteadOf = "https://github.com/"

leading to SSH authentication also to download public repositories.

Niols commented 1 month ago

Apparition of the issue:

$ git bisect start 'main' 'v0.4.0'
89e9002 bad release: version 0.5.0 (#774)
ba4f440 good release: version 0.4.0

$ git bisect bad b4a842673b2849fd1efef23df39cc25e26a352c8
b4a8426 bad Merge pull request #735 from tweag/nb/ocaml_misc

$ git bisect good 6be487b37f719b08b41cd13e6e3aa58756423cb4
6be487b good Merge pull request #720 from jonsterling/fix-719

$ git bisect skip 66c1e81c6b4ea175452f21fceebe50d81d9ad4aa
66c1e81 skip feat(config): embed TARGET triple via build.rs

$ git bisect skip 967a80513ea54bbf44a84381e08fa186cc203914
967a805 skip fix(config): add subdirs to ocaml and ocaml_interface

$ git bisect bad b81522f272416069d7716cf45c12f8453a4394de
b81522f bad chore: flake update

$ git bisect good a8bc7e567c4e46ace040b0fbd0a581502f35c82e
a8bc7e5 good Update CHANGELOG

$ git bisect bad 9e476d1a45fd8e267f6b464b67b8554735a3954f
9e476d1 bad chore: update CI to test non-nix compatible tests

$ git bisect skip 04315d920cbd8fd51f20390bd93d2f2a070ff681
04315d9 skip feat(config)!: fetch tree-sitter grammars and compile them

$ git bisect good ab2b28aee6a7dceedf227dc95d676806abca5c85
ab2b28a good build(deps-dev): bump axios from 1.6.6 to 1.7.7 in /web-playground

$ git bisect bad 6d0a86998e7fe8a26d40a7320229749b7e84d18e
6d0a869 bad feat!: update tree-sitter

$ git bisect good 92f4bb90649068122c6d50c091433c6e2291cc89
92f4bb9 good Merge pull request #733 from tweag/dependabot/npm_and_yarn/web-playground/axios-1.7.7

and the result:

There are only 'skip'ped commits left to test.
The first bad commit could be any of:
967a80513ea54bbf44a84381e08fa186cc203914
04315d920cbd8fd51f20390bd93d2f2a070ff681
66c1e81c6b4ea175452f21fceebe50d81d9ad4aa
6d0a86998e7fe8a26d40a7320229749b7e84d18e
We cannot bisect more!

All these commits belong to https://github.com/tweag/topiary/pull/716, the PR that introduced dynamic loading of grammars.