The `sudo make install` is a known problem from the effects of the 
`safe.directory` design, which was in response to a CVE vulnerability of 
accessing repositories that you don't own. 

The use of `sudo` changes the userID, so one can fall into the trap of not 
appearing to own repositories you know are good.

The extended discussion on the mailing list, which includes various 
explanations, is at 
https://lore.kernel.org/git/[email protected]/t/#u

Philip

On Monday, June 6, 2022 at 4:55:21 PM UTC+1 [email protected] wrote:

> Dear all,
>
> I work on a Ubuntu 20.04.4 LTS machine with Linux Mint installed. My 
> version of git is 2.36.1.
>
> I am trying to install a git repository, complexespp 
> <https://github.com/bio-phys/complexespp/tree/main/complexes%2B%2B>, 
> which requires the external repository yaml_cpp 
> <https://github.com/jbeder/yaml-cpp>. While running the last step of 
> installation of complexespp
> sudo make install
> I face the following problem:
>
> [  1%] Performing update step for 'yaml_cpp_project'
> CMake Error at 
> /home/davide/Desktop/complexespp/complexes++/build-gen/yaml_cpp_project-prefix/tmp/yaml_cpp_project-gitupdate.cmake:25
>  
> (message):
>  Failed to get the hash for HEAD:
>
>  fatal: unsafe repository
>
>  
> ('/home/davide/Desktop/complexespp/complexes++/build-gen/yaml_cpp_project-prefix/src/yaml_cpp_project'
>  is owned by someone else)
>
>  To add an exception for this directory, call:
>
>      git config --global --add safe.directory
>
>  
> /home/davide/Desktop/complexespp/complexes++/build-gen/yaml_cpp_project-prefix/src/yaml_cpp_project
>
> make[2]: *** [CMakeFiles/yaml_cpp_project.dir/build.make:118: 
> yaml_cpp_project-prefix/src/yaml_cpp_project-stamp/yaml_cpp_project-update] 
> Error 1
> make[1]: *** [CMakeFiles/Makefile2:418: 
> CMakeFiles/yaml_cpp_project.dir/all] Error 2
> make: *** [Makefile:146: all] Error 2
>
> I ran the advised line of code and the path added to ~/.gitconfig as 
> [safe], but the sudo command goes on returning the same error (even if I 
> set "*" as safe). Do you have any idea about how to fix it?
>
> Thanks a lot in advance
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/722a17f8-b33a-40d7-8f8e-8735a98f4433n%40googlegroups.com.

Reply via email to