Repository navigation
Commit ef68371
authored
Build without -Wconversion on GCC 9 (#1760)
<!-- Thank you for your contribution! -->
## What do these changes do?
The re-tagged `v7.1.0` run got past the cp310 and cp311 armv7l wheels
after #1759, then failed on cp312: GCC 9, which the
`manylinux_2_31_armv7l` image ships, flags `_PyLong_CompactValue()` in
CPython's own `cpython/longintrepr.h` under `-Wsign-conversion`, and
`-Werror` makes that fatal. It is not specific to 32-bit or ARM: GCC 9
on x86_64 fails the same way for every CPython from 3.12 on, so building
the sdist with Ubuntu 20.04's default compiler would break too. GCC 10,
11 and 12 are clean.
`setup.py` now asks the configured compiler for its predefined macros
and drops `-Wconversion` when it is GCC older than 10. Clang, MSVC and a
compiler that cannot be probed keep the flags unchanged, so CI still
builds with `-Wconversion` everywhere it did.
The changelog entry goes into the unpublished 7.1.0 section next to the
#1759 one, since the tag gets moved to this merge commit.
## Are there changes in behavior for the user?
No; the C extension builds again with GCC 9.
## Is it a substantial burden for the maintainers to support this?
No; the check can go once GCC 9 stops mattering.
## Related issue number
Follow-up to #1759. Failed run:
https://github.com/aio-libs/multidict/actions/runs/37833640970
## Checklist
- [x] I think the code is well written
- [ ] Unit tests for the changes exist N/A, build fix; verified with GCC
9 builds as described below
- [x] Documentation reflects the changes
- [ ] If you provide code modification, please add yourself to
`CONTRIBUTORS.txt` N/A
- [ ] Add a new news fragment into the `CHANGES/` folder N/A, the entry
is added to the unreleased 7.1.0 section of `CHANGES.rst` directly
- [x] `make doc-spelling` passes and any new technical words are added
to `docs/spelling_wordlist.txt`
Drafted with Claude Code (Claude Opus 5.5); reviewed by @asvetlov.
<details>
<summary>Agent run details (optional, for reviewers)</summary>
GCC 9.4 (Ubuntu 20.04 container), `-fsyntax-only` with the release flags
against the CPython headers copied from `manylinux_2_31_armv7l`, `-m32
-funsigned-char`: 3.12 to 3.15t fail on `longintrepr.h` on master; the
same on x86_64 against 3.12.7 to 3.15.0rc2 headers. GCC 10, 11 and 12
compile cleanly.
`pip wheel` of master in the GCC 9 container with CPython 3.12.12 fails;
with this `setup.py` it builds the wheel. With the host's GCC 15 both
extensions still compile with `-Wconversion`, and the suite passes.
Local cibuildwheel 4.2.1 under QEMU from this branch's sdist is still
running: manylinux armv7l with tests, the other odd arches (aarch64,
ppc64le, s390x, riscv64 for manylinux and musllinux, musllinux armv7l)
build-only. Results will be added here.
</details>1 parent e812c4f commit ef68371
2 files changed
Lines changed: 42 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | | - | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
| |||
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
70 | 106 | | |
71 | 107 | | |
72 | 108 | | |
| |||
96 | 132 | | |
97 | 133 | | |
98 | 134 | | |
99 | | - | |
| 135 | + | |
100 | 136 | | |
101 | 137 | | |
102 | 138 | | |
| |||
0 commit comments