Closed
Description
Bug report
Bug summary
Both on my local system and in the CI wheel build upon merge, the macosx backend build fails because of a version mismatch.
Code for reproduction
CI failure after merge includes this:
building 'matplotlib.backends._macosx' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/_macosx.m -o build/temp.macosx-10.9-x86_64-3.7/src/_macosx.o -Werror=unguarded-availability -fvisibility=hidden -flto
src/_macosx.m:1661:59: error: 'CGContext' is only available on macOS 10.10 or newer [-Werror,-Wunguarded-availability]
CGContextRef cr = [[NSGraphicsContext currentContext] CGContext];
^~~~~~~~~~
/Applications/Xcode_11.7.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSGraphicsContext.h:81:35: note: 'CGContext' has been marked as being introduced in macOS 10.10 here, but the deployment target is macOS 10.9.0
@property (readonly) CGContextRef CGContext NS_RETURNS_INNER_POINTER API_AVAILABLE(macos(10.10));
^
src/_macosx.m:1661:59: note: enclose 'CGContext' in an @available check to silence this warning
CGContextRef cr = [[NSGraphicsContext currentContext] CGContext];
^~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
To fix my local build, I now have a line in my .bashrc:
export MACOSX_DEPLOYMENT_TARGET=10.15
Something to set the target, but probably with 10.10 instead of 10.15, seems to be needed in our build system. Or, make the "define" of CGContext
target version-dependent.