Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: Cygwin build fails due to use of Windows-only functions in _tkagg.cpp #22997

Closed
Labels
Good first issueOpen a pull request against these issues if there are no active ones!OS: Microsoft
Milestone
@DWesl

Description

@DWesl

Bug summary

When the build gets tohttps://github.com/matplotlib/matplotlib/blob/main/src/_tkagg.cpp#L262-L273 on Cygwin, the build fails with a fewgoto crosses initialization warnings, which are easy to fix (closed by#23051), and twoerror: ‘PyErr_SetFromWindowsErr’ was not declared in this scope, which are less easy to fix.

Code for reproduction

pipinstallmatplotlib

Actual outcome

...lots of compiler command lines and some warnings (`array subscript has type 'char'`)...          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          src/_tkagg.cpp: In function ‘void load_tkinter_funcs()’:          src/_tkagg.cpp:263:9: error: ‘PyErr_SetFromWindowsErr’ was not declared in this scope            263 |         PyErr_SetFromWindowsErr(0);                |         ^~~~~~~~~~~~~~~~~~~~~~~          src/_tkagg.cpp:271:9: error: ‘PyErr_SetFromWindowsErr’ was not declared in this scope            271 |         PyErr_SetFromWindowsErr(0);                |         ^~~~~~~~~~~~~~~~~~~~~~~          src/_tkagg.cpp:283:1: error: jump to label ‘exit’            283 | exit:                | ^~~~          src/_tkagg.cpp:272:14: note:   from here            272 |         goto exit;                |              ^~~~          src/_tkagg.cpp:274:26: note:   crosses initialization of ‘bool tk_ok’            274 |     bool tcl_ok = false, tk_ok = false;                |                          ^~~~~          src/_tkagg.cpp:274:10: note:   crosses initialization of ‘bool tcl_ok’            274 |     bool tcl_ok = false, tk_ok = false;                |          ^~~~~~          src/_tkagg.cpp:283:1: error: jump to label ‘exit’            283 | exit:                | ^~~~          src/_tkagg.cpp:268:14: note:   from here            268 |         goto exit;                |              ^~~~          src/_tkagg.cpp:274:26: note:   crosses initialization of ‘bool tk_ok’            274 |     bool tcl_ok = false, tk_ok = false;                |                          ^~~~~          src/_tkagg.cpp:274:10: note:   crosses initialization of ‘bool tcl_ok’            274 |     bool tcl_ok = false, tk_ok = false;                |          ^~~~~~          src/_tkagg.cpp:283:1: error: jump to label ‘exit’            283 | exit:                | ^~~~          src/_tkagg.cpp:264:14: note:   from here            264 |         goto exit;                |              ^~~~          src/_tkagg.cpp:274:26: note:   crosses initialization of ‘bool tk_ok’            274 |     bool tcl_ok = false, tk_ok = false;                |                          ^~~~~          src/_tkagg.cpp:274:10: note:   crosses initialization of ‘bool tcl_ok’            274 |     bool tcl_ok = false, tk_ok = false;                |          ^~~~~~          error: command '/usr/bin/gcc' failed with exit code 1...pip reminds me this is not pip's fault

Expected outcome

...Successfully installed collected packages: matplotlib

Additional information

Cygwin 3.3.4
GCC 11.2.0
Python 3.8.12

I'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 thePyErr_SetFromWindowsErr calls came in.

I've attempted to create a dummyPyErr_SetFromWindowsErr on Cygwin, but, given the number of failures in the test suite, I probably didn't do it right.

Operating system

Cygwin 3.3.4 on Windows 10

Matplotlib Version

3.5.2

Matplotlib Backend

TkAgg

Python version

3.8.12

Jupyter version

N/A

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good first issueOpen a pull request against these issues if there are no active ones!OS: Microsoft

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp