-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
tests: add a test case for the MACOSX_DEPLOYMENT_TARGET
env
#11011
tests: add a test case for the MACOSX_DEPLOYMENT_TARGET
env
#11011
Conversation
Commit f96948e didn't work, as expected.
Let's see if commit d07a712 fixes this. |
I think the test case could be directly included in |
Ah, looking at commit ac58c13 and issue #3482, I think this bug only occurs when the meson/mesonbuild/compilers/mixins/clike.py Lines 813 to 824 in e68fcac
Commit 0230490 adds these accordingly, let's see if the CI passes now. |
mesonbuild/compilers/mixins/clang.py
Outdated
# Since macOS 10.13 was EOLed on 1 Dec 2020, there's no need to | ||
# increase the severity level of the former warning. | ||
# https://github.com/lovell/sharp/issues/3438 | ||
if mesonlib.version_compare(self.version, '>=9.0'): | ||
extra_args.append('-Werror=unguarded-availability-new') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think while we're here it cannot hurt to increase the severity level of checks for people trying to build code to deploy on a relatively recent OS.
I mean, if we were going to drop support for old OSes we'd presumably drop -Wl,-no_weak_imports
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, but -Wunguarded-availability-new
would probably also warn about using APIs introduced in macOS 12, if you compile with the MACOSX_DEPLOYMENT_TARGET="11.0"
env set, for example.
Anyways, I think this commit can be reverted, it looks like -Wl,-no_weak_imports
would already catch this (if you use this in combination with prefix: '#include <...>'
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so this is basically just several different flags that all kind of do the same thing?
...
If there's some flag that helps out such that even function tests that forgot to add a prefixed #include
are correctly detected, that would be quite cool. Do the new flags do that, at least?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so this is basically just several different flags that all kind of do the same thing?
I think so, which is somewhat confusing, but I'm not a macOS expert. 😅
If there's some flag that helps out such that even function tests that forgot to add a prefixed
#include
are correctly detected, that would be quite cool. Do the new flags do that, at least?
Indeed, that would fix this. But unfortunately, I don't know of any compile/link flags that can do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's some flag that helps out such that even function tests that forgot to add a prefixed #include are correctly detected, that would be quite cool. Do the new flags do that, at least?
There is no way to do this. That's why I added the note in the docs to discourage using the check without the right #include
in the prefix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no way to do this. That's why I added the note in the docs to discourage using the check without the right
#include
in the prefix.
Thanks for confirming and mentioning this in the docs!
So, to summarize:
- Meson cannot do anything about this in terms of implementation.
- Meson already recommends using the
prefix: '#include <...>'
argument in the docs, which would fix such issues. - Meson could issue a warning if that argument is not used (tracked in issue cc.has_function() should warn when the
prefix:
does not #include a header #3482). - For macOS, Meson could recommend the
-Werror=unguarded-availability-new
compilation flag in the docs to detect such issues at a later stage. - This PR is only useful as a regression test to check if the
MACOSX_DEPLOYMENT_TARGET
env is honored.
Since (5) is actually something that should be handled by the compilers (and not the build system), my feeling is that I should abandon this PR. Am I right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I feel like this is not worth a test as the compiler handles it, it would be useful if we in the future add a meson option for the iOS macOS, tvOS, watchOS… target, where we would need to make sure that it properly overrides a possible MACOSX_DEPLOYMENT_TARGET
set in the env, and does not override when the meson option is not set, so maybe we can resurrect this PR for that then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, abandoning this PR. Thanks for allowing me to test this on CI. 👍
Codecov Report
@@ Coverage Diff @@
## master #11011 +/- ##
==========================================
- Coverage 68.83% 66.20% -2.63%
==========================================
Files 414 207 -207
Lines 90016 44929 -45087
Branches 21278 9927 -11351
==========================================
- Hits 61960 29744 -32216
+ Misses 23402 12852 -10550
+ Partials 4654 2333 -2321
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
... that seems to pass CI as well. I'm not sure if Meson can do anything about this, other than what is described in #3482. I reported these two upstream issues at: Let me know if this PR is still appropriate, it could be useful as a regression test. |
6b7cf34
to
6acaf4e
Compare
MACOSX_DEPLOYMENT_TARGET
envMACOSX_DEPLOYMENT_TARGET
env
It could cause functions to be incorrectly detected as found when the `prefix: '#include <...>'` argument is omitted. This only happens when compiling with a new XCode toolchain while targeting an older macOS version. See: mesonbuild#3482.
6acaf4e
to
7efd86a
Compare
Rebased on top of the |
I'll abandon this PR, the meson/mesonbuild/compilers/mixins/clang.py Lines 104 to 110 in 100456d
See also the summary at #11011 (comment) for why this cannot be resolved in Meson itself when the
FWIW, macOS 10.13 was EOL'ed 2 years ago, so it's probably not worth fixing that in GLib.
This is now being tracked in issue https://gitlab.freedesktop.org/gstreamer/orc/-/issues/44. I deliberately didn't open a PR there because I don't have access to iOS devices. |
It could cause functions to be incorrectly detected as found when
the
prefix: '#include <...>'
argument is omitted. This onlyhappens when compiling with a new XCode toolchain while targeting
an older macOS version.
See: #3482.
Context:
lovell/sharp#3438
lovell/sharp-libvips#164