Problem
If a project with a build script has a symbolic link pointing to somewhere unreadable, cargo build fails.
Steps
$ git clone https://github.com/sharkdp/fd.git # For example
$ cd fd
$ ln -s /root root # Normal users can't read /root
$ cargo build
error: failed to determine package fingerprint for build script for fd-find v8.2.1 (/home/tavianator/code/sharkdp/fd)
Caused by:
failed to determine the most recently modified file in /home/tavianator/code/sharkdp/fd
Caused by:
failed to determine list of files in /home/tavianator/code/sharkdp/fd
Caused by:
cannot read "/home/tavianator/code/sharkdp/fd/root"
Caused by:
Permission denied (os error 13)
Possible Solution(s)
I suggest not following symbolic links when calculating the fingerprint.
I actually ran into this with a symlink to /, which caused
Caused by:
cannot read "/home/tavianator/code/sharkdp/fd/why/dev/vboxusb"
meaning it was trying to recursively scan my whole file system.
Notes
Output of cargo version:
cargo 1.53.0 (4369396ce 2021-04-27)
Problem
If a project with a build script has a symbolic link pointing to somewhere unreadable, cargo build fails.
Steps
Possible Solution(s)
I suggest not following symbolic links when calculating the fingerprint.
I actually ran into this with a symlink to /, which caused
meaning it was trying to recursively scan my whole file system.
Notes
Output of
cargo version: