Boost logo

Boost-Build :

Subject: Re: [Boost-build] b2 headers thinks AFS filesystem supports arbitrary hardlinks
From: Vladimir Prus (ghost_at_[hidden])
Date: 2013-12-17 00:17:03


On 09.12.2013 19:55, Lars Viklund wrote:
> Hi,
>
> The AFS filesystem (as in OpenAFS) has some interesting quirks.
> Among those is that it only allows hardlinks inside the same directory.
>
> I suggest that the hardlink test should be augmented to test whether
> hardlinks between entries of different directories is supported.

The below patch appears to work; I'll push as soon as history/directory question
is settled.

- Volodya

commit 6a5a9b7c95cd63d97de598b537ad35121392d3b9
Author: Vladimir Prus <vladimir_at_[hidden]>
Date: Tue Dec 17 09:15:05 2013 +0400

     Check whether hard links between different directories work.

diff --git a/src/tools/link.jam b/src/tools/link.jam
index 8a1431b..dee6eea 100644
--- a/src/tools/link.jam
+++ b/src/tools/link.jam
@@ -69,8 +69,14 @@ rule can-hardlink ( project : ps )

          local source-target = [ new file-target test-hardlink-source : :
              $(project) : [ new action : link.touch ] ] ;
+ # Use <location-prefix> so that the destination link is created
+ # in a different directory. AFS refuses to make hard links
+ # between files in different directories, so we want to check
+ # it.
          local target = [ new file-target test-hardlink : :
- $(project) : [ new action $(source-target) : link.hardlink ] ] ;
+ $(project) : [ new action $(source-target) : link.hardlink
+ : [ new property-set <location-prefix>symlink ]
+ ] ] ;

          if [ configure.try-build $(target) : $(ps) : "hardlinks supported" ]
          {


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk