Skip to content

Commit f79ca7e

Browse files
committed
gotcha 608, 609: cmake-from-source needs openssl-devel; Upstream-Status bracket must stay on one line
Found while triaging PR #2434 (executorch): cibuildwheel building cmake from source (no riscv64 wheel for the pinned version) fails configure with "Could not find OpenSSL" until openssl-devel is installed; and check_patch.py's Upstream-Status regex has no re.DOTALL, so a bracketed Inappropriate reason wrapped across multiple lines fails the format check even though it reads as correctly bracketed.
1 parent 16609d6 commit f79ca7e

3 files changed

Lines changed: 54 additions & 0 deletions

File tree

‎skills/python-project-porting/references/gotchas-index.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,11 @@ The porting gotchas (551 of them) live in [`references/gotchas/`](gotchas/), spl
968968
`setup.py` command can gate on the tool's mere presence in `PATH` even when it never calls
969969
it, so gotcha 100's `yum install -y protobuf-compiler` still has to go in
970970
`CIBW_BEFORE_ALL_LINUX` (the valkey-glide-sync case).
971+
- **608** — `cmake` built from source as a `pip`-installed build dependency (no riscv64 wheel
972+
published for the pinned version) needs `openssl-devel`: its own bootstrap's
973+
`Utilities/cmcurl/CMakeLists.txt` runs `find_package(OpenSSL)` and the image ships no dev
974+
headers by default — `CIBW_BEFORE_ALL_LINUX: dnf -y install openssl-devel` fixes it,
975+
independent of gotcha 207's unrelated CMake-policy-floor case (the executorch case).
971976

972977
### Native dependencies & linking — [`gotchas/native-deps-and-linking.md`](gotchas/native-deps-and-linking.md)
973978

@@ -1402,6 +1407,10 @@ The porting gotchas (551 of them) live in [`references/gotchas/`](gotchas/), spl
14021407
(`Both project.license-files and tool.scikit-build.wheel.license-files are set`) when the project
14031408
declares PEP 639 `project.license-files`; patch that list to a glob like `License*` that the sdist
14041409
alone still matches (the cantera case).
1410+
- **609** — `check_patch.py`'s `Upstream-Status: Inappropriate [...]` check has no `re.DOTALL`, so
1411+
it only reads the tag's first physical line; a bracketed reason wrapped across multiple
1412+
commit-message lines fails "Incorrect format" even though it looks correctly bracketed —
1413+
keep the whole `[reason]` on the tag's own line (the executorch case).
14051414

14061415
### Local validation & the aarch64/QEMU rehearsal — [`gotchas/local-validation-and-rehearsal.md`](gotchas/local-validation-and-rehearsal.md)
14071416

‎skills/python-project-porting/references/gotchas/licensing-and-gpl.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ To pull up one entry: `grep -n '^N\. ' references/gotchas/licensing-and-gpl.md`.
3939
`bdist_wheel` time, so a `setup.py` whose cmdclass `os.chdir()`s breaks a relative entry.
4040
- **590** — gotcha 538's `SKBUILD_WHEEL_LICENSE_FILES` override is refused when the project
4141
declares PEP 639 `project.license-files`; widen that list with a patch instead.
42+
- **609** — `check_patch.py`'s `Upstream-Status: Inappropriate [...]` regex only reads the
43+
first physical line of the tag, so a reason wrapped across multiple commit-message lines
44+
fails the check even though it looks bracketed.
4245

4346
---
4447

@@ -749,3 +752,20 @@ To pull up one entry: `grep -n '^N\. ' references/gotchas/licensing-and-gpl.md`.
749752
- **When `pyproject.toml` is generated** (cantera renders
750753
`interfaces/python_sdist/pyproject.toml.in` in `scons sdist`), patch the template in the
751754
upstream checkout before the sdist is built, not the extracted sdist.
755+
756+
609. **`check_patch.py`'s `Upstream-Status: Inappropriate [...]` regex only reads the first
757+
physical line of the tag, so a reason wrapped across multiple commit-message lines fails
758+
the check even though it looks bracketed on inspection (the executorch case).** The
759+
script matches the tag line with `re.MULTILINE` but no `re.DOTALL`, so `^Upstream-Status:
760+
*(.*)$` stops at the first `\n`; a value like `Inappropriate [only relevant to a
761+
distributor …` that closes its `]` two lines further down never reaches the
762+
`^\[.+\]$` check against the *whole* reason — only its first line is tested, which has
763+
no closing bracket at all, so it fails as "Incorrect format" even though every other
764+
detail (the type name, the brackets once joined) is correct.
765+
- **Keep the entire bracketed reason on the tag's own line.** Every other `Inappropriate`
766+
patch in this repo (`grep -rn 'Upstream-Status: Inappropriate' patches/`) does this;
767+
wrap the surrounding commit-message prose instead, and only fold the reason itself if
768+
it still fits `Upstream-Status: Inappropriate [...]` as one line.
769+
- **Reproduce locally before a CI cycle**: paste the patch's commit message through the
770+
same two `re.search` calls `check_upstream_status()` uses — a one-line repro is faster
771+
than waiting on `check_patches` to fail again.

‎skills/python-project-porting/references/gotchas/manylinux-image-and-toolchain.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ To pull up one entry: `grep -n '^N\. ' references/gotchas/manylinux-image-and-to
116116
- **599** — `PROTOC_INCLUDE` (gotcha 100) is not free: it replaces protoc's implicit `-I.`, so a
117117
`build.rs` that passes a bare `compile_protos("x.proto")` then fails "does not reside within any
118118
--proto_path"; CRB protoc finds `/usr/include` on its own, so leave it unset there.
119+
- **608** — `cmake` built from source as a build dependency (no riscv64 wheel yet for the
120+
required version) needs `openssl-devel` installed — its own CMake bootstrap looks for
121+
OpenSSL for `cmcurl` and the image ships no dev headers by default.
119122
---
120123

121124
26. **The riscv64 runners ship GCC 13; some packages need GCC 14 or later.** The compiler
@@ -1837,3 +1840,25 @@ To pull up one entry: `grep -n '^N\. ' references/gotchas/manylinux-image-and-to
18371840
gate all the way through before assuming a host-side pre-step satisfies it: a
18381841
presence check and an actual invocation impose different requirements on where the
18391842
tool has to live.
1843+
1844+
608. **`cmake` built from source as a `pip`-installed build dependency needs `openssl-devel`
1845+
installed in the container — its own bootstrap looks for OpenSSL for `Utilities/cmcurl`,
1846+
and the manylinux_riscv64 image ships no development headers by default (the executorch
1847+
case; see `build-executorch.yml`).** cibuildwheel resolves `cmake` (a declared
1848+
`build-system.requires`) from our registry first; when no riscv64 wheel is published for
1849+
the pinned version, pip falls back to building CMake's own sdist from source, and that
1850+
build runs CMake's bundled bootstrap CMakeLists, not the project's. That bootstrap's
1851+
`find_package(OpenSSL)` fails with `Could not find OpenSSL … (missing:
1852+
OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)` at `Utilities/cmcurl/CMakeLists.txt` — the
1853+
image carries `openssl-libs` (the runtime `.so`) but not the `-devel` headers/archive
1854+
`find_package` needs, the same shape as gotcha 46/51 for other host tooling gaps.
1855+
- **The fix is a one-line `CIBW_BEFORE_ALL_LINUX: dnf -y install openssl-devel`**,
1856+
independent of anything the *project's own* `pyproject.toml` sets for its own build —
1857+
this OpenSSL gap belongs to `cmake`'s bootstrap, not to executorch's extensions.
1858+
- **This is different from gotcha 207**: 207 is a CMake new enough to enforce a policy
1859+
floor a vendored dependency's `cmake_minimum_required` violates; this is CMake itself
1860+
having no riscv64 wheel to install and needing to compile, which pulls in its own
1861+
unrelated native dependency (OpenSSL) that the image doesn't have by default. Check
1862+
which failure you have from the CMake **configure** log path before reaching for either
1863+
fix: `Utilities/cmcurl/CMakeLists.txt` (this gotcha) vs a vendored third-party
1864+
`CMakeLists.txt` three levels down (207).

0 commit comments

Comments
 (0)