Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ninja cannot find the library when libraries contain symlinks. #12808

Merged
merged 2 commits into from
Apr 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions mesonbuild/compilers/mixins/gnu.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,16 +469,16 @@ def _split_fetch_real_dirs(self, pathstr: str) -> T.List[str]:
# paths under /lib would be considered not a "system path",
# which is wrong and breaks things. Store everything, just to be sure.
pobj = pathlib.Path(p)
unresolved = pobj.as_posix()
if pobj.exists():
if unresolved not in result:
result.append(unresolved)
try:
resolved = pathlib.Path(p).resolve().as_posix()
resolved = pobj.resolve(True).as_posix()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this won't work on Python 3.5 as it won't be expecting the strict argument to be present at all. Not sure how to solve that except by bumping the minimum version or introspecting somehow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this won't work on Python 3.5 as it won't be expecting the strict argument to be present at all. Not sure how to solve that except by bumping the minimum version or introspecting somehow.

meson now requires Python 3.7 minimum version

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed you are right - I still had an old branch checked out while I was looking for the commit above. So yes, this should be fine.

if resolved not in result:
result.append(resolved)
except FileNotFoundError:
pass
unresolved = pobj.as_posix()
if unresolved not in result:
result.append(unresolved)
return result

def get_compiler_dirs(self, env: 'Environment', name: str) -> T.List[str]:
Expand Down
Loading