Skip to content

Commit

Permalink
fix relpath computation in external_project prefix
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
na-trium-144 committed Dec 16, 2024
1 parent a491923 commit 1f89511
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 @@ -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))
Expand Down

0 comments on commit 1f89511

Please sign in to comment.