-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
A-build-scriptsArea: build.rs scriptsArea: build.rs scriptsA-rebuild-detectionArea: rebuild detection and fingerprintingArea: rebuild detection and fingerprintingC-bugCategory: bugCategory: bugE-mediumExperience: MediumExperience: Medium
Description
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)
garzj
Metadata
Metadata
Assignees
Labels
A-build-scriptsArea: build.rs scriptsArea: build.rs scriptsA-rebuild-detectionArea: rebuild detection and fingerprintingArea: rebuild detection and fingerprintingC-bugCategory: bugCategory: bugE-mediumExperience: MediumExperience: Medium