Skip to content

Cargo run is failing with "failed to set hostkey preference: The requested method(s) are not currently supported; class=Ssh" #14617

Open
@fabioz

Description

@fabioz

Problem

I was trying to build the zed editor following instructions from: https://github.com/zed-industries/zed/blob/main/docs/src/development/windows.md

When I get to the cargo run phase the process fails with the message below:

λ cargo run
    Updating crates.io index
    Updating git repository `https://github.com/kvark/blade`
error: failed to get `blade-graphics` as a dependency of package `gpui v0.1.0 (X:\zedws\zed\crates\gpui)`

Caused by:
  failed to load source for dependency `blade-graphics`

Caused by:
  Unable to update https://github.com/kvark/blade

Caused by:
  failed to fetch into: C:\Users\<username>\.cargo\git\db\blade-b2bcd1de1cf7ab6a

Caused by:
  network failure seems to have happened
  if a proxy or similar is necessary `net.git-fetch-with-cli` may help here
  https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

Caused by:
  failed to set hostkey preference: The requested method(s) are not currently supported; class=Ssh (23)

I can manually git clone that repository:

λ git clone  https://github.com/kvark/blade
Cloning into 'blade'...
remote: Enumerating objects: 5129, done.
remote: Counting objects: 100% (895/895), done.
remote: Compressing objects: 100% (380/380), done.
remote: Total 5129 (delta 604), reused 557 (delta 512), pack-reused 4234 (from 1)
Receiving objects: 100% (5129/5129), 5.00 MiB | 4.02 MiB/s, done.
Resolving deltas: 100% (3287/3287), done.

But I don't know why cargo can't (which makes the build fail). I tried changing the cargo toml from ssh to https so that it becomes:

blade-graphics = { git = "ssh://git@github.com/kvark/blade" }

But it still fails with a very similar message:

 λ cargo run
    Updating crates.io index
    Updating git repository `ssh://git@github.com/kvark/blade`
error: failed to get `blade-graphics` as a dependency of package `gpui v0.1.0 (X:\zedws\zed\crates\gpui)`

Caused by:
  failed to load source for dependency `blade-graphics`

Caused by:
  Unable to update ssh://git@github.com/kvark/blade

Caused by:
  failed to fetch into: C:\Users\fabio\.cargo\git\db\blade-88a49619c2e97d2a

Caused by:
  network failure seems to have happened
  if a proxy or similar is necessary `net.git-fetch-with-cli` may help here
  https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

Caused by:
  failed to set hostkey preference: The requested method(s) are not currently supported; class=Ssh (23)

Steps

Follow the steps from https://github.com/zed-industries/zed/blob/main/docs/src/development/windows.md on Windows

Possible Solution(s)

No response

Notes

I'm on Windows. The git version on the system is:

set git
git_executable=C:\Program Files\Git\cmd\git.exe
GIT_INSTALL_ROOT=C:\Program Files\Git
git_locale="C:\Program Files\Git\usr\bin\locale.exe"
GIT_SSH=PLINK.exe
GIT_VERSION_USER=2.39.0.windows.1

I tried unsetting GIT_SSH and it didn't make any difference (not sure if cargo actually uses my system git -- probably not otherwise it'd probably work).

I don't really have any proxies that need to be set.

Version

λ cargo version --verbose
cargo 1.81.0 (2dbb1af 2024-08-20)
release: 1.81.0
commit-hash: 2dbb1af
commit-date: 2024-08-20
host: x86_64-pc-windows-msvc
libgit2: 1.8.1 (sys:0.19.0 vendored)
libcurl: 8.8.0-DEV (sys:0.4.73+curl-8.8.0 vendored ssl:Schannel)
os: Windows 10.0.22631 (Windows 11 Professional) [64-bit]

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-gitArea: anything dealing with gitC-bugCategory: bugS-blocked-externalStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions