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

Generate mac dsyms #29

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Generate mac dsyms #29

wants to merge 15 commits into from

Conversation

mike-malburg
Copy link
Collaborator

@mike-malburg mike-malburg commented May 8, 2024

Description

Generate debug symbols (.dSYM folders) for dynamic Mac builds.

It appears that for Mac, the Build module is not loaded when the post-build step is called, but for Windows, it is loaded.  This causes it to succeed on Windows but fail on Mac: https://dev.azure.com/techsmith/ThirdParty-Packages-vcpkg/_build/results?buildId=321654&view=logs&j=429c24e7-d235-5344-0c1a-e6a4447c49a2&t=836129e9-d587-586f-4c79-2b8fd9e8d140

Windows output:
--------------------------------------------------------------------------------
- Post-build step
--------------------------------------------------------------------------------
Setting version info for: D:\a\1\s\PreStage\bin\whisper.dll

Mac output:
--------------------------------------------------------------------------------
- Post-build step
--------------------------------------------------------------------------------
Get-IsOnMacOS: /Users/runner/work/1/s/custom-steps/whispercpp/post-build.ps1:8
Line |
   8 |  if ((Get-IsOnMacOS)) {
     |       ~~~~~~~~~~~~~
     | The term 'Get-IsOnMacOS' is not recognized as a name of a cmdlet,
     | function, script file, or executable program. Check the spelling of the
     | name, or if a path was included, verify that the path is correct and try
     | again.

Updated all post-build steps with this fix.
Shortening the names of these.
This should have been removed, here: 6c49109
There is typically a chain of symlinks to the actual file when dealing with these mac builds (ex. foo.dylib ==> foo-1.dylib ==> foo-1.2.dylib ==> foo-1.2.3.dylib).  The physical file is foo-1.2.3.dylib, but we want to just have the physical file be called foo.dylib and get rid of the symlinks (existing functionality in these scripts).  To get the right name for the file, we find all the physical files and then walk the symlink chain backwards until we get to the top.

There was a bug where if no symlinks are found from the Mac build, however, it was causing an infinite loop looking for them.  I changed this so that we will not try to walk the symlink chain to find the top-level symlink for each physical file, and just return the same name for the physical file and the top of chain file.
whispercpp 1.5.5 now has dylib symlinks.  We will remove those so that we just end up with libwhisper.dylib in our package.
These need to be in the same dir as libwhisper.dylib, or it may cause issues on Mac.  Mac dynamically looks for ggml-metal.metal at runtime.
@mike-malburg mike-malburg force-pushed the feature/generate-mac-dsym branch 4 times, most recently from 7df7f5e to 07018fc Compare May 13, 2024 23:37
This is a test C++ project that is built with meson instead of cmake.  Pango is also built with meson instead of cmake.
This is also just for testing.  It is another meson project.
The vcpkg_configure_cmake and vckpg_install_cmake functions were deprecated
We always do this, so lets simplify some post-build scripts (and get rid of some) by adding this to the Create-FinalizedMacArtifacts step.
We will just run this for all Mac builds, so we always try to generate these debug symbols.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant