Conan package builds
You have to build in manylinux. Manylinux requires only small subset of system libraries and an old GLIBC. The manylinux image uses RHEL's developer kit to provide a newer version of GCC that only links with the older GLIBC. The manylinux docker image is at
quay.io/pypa/manylinux2014_x86_64:latest. manylinux2014 is GLIBC 2.17 based, which is much older than ubuntu 18.04 (2.27). If you used manylinux_2_28 (which is GLIBC 2.28) in cibuildwheel, then your 18.04 one might work. But don't do that, just build everything inside manylinux.
Originally posted by @henryiii in https://github.com/pypa/cibuildwheel/issues/1556#issuecomment-1644353549
Is it really required to build in manylinux or will it also work to build in the underlying docker container? E.g. manylinux_2_28 is based on almalinux 8 (see https://github.com/pypa/manylinux?tab=readme-ov-file#manylinux_2_28-almalinux-8-based), so would the almalinux 8 image be sufficient?
cibuildwheel is pretty tightly coupled to manylinux. Manylinux comes with preinstalled Pythons at specific paths, and tools like auditwheel that cibuildwheel uses. That said, there's nothing stopping you from making your own image and specifying it in the options. Though you might be better off starting from an existing manylinux image, otherwise you'll spend a lot of time recreating what manylinux has already done.
Sorry, I have to be more precise in my question. I am building python wheels using a C++ extension and for sure I want to build those inside manylinux. But my question was about building the conan dependencies. Is it sufficient to build those in e.g. the almalinux image and then consume them in the manylinux container during cibuildwheel?
I believe so, as long as it passes auditwheel. It should be fine if it's built with an equal or previous version of the GLIBC kernel. The only issue that can come up is if you link to something in the base distro that is not on "many" linux distros, but I think auditwheel will detect that. You can read more about manylinux in PEP 599 and PEP 600.