From a0e2979d91d50b175b08b3f35cda7f75fc10bbac Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 15 Aug 2019 15:21:03 +0200 Subject: Fix bug in mkanylink() usage --- libbuild2/install/rule.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libbuild2') diff --git a/libbuild2/install/rule.cxx b/libbuild2/install/rule.cxx index 90ee7cb..fdbbffa 100644 --- a/libbuild2/install/rule.cxx +++ b/libbuild2/install/rule.cxx @@ -873,7 +873,15 @@ namespace build2 if (file_exists (target, false /* follow_symlinks */)) try_rmfile (target); - mkanylink (target, rell, true /* copy */); + // We have to go the roundabout way by adding directory to the + // target and then asking for a relative symlink because it may be a + // hardlink in which case the target path will be interpreted from + // CWD. + // + mkanylink (rell.directory () / target, + rell, + true /* copy */, + true /* relative */); } catch (system_error& e) { -- cgit v1.1