From 0fb6fa0a902177d0af81d0306664084c061d76e1 Mon Sep 17 00:00:00 2001 From: MihailJP Date: Sat, 9 Nov 2024 22:12:38 +0900 Subject: [PATCH] external_project: workaround for MinGW On Python 3.12, self.prefix.relative_to(self.prefix.drive) no longer works and raises error like: ValueError: 'C:/msys64/mingw64' is not in the subpath of 'C:' --- 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 9e283e026b36..96237370aca3 100644 --- a/mesonbuild/modules/external_project.py +++ b/mesonbuild/modules/external_project.py @@ -93,7 +93,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 = self.prefix.relative_to(self.prefix.drive) + self.prefix = Path('/' + str(self.prefix.relative_to(self.prefix.drive + "/"))) # self.prefix is an absolute path, so we cannot append it to another path. self.rel_prefix = self.prefix.relative_to(self.prefix.root)