Opened 18 months ago

Last modified 18 months ago

#67491 new defect

py-matplotlib fails to build with gcc: cc1obj: error: '-Werror=unguarded-availability': no option '-Wunguarded-availability'

Reported by: barracuda156 Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc:
Port: py-matplotlib

Description

building 'matplotlib.backends._macosx' extension
creating build/temp.macosx-10.6-ppc-cpython-311/matplotlib.backends._macosx
creating build/temp.macosx-10.6-ppc-cpython-311/matplotlib.backends._macosx/src
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-matplotlib/py311-matplotlib/work/compwrap/cc/usr/bin/gcc-4.2 -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -pipe -Os -I/opt/local/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c src/_macosx.m -o build/temp.macosx-10.6-ppc-cpython-311/matplotlib.backends._macosx/src/_macosx.o -Werror=unguarded-availability -arch ppc -isysroot/ -fvisibility=hidden
cc1obj: error: -Werror=unguarded-availability: No option -Wunguarded-availability
error: command '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-matplotlib/py311-matplotlib/work/compwrap/cc/usr/bin/gcc-4.2' failed with exit code 1

Both gcc-4.2 and gcc12 fail likewise.

Change History (1)

comment:1 Changed 18 months ago by barracuda156

The code is hopelessly broken.

building 'matplotlib.backends._macosx' extension
creating build/temp.macosx-10.6-ppc-cpython-311/matplotlib.backends._macosx
creating build/temp.macosx-10.6-ppc-cpython-311/matplotlib.backends._macosx/src
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_python_py-matplotlib/py311-matplotlib/work/compwrap/cc/opt/local/bin/gcc-mp-12 -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -pipe -Os -I/opt/local/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c src/_macosx.m -o build/temp.macosx-10.6-ppc-cpython-311/matplotlib.backends._macosx/src/_macosx.o -arch ppc -isysroot/ -fvisibility=hidden
src/_macosx.m: In function 'FigureManager_init':
src/_macosx.m:703:5: warning: 'Window' may not respond to '-backingScaleFactor'
  703 |     [view updateDevicePixelRatio: [window backingScaleFactor]];
      |     ^
src/_macosx.m:703:5: warning: (messages without a matching method signature will be assumed to return 'id' and accept '...' as arguments)
src/_macosx.m:703:5: error: incompatible type for argument 1 of 'updateDevicePixelRatio:'
  703 |     [view updateDevicePixelRatio: [window backingScaleFactor]];
      |     ^
      |     |
      |     id
src/_macosx.m:703:5: note: expected 'double' but argument is of type 'id'
src/_macosx.m: In function 'FigureManager_resize':
src/_macosx.m:799:9: warning: 'Window' may not respond to '-backingScaleFactor'
  799 |         CGFloat device_pixel_ratio = [window backingScaleFactor];
      |         ^~~~~~~
src/_macosx.m:799:38: error: incompatible types when initializing type 'CGFloat' {aka 'float'} using type 'id'
  799 |         CGFloat device_pixel_ratio = [window backingScaleFactor];
      |                                      ^
src/_macosx.m: In function '-[View windowDidChangeBackingProperties:]':
src/_macosx.m:1614:5: warning: 'Window' may not respond to '-backingScaleFactor'
 1614 |     [self updateDevicePixelRatio: [window backingScaleFactor]];
      |     ^
src/_macosx.m:1614:5: error: incompatible type for argument 1 of 'updateDevicePixelRatio:'
 1614 |     [self updateDevicePixelRatio: [window backingScaleFactor]];
      |     ^
      |     |
      |     id
src/_macosx.m:1614:5: note: expected 'double' but argument is of type 'id'
error: command '/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_python_py-matplotlib/py311-matplotlib/work/compwrap/cc/opt/local/bin/gcc-mp-12' failed with exit code 1
Command failed:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_python_py-matplotlib/py311-matplotlib/work/matplotlib-3.5.3" && /opt/local/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11 setup.py --no-user-cfg build 
Exit code: 1

That macOS extension, FWIW, should be just disabled when built with GCC.

Note: See TracTickets for help on using tickets.