Why does Cargo create multiple directories for the same registry?

Cargo stores the source code of the loaded boxes in $HOME/.cargo/registry/src(or the corresponding directory $CARGO_HOME). I understand that every unique registry that I use will create a separate directory, apparently to prevent conflicts.

I do not understand why the same repository created several directories:

$ ls -ld ~/.cargo/registry/src/github.com-*
drwxr-xr-x   473 shep  staff  16082 Dec 27  2015 ~/.cargo/registry/src/github.com-0a35038f75765ae4
drwxr-xr-x  1187 shep  staff  40358 Feb  8 19:10 ~/.cargo/registry/src/github.com-1ecc6299db9ec823
drwxr-xr-x   380 shep  staff  12920 Sep 11 12:16 ~/.cargo/registry/src/github.com-88ac128001ac3a9a

The hash added to the end supposedly plays a role in this. What makes Cargo create one of these directories? Will it revert to the previous directory and continue using it?

+4
source share
1 answer

: ( , git , ..) URL- .

, -url Hash Url, . pull request 2737, issue 1710; , , - URL, Url.

, Cargo SipHasher -. , , Cargo ( SipHasher , Cargo , ).

+5
source

Source: https://habr.com/ru/post/1669212/


All Articles