From c5795665fff0c107c4fee0bbccf19e539cdaec58 Mon Sep 17 00:00:00 2001 From: na-trium-144 <100704180+na-trium-144@users.noreply.github.com> Date: Sat, 23 Nov 2024 22:59:53 +0900 Subject: [PATCH] fix relpath computation in external_project prefix This computation of prefix and rel_prefix was re-written in #13886 but it introduced another bug where the leading slash was missing. In addition drive root should have trailing slash, or it would use different path as base of relpath in some cases. --- mesonbuild/modules/external_project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/modules/external_project.py b/mesonbuild/modules/external_project.py index 4874f42aa6ee..6cc325b4f5c0 100644 --- a/mesonbuild/modules/external_project.py +++ b/mesonbuild/modules/external_project.py @@ -94,7 +94,7 @@ def __init__(self, # will install files into "c:/bar/c:/foo" which is an invalid path. # Work around that issue by removing the drive from prefix. if self.prefix.drive: - self.prefix = Path(relpath(self.prefix, self.prefix.drive)) + self.prefix = Path('/' + relpath(self.prefix, self.prefix.drive + '/')) # self.prefix is an absolute path, so we cannot append it to another path. self.rel_prefix = Path(relpath(self.prefix, self.prefix.root))