Skip to content

trying to fix cygwin CI, cf #216 - #218

Draft
dimpase wants to merge 6 commits into
sagemath:mainfrom
dimpase:216
Draft

trying to fix cygwin CI, cf #216#218
dimpase wants to merge 6 commits into
sagemath:mainfrom
dimpase:216

Conversation

@dimpase

@dimpase dimpase commented Jan 14, 2025

Copy link
Copy Markdown
Member

trying to fix cygwin CI, cf #216

tornaria and others added 4 commits January 13, 2025 20:37
This test triggers the following bug on cysignals 1.12.0 - 1.12.2:

```
Python 3.13.1 (main, Dec 14 2024, 12:44:03) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cypari2
>>> from cysignals.alarm import alarm
>>> try:
...     alarm(0.5)
...     while True: pass
... except:
...     pass
...
>>> cypari2.Pari()
Traceback (most recent call last):
  File "<python-input-3>", line 1, in <module>
    cypari2.Pari()
    ~~~~~~~~~~~~^^
  File "cypari2/pari_instance.pyx", line 471, in cypari2.pari_instance.Pari.__cinit__
  File "cypari2/closure.pyx", line 138, in cypari2.closure._pari_init_closure
cysignals.signals.AlarmInterrupt
```
There was a typo in sagemath#181: when the pari sigint handling was converted
to a general mechanism, the line

```
    PARI_SIGINT_pending = 0;
```

got translated into

```
    custom_signal_unblock();
```
instead of the correct
```
    custom_set_pending_signal(0);
```

This error didn't take effect until sagemath#166 removed the pari sigint
handling.

This causes some doctest failures in sagemath:
```
src/sage/coding/linear_code.py
src/sage/geometry/integral_points.pxi
src/sage/rings/integer.pyx
src/sage/rings/polynomial/polynomial_element.pyx
```
related to mishandling of AlarmInterrupt.

See: https://github.com/sagemath/cysignals/pull/181/files#r1904885037
@dimpase

dimpase commented Jan 14, 2025

Copy link
Copy Markdown
Member Author

Cygwin build still fails - it now can find mesonpy, but still fails pretty fast, and the log shows that meson mixes toolsets quite badly.

@dimpase
dimpase marked this pull request as draft January 14, 2025 18:12
@dimpase

dimpase commented Jan 15, 2025

Copy link
Copy Markdown
Member Author

ninja (invoked from meson?) picks up wrong Python headers - instead of Cygwin's Python, it takes native ones, oops:

Found ninja.EXE-1.12.0 at C:\tools\cygwin\bin\ninja.EXE
  + meson compile
  [1/3] Compiling Cython source 'D:/a/cysignals/cysignals/src/cysignals/signals.pyx'
  [2/3] Compiling C object src/cysignals/signals.cp39-win_amd64.pyd.p/meson-generated_src_cysignals_signals.pyx.c.obj
  FAILED: src/cysignals/signals.cp39-win_amd64.pyd.p/meson-generated_src_cysignals_signals.pyx.c.obj
  "gcc" "-Isrc\cysignals\signals.cp39-win_amd64.pyd.p" "-Isrc\cysignals" "-I..\src\cysignals" "-Isrc" "-I..\src" "-IC:\hostedtoolcache\windows\Python\3.9.13\x64\Include" "-fvisibility=hidden" "-fdiagnostics-color=always" "-DNDEBUG" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-Wextra" "-Wpedantic" "-O3" "-DCYTHON_CLINE_IN_TRACEBACK=0" "-U_FORTIFY_SOURCE" "-DMS_WIN64=" -MD -MQ src/cysignals/signals.cp39-win_amd64.pyd.p/meson-generated_src_cysignals_signals.pyx.c.obj -MF "src\cysignals\signals.cp39-win_amd64.pyd.p\meson-generated_src_cysignals_signals.pyx.c.obj.d" -o src/cysignals/signals.cp39-win_amd64.pyd.p/meson-generated_src_cysignals_signals.pyx.c.obj "-c" src/cysignals/signals.cp39-win_amd64.pyd.p/src/cysignals/signals.pyx.c
  In file included from C:\hostedtoolcache\windows\Python\3.9.13\x64\Include/Python.h:50,
                   from src/cysignals/signals.cp39-win_amd64.pyd.p/src/cysignals/signals.pyx.c:16:
  C:\hostedtoolcache\windows\Python\3.9.13\x64\Include/pyport.h:741:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
...

@tobiasdiez

Copy link
Copy Markdown
Contributor

I've no idea why this is failing now - there were no changes to this workflow and also no updates to the cygwin action...very strange.

@dimpase

dimpase commented Jan 15, 2025

Copy link
Copy Markdown
Member Author

maybe a change to the host environment?

@dimpase

dimpase commented Jan 15, 2025

Copy link
Copy Markdown
Member Author

there is also an error related to chocolatey shown in the log, some kind of version mismatch.

@dimpase

dimpase commented Jan 15, 2025

Copy link
Copy Markdown
Member Author

I've opened egor-tensin/setup-cygwin#14

@dimpase

dimpase commented Jan 15, 2025

Copy link
Copy Markdown
Member Author

I eliminated the chocolatey warning in the action update, but it hasn't changed anything. I'm giving up. Let's disable the cygwin CI, maybe?

@tornaria

Copy link
Copy Markdown
Member

I eliminated the chocolatey warning in the action update, but it hasn't changed anything. I'm giving up. Let's disable the cygwin CI, maybe?

It's running python 3.9 which we shouldn't waste time supporting anyway.

In fact, I am needing some python 3.11 and maybe 3.12 to fix the sig_occurred() mishap (https://docs.python.org/3/c-api/exceptions.html#c.PyErr_GetHandledException and https://docs.python.org/3/c-api/exceptions.html#c.PyErr_GetRaisedException), but I'll try to workaround it for earlier python. For PyErr_GetRaisedException() one can use PyErr_Fetch(), but I'm not sure there's an alternative to PyErr_GetHandlerException() before python 3.11.

I assume dropping python 3.9 is ok, but I'm not sure about python 3.10.

@tornaria

Copy link
Copy Markdown
Member

I assume dropping python 3.9 is ok, but I'm not sure about python 3.10.

https://scientific-python.org/specs/spec-0000/#2024---quarter-4 seems to suggest it might be ok to drop python 3.10 if necessary.

@dimpase

dimpase commented Jan 16, 2025

Copy link
Copy Markdown
Member Author

I assume dropping python 3.9 is ok, but I'm not sure about python 3.10.

cygwin is stuck on 3.9, so this seems like dead wood.

tornaria added a commit to tornaria/cysignals that referenced this pull request Jan 21, 2025
tornaria added a commit to tornaria/cysignals that referenced this pull request Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants