When compiling a CFFI module that compiles source code (these instructions), if that source code contains headers, and those headers are used in the C code, it fails with the default invocation of python -m build. This is because CFFI is not able to tell setuptools about the header files, and by default python -m build generates an isolated enviroment containing only the files that setuptools knows about, which will not include the required headers.
A workaround is to pass something like package_data={"": ["*.h"]}, to setuptools.setup, which will grab all .h files, but it may be worth either a) documenting this behaviour or b) augmenting set_source with a headers parameter so it can mark those headers as being required.