-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempting to run cargo new hello_cargo
gives an error, not finding safe.directory
#11365
Comments
Thanks for the report! I have identified what is causing the error and am preparing a fix. As for getting you up and running now, we might need to do a little investigation to figure out why it is happening to you. The problem is that git doesn't allow opening git repositories that are owned by a different user. If you are creating your project in a directory that is owned by a different user, that looks like it will trigger the error. Can you check what your current user is (running If the ownership is different, some things you can do:
|
Got it! I changed the ownership to be the same (the directory I was using was from an old Linux installation and it was still registered to the old user). Seems that this was just a matter of poorly-written error message. I was now able to run the cargo command as expected. |
Fix git2 safe-directory disable The call to `set_verify_owner_validation` was not getting called unless a network configuration was found. This means in the common case that `cargo new` will fail when there is a safe-directory error. This fixes the issue by making sure that `set_verify_owner_validation` is called before the early-exits in `init_git_transports`. Fixes #11365
Fix git2 safe-directory disable The call to `set_verify_owner_validation` was not getting called unless a network configuration was found. This means in the common case that `cargo new` will fail when there is a safe-directory error. This fixes the issue by making sure that `set_verify_owner_validation` is called before the early-exits in `init_git_transports`. Fixes #11365
Fix git2 safe-directory disable The call to `set_verify_owner_validation` was not getting called unless a network configuration was found. This means in the common case that `cargo new` will fail when there is a safe-directory error. This fixes the issue by making sure that `set_verify_owner_validation` is called before the early-exits in `init_git_transports`. Fixes rust-lang#11365
Problem
Hello,
I'm attempting to start using Rust for the first time. I was going through this guide:
https://doc.rust-lang.org/book/ch01-03-hello-cargo.html
I ran the basic Hello World, and now when it was time to start using Cargo, I went into my projects directory (which currently holds only the
hello_world
directory), and, as per the guide, rancargo new hello_cargo
. When I run this, I get the following error:After this occurs, the
hello_cargo
directory has been created, but is empty.Steps
Unable to provide any reliable reproducing steps.
Possible Solution(s)
No response
Notes
I'm running a fairly fresh installation of Mint 21. I just installed it last week. I'm not using Docker or anything like that, and I just installed Rust with the procedure listed in the guide I linked above.
Version
The text was updated successfully, but these errors were encountered: