Skip to content

Commit

Permalink
external_project: workaround for MinGW
Browse files Browse the repository at this point in the history
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:'
  • Loading branch information
MihailJP authored Nov 9, 2024
1 parent f0851c9 commit 0fb6fa0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mesonbuild/modules/external_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0fb6fa0

Please sign in to comment.