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

dependencies: find extraframeworks on case-sensitive filesystems #13038

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

reckenrode
Copy link
Contributor

This PR fixes a test failure on case-sensitive filesystems when a CMake dependency is turned into an Apple framework. I ran into this issue while working on the Darwin stdenv in nixpkgs after Meson was updated to 1.4.0 because my Nix store is installed on a case-sensitive APFS volume.

The extraframeworks search logic was already case insensitive. The fix was to use the match’s actual name instead of the one that was requested. I included a test, though the original test for #12181 also serves as a test for case-sensitive filesystems.

I found #12480 in the issue tracker, but the scope of fixing that seems like a much larger fix and wouldn’t address the issue I encountered building the Darwin stdenv in nixpkgs.

@reckenrode
Copy link
Contributor Author

I fixed the mypy lint failure.

p = Path(path)
lname = name.lower()
for d in p.glob('*.framework/'):
if lname == d.name.rsplit('.', 1)[0].lower():
return d
framework_name = d.name.rsplit('.', 1)[0]
Copy link
Member

Choose a reason for hiding this comment

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

wouldn't be better to use d.stem here ?

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 implemented your other suggestion, so this change could be dropped completely, but I converted it to stem in my update. Let me know if I should drop it to keep the size of the diff down.

@@ -70,12 +77,13 @@ def detect(self, name: str, paths: T.List[str]) -> None:
self.is_found = True
return

def _get_framework_path(self, path: str, name: str) -> T.Optional[Path]:
def _get_framework_path(self, path: str, name: str) -> T.Optional[tuple[Path, str]]:
Copy link
Member

Choose a reason for hiding this comment

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

You should use T.Tuple here, because of older versions of Python

@@ -70,12 +77,13 @@ def detect(self, name: str, paths: T.List[str]) -> None:
self.is_found = True
return

def _get_framework_path(self, path: str, name: str) -> T.Optional[Path]:
def _get_framework_path(self, path: str, name: str) -> T.Optional[tuple[Path, str]]:
Copy link
Member

Choose a reason for hiding this comment

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

I think you should either rename the function to _get_framework_path_and_name, or return a single path like d / framework_name and use path.name in the caller

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 ended up using path.stem on the returned path.

@bruchar1 bruchar1 added the OS:macos Issues specific to Apple Operating Systems like MacOS and iOS label Apr 4, 2024
Fixes a test failure on case-sensitive filesystems when a CMake
dependency is turned into an Apple framework.
@bruchar1
Copy link
Member

bruchar1 commented Apr 5, 2024

ci failures seem irrelevant

@reckenrode
Copy link
Contributor Author

Is there anything else needing to be done to move this forward after approval?

@abathur
Copy link

abathur commented Jun 30, 2024

@jpakkane If I'm following along correctly, it sounds like this would make changes such as #13349 unnecessary :)

@jpakkane
Copy link
Member

We are currently in RC freeze so only regression bugfixes are permitted.

@jpakkane jpakkane merged commit f01ae52 into mesonbuild:master Jul 10, 2024
33 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS:macos Issues specific to Apple Operating Systems like MacOS and iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants