Title: [Bug]: Cygwin build fails due to use of Windows-only functions in _tkagg.cpp · Issue #22997 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Cygwin build fails due to use of Windows-only functions in _tkagg.cpp · Issue #22997 · matplotlib/matplotlib
X Title: [Bug]: Cygwin build fails due to use of Windows-only functions in _tkagg.cpp · Issue #22997 · matplotlib/matplotlib
Description: Bug summary When the build gets to https://github.com/matplotlib/matplotlib/blob/main/src/_tkagg.cpp#L262-L273 on Cygwin, the build fails with a few goto crosses initialization warnings, which are easy to fix (closed by #23051), and two ...
Open Graph Description: Bug summary When the build gets to https://github.com/matplotlib/matplotlib/blob/main/src/_tkagg.cpp#L262-L273 on Cygwin, the build fails with a few goto crosses initialization warnings, which are ...
X Description: Bug summary When the build gets to https://github.com/matplotlib/matplotlib/blob/main/src/_tkagg.cpp#L262-L273 on Cygwin, the build fails with a few goto crosses initialization warnings, which are ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/22997
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Cygwin build fails due to use of Windows-only functions in _tkagg.cpp","articleBody":"### Bug summary\r\n\r\nWhen the build gets to https://github.com/matplotlib/matplotlib/blob/main/src/_tkagg.cpp#L262-L273 on Cygwin, the build fails with a few `goto crosses initialization` warnings, which are easy to fix (closed by #23051), and two `error: ‘PyErr_SetFromWindowsErr’ was not declared in this scope`, which are less easy to fix.\r\n\r\n### Code for reproduction\r\n\r\n```python\r\npip install matplotlib\r\n```\r\n\r\n\r\n### Actual outcome\r\n\r\n```con\r\n...\r\nlots of compiler command lines and some warnings (`array subscript has type 'char'`)\r\n...\r\n gcc ... -I/usr/include/python3.8 -c src/_tkagg.cpp -o build/temp.cygwin-3.3.4-x86_64-3.8/matplotlib.backends._tkagg/src/_tkagg.o -fvisibility=hidden -flto\r\n src/_tkagg.cpp: In function ‘void load_tkinter_funcs()’:\r\n src/_tkagg.cpp:263:9: error: ‘PyErr_SetFromWindowsErr’ was not declared in this scope\r\n 263 | PyErr_SetFromWindowsErr(0);\r\n | ^~~~~~~~~~~~~~~~~~~~~~~\r\n src/_tkagg.cpp:271:9: error: ‘PyErr_SetFromWindowsErr’ was not declared in this scope\r\n 271 | PyErr_SetFromWindowsErr(0);\r\n | ^~~~~~~~~~~~~~~~~~~~~~~\r\n src/_tkagg.cpp:283:1: error: jump to label ‘exit’\r\n 283 | exit:\r\n | ^~~~\r\n src/_tkagg.cpp:272:14: note: from here\r\n 272 | goto exit;\r\n | ^~~~\r\n src/_tkagg.cpp:274:26: note: crosses initialization of ‘bool tk_ok’\r\n 274 | bool tcl_ok = false, tk_ok = false;\r\n | ^~~~~\r\n src/_tkagg.cpp:274:10: note: crosses initialization of ‘bool tcl_ok’\r\n 274 | bool tcl_ok = false, tk_ok = false;\r\n | ^~~~~~\r\n src/_tkagg.cpp:283:1: error: jump to label ‘exit’\r\n 283 | exit:\r\n | ^~~~\r\n src/_tkagg.cpp:268:14: note: from here\r\n 268 | goto exit;\r\n | ^~~~\r\n src/_tkagg.cpp:274:26: note: crosses initialization of ‘bool tk_ok’\r\n 274 | bool tcl_ok = false, tk_ok = false;\r\n | ^~~~~\r\n src/_tkagg.cpp:274:10: note: crosses initialization of ‘bool tcl_ok’\r\n 274 | bool tcl_ok = false, tk_ok = false;\r\n | ^~~~~~\r\n src/_tkagg.cpp:283:1: error: jump to label ‘exit’\r\n 283 | exit:\r\n | ^~~~\r\n src/_tkagg.cpp:264:14: note: from here\r\n 264 | goto exit;\r\n | ^~~~\r\n src/_tkagg.cpp:274:26: note: crosses initialization of ‘bool tk_ok’\r\n 274 | bool tcl_ok = false, tk_ok = false;\r\n | ^~~~~\r\n src/_tkagg.cpp:274:10: note: crosses initialization of ‘bool tcl_ok’\r\n 274 | bool tcl_ok = false, tk_ok = false;\r\n | ^~~~~~\r\n error: command '/usr/bin/gcc' failed with exit code 1\r\n...\r\npip reminds me this is not pip's fault\r\n ```\r\n\r\n### Expected outcome\r\n\r\n```con\r\n...\r\nSuccessfully installed collected packages: matplotlib\r\n```\r\n\r\n### Additional information\r\n\r\nCygwin 3.3.4\r\nGCC 11.2.0\r\nPython 3.8.12\r\n\r\nI've installed matplotlib in earlier versions. #17415 rather suggests that Cygwin builds worked at that time, and probably made using the default backend somewhat easier. #22445 seems to be where the `PyErr_SetFromWindowsErr` calls came in.\r\n\r\nI've attempted to create a dummy `PyErr_SetFromWindowsErr` on Cygwin, but, given the number of failures in the test suite, I probably didn't do it right.\r\n\r\n### Operating system\r\n\r\nCygwin 3.3.4 on Windows 10\r\n\r\n### Matplotlib Version\r\n\r\n3.5.2\r\n\r\n### Matplotlib Backend\r\n\r\nTkAgg\r\n\r\n### Python version\r\n\r\n3.8.12\r\n\r\n### Jupyter version\r\n\r\nN/A\r\n\r\n### Installation\r\n\r\npip","author":{"url":"https://github.com/DWesl","@type":"Person","name":"DWesl"},"datePublished":"2022-05-06T22:08:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/22997/matplotlib/issues/22997"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f8c73f82-5276-25a7-5573-a759938a88be |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 94C4:23E45A:E3F9F8:12C9819:6A519A79 |
| html-safe-nonce | b494e0c0624bd2c7c98249c2acd02d67b1c1192706d9552598f402144dac288e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NEM0OjIzRTQ1QTpFM0Y5Rjg6MTJDOTgxOTo2QTUxOUE3OSIsInZpc2l0b3JfaWQiOiI3NjM1ODg5ODkxOTYwNzg5NjI1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | efc0fedc6f4ae49764685a888823fdbb75ae29807993f072a7c000afc46a4a89 |
| hovercard-subject-tag | issue:1228423124 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/22997/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7534883cbbcb101df0e1091909c5777e35ef6e9cc81509781ebde49e12fe1a9f/matplotlib/matplotlib/issues/22997 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7534883cbbcb101df0e1091909c5777e35ef6e9cc81509781ebde49e12fe1a9f/matplotlib/matplotlib/issues/22997 |
| og:image:alt | Bug summary When the build gets to https://github.com/matplotlib/matplotlib/blob/main/src/_tkagg.cpp#L262-L273 on Cygwin, the build fails with a few goto crosses initialization warnings, which are ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DWesl |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width