Code Monkey home page Code Monkey logo

Comments (2)

Hirevo avatar Hirevo commented on May 12, 2024

By default, Alexandrie already manages its crate index using the git command line utility instead of libgit2, as specified in the default alexandrie.toml file:

[index]
type = "command-line"
path = "crate-index"

The issue with a crate index configured using SSH is that the issue we mentioned arises on the users' machine (the consumers of the libraries hosted by the instance) when they perform cargo build or cargo search.
It is an issue happening outside of Alexandrie's reach.

Fixing the default can only be done within Cargo itself; here is a direct link to the libgit2 authentication handling in Cargo's source code.
This is the piece of code that, reportedly, does not always find the needed credentials to pull/push through SSH.
And by setting CARGO_NET_GIT_FETCH_WITH_CLI, we tell Cargo to not attempt to find the credentials and do things itself, but rather to let the system git utility to sort it out for us.

from alexandrie.

gitartpiano avatar gitartpiano commented on May 12, 2024

Your explanations clarified for me.

I have also found out from cargo's https://doc.rust-lang.org/cargo/reference/config.html , that instead of the environment variable CARGO_NET_GIT_FETCH_WITH_CLI, I can also write this

[net]
git-fetch-with-cli = true   # use the `git` executable for git operations

into top level cargo config file:

Windows: %USERPROFILE%\.cargo\config.toml
Unix: $HOME/.cargo/config.toml

Since this is an easy workaround, there is no need for changing any defaults, I changed my mind.

from alexandrie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.