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

Properly fix build error on old macOS / Xcode with clockid_t #12074

Closed
wants to merge 1 commit into from

Conversation

ychin
Copy link
Contributor

@ychin ychin commented Feb 26, 2023

PR #10549 attempted to fix a build break on older Xcode versions (Xcode 8 / macOS 10.11 SDK), but it did it in a way that's not very reliable. In particular, it did it just by checking whether
MAC_OS_X_VERSION_10_12 exists, but that macro is just the version number for 10.12 SDK. In MacVim, we manually define it to allow us to do version checks. As a result, MacVim builds would fail on macOS 10.11 SDKs (or below).

Instead, the proper fix is to check MAC_OS_X_VERSION_MAX_ALLOWED against MAC_OS_X_VERSION_10_12. The "max allowed" value is the version of the SDK we are building with and it will be properly defined. The previous bug that the PR was trying to fix was that it was using MAC_OS_X_VERSION_MIN_REQUIRED instead, which is the "deployment target" of the build and wasn't the right value to use.

See macvim-dev/macvim#1372

PR vim#10549 attempted to fix a build break on older Xcode versions (Xcode
8 / macOS 10.11 SDK), but it did it in a way that's not very reliable.
In particular, it did it just by checking whether
`MAC_OS_X_VERSION_10_12` exists, but that macro is just the version
number for 10.12 SDK. In MacVim, we manually define it to allow us to do
version checks. As a result, MacVim builds would fail on macOS 10.11
SDKs (or below).

Instead, the proper fix is to check `MAC_OS_X_VERSION_MAX_ALLOWED`
against `MAC_OS_X_VERSION_10_12`. The "max allowed" value is the version
of the SDK we are building with and it will be properly defined. The
previous bug that the PR was trying to fix was that it was using
`MAC_OS_X_VERSION_MIN_REQUIRED` instead, which is the "deployment
target" of the build and wasn't the right value to use.

See macvim-dev/macvim#1372
@codecov
Copy link

codecov bot commented Feb 26, 2023

Codecov Report

Merging #12074 (96f209d) into master (938ae28) will increase coverage by 0.57%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #12074      +/-   ##
==========================================
+ Coverage   81.31%   81.88%   +0.57%     
==========================================
  Files         164      164              
  Lines      193906   194031     +125     
  Branches    43822    43851      +29     
==========================================
+ Hits       157665   158879    +1214     
+ Misses      23510    22296    -1214     
- Partials    12731    12856     +125     
Flag Coverage Δ
huge-clang-none 82.62% <ø> (-0.01%) ⬇️
huge-gcc-none ?
huge-gcc-testgui 51.36% <ø> (-0.14%) ⬇️
huge-gcc-unittests 0.29% <ø> (-0.01%) ⬇️
linux 82.27% <ø> (-0.07%) ⬇️
mingw-x64-HUGE 76.50% <ø> (-0.01%) ⬇️
mingw-x86-HUGE 76.96% <ø> (?)
windows 78.09% <ø> (+1.59%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/vim9instr.c 80.51% <0.00%> (-1.49%) ⬇️
src/message.c 78.71% <0.00%> (-1.00%) ⬇️
src/clipboard.c 73.54% <0.00%> (-0.73%) ⬇️
src/ex_cmds2.c 80.67% <0.00%> (-0.49%) ⬇️
src/popupmenu.c 79.33% <0.00%> (-0.40%) ⬇️
src/if_xcmdsrv.c 77.29% <0.00%> (-0.35%) ⬇️
src/main.c 83.72% <0.00%> (-0.29%) ⬇️
src/vim9execute.c 88.68% <0.00%> (-0.25%) ⬇️
src/mouse.c 80.07% <0.00%> (-0.24%) ⬇️
src/getchar.c 85.66% <0.00%> (-0.19%) ⬇️
... and 44 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@brammool brammool closed this in da77693 Feb 28, 2023
@ychin ychin deleted the proper-fix-macos-10.11-build-issues branch February 28, 2023 20:26
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.

1 participant