]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Disable hardlink testing on AFS (#584)
authormegatesla <paulbunc@gmail.com>
Sun, 26 Apr 2020 18:19:51 +0000 (13:19 -0500)
committerGitHub <noreply@github.com>
Sun, 26 Apr 2020 18:19:51 +0000 (20:19 +0200)
AFS sort of supports hardlinks, but not really - you can only hardlink
within directories, not across them. This means that the hardlink test
suite probe will pass, but ccache is unable to create hardlinks to its
cache directory and the test suite will fail. Modify
SUITE_hardlink_PROBE() to use a cross-directory hardlink to correctly
detect this case.

Co-authored-by: Alexander Lanin <alex@lanin.de>
Co-authored-by: Joel Rosdahl <joel@rosdahl.net>
test/suites/hardlink.bash

index a003faf1b32d9475a9a49a916ca0a84ee5834a06..e78871e2ccfa952688511b19870fcf5aed30b585 100644 (file)
@@ -1,6 +1,8 @@
 SUITE_hardlink_PROBE() {
-    touch file1
-    if ! ln file1 file2 >/dev/null 2>&1; then
+    # Probe hard link across directories since AFS doesn't support those.
+    mkdir dir
+    touch dir/file1
+    if ! ln dir/file1 file2 >/dev/null 2>&1; then
         echo "file system doesn't support hardlinks"
     fi
 }