-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Extend guard for sound support on OS X #13115
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
Conversation
Fixes build on legacy versions where required coreaudio functionality may not be available. NSSoundDelegate apparently was introduced in Snow Leopard yet the build breaks on it. Guarding off enabling sound support to El Capitan as that's the next version I had access to for testing (it may work on earlier versions) https://developer.apple.com/documentation/appkit/nssounddelegate Vim builds on OS X Tiger 10.4 and newer with this change.
Thanks. I was slightly worried from the diff that this have some unexpected results on non Mac OS systems, but since the whole block is guarded by |
@sevan How was build breaking for Snow Leopard? Do you have the actual build logs? Feels like we should at least have a cursory look of what's breaking to see what caused build to break. The Apple documentation is pretty accurate about what version supports what so it's usually possible to find from the docs the minimum version we need to support, rather than whatever we have on hand to test. Also, I have seen this in other macOS-related PRs here before, but I don't think I'm mentioning this because MacVim currently supports 10.9, so this change could break sound support for our "legacy" build (which supports 10.9 - 10.12). Since I maintain MacVim, is it possible for me to be pinged (if possible) on macOS compatibility issues? Thanks. I think proper macOS version compatibility can sometimes be tricky (a combination of |
@ychin it failed on compiling os_macosx.m, I was doing native builds per OS/arch, rather that using the SDKs to target different OS releases using a newer OS/toolchain. It's fairly easy to reproduce, undo the change proposed here and ./configure && make on 10.6 (since that's when NSSoundDelegate was added, and just not available on older releases). |
From the ticket, it looks like it's an issue with compiler / toolchain not understanding the newer syntax for generic, rather than SDK support for the sound delegate. How exactly are you building on these older platforms? Are you building on physical hardware or VMs (and what kind of compilation steps/flags are you using)? Is MacPorts also building on VMs? I can look into fixing this more properly. I do appreciate if in future macOS compatibility issues I can be pinged on this. While it's easy to fix the issue for your specific problem, changes like this can affect other builds of Vim on macOS as well (e.g. MacVim). |
I'm building it on physical hardware.
Not using any additional flags, or external components, just what's provided with OS X & XCode. The snippet above was taken from attempting vim-9.0.1907 just now. |
Oh, that is old. GCC 4.2.1 is from 2007, can you upgrade your compiler? |
Seems heavy handed when the huge feature set builds fine without sound using that compiler (sound support should be optional if you want to go down that route). |
I see then. I leave it to @ychin to decide if there is something more actionable here for us :) |
Using newer/older toolchains / compilers on older macOS is quite annoying to do, as Apple likes to tie Xcode distribution with macOS releases. E.g. I was trying to grab clang-17 on the Mac for testing the undefined behaviors that I fixed recently and gave up and just used a Linux VM instead… I was thinking of just changing the check to defined(__clang_major__) && __clang_major__ >= 7 && \
defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 The new syntax for supporting types in generics a.k.a We could refactor the code to not use the new syntax (or use ifdef to write a different versions) by just declaring untyped dictionaries, but this seems old enough that I think it's fine to just turn off the feature for older platforms. On the MacVim front, we mostly only support 10.9 - 10.10 currently by building binaries on newer macOS / toolchain versions and setting deployment target to 10.9, so it would still work. I was also contemplating just turning it into a configure flag like the other platforms but it seemed unnecessary if we just fix the ifdef conditions to be more accurate. I haven't submitted a PR yet because I wanted to test it on my VMs first. |
The ifdef check used in upstream Vim is too tight. Disable it for now. See vim/vim#13115
Ok, I just filed #13251 to fix this. |
Worked fine on older versions. Thanks :) |
Fixes build on legacy versions where required coreaudio functionality may not be available.
NSSoundDelegate apparently was introduced in Snow Leopard yet the build breaks on it. Guarding off enabling sound support to El Capitan as that's the next version I had access to for testing (it may work on earlier versions, between 10.6 & 10.11).
Vim builds on OS X Tiger 10.4 and newer with this change.