fix(build): add z3 include path for RHEL/Fedora bindgen compatibility#1388
fix(build): add z3 include path for RHEL/Fedora bindgen compatibility#1388russellb wants to merge 1 commit into
Conversation
|
This seems like a package bug, but I think the cc @maxamillion |
| # z3-sys bindgen needs the z3 include path. On some distros (e.g. RHEL) | ||
| # the header lives in /usr/include/z3/ rather than /usr/include/. The | ||
| # extra -I is harmless on systems where the path doesn't exist. | ||
| BINDGEN_EXTRA_CLANG_ARGS = "-I/usr/include/z3" |
There was a problem hiding this comment.
Question: Why is this specified twice? Once here and in the .cargo/config.toml file.
There was a problem hiding this comment.
This one should be removed. I added it here first, but then it wasn't helpful when I was building outside of mise, so I added the other. Only the first one was supposed to end up in the PR, and I failed to review the result. Sorry about that.
There was a problem hiding this comment.
This seems unrelated to the INCLUDE change.
There was a problem hiding this comment.
Yeah, sorry ... I told my agent to split out a build fix into a separate branch and PR and then failed to look at the result since it was supposed to be simple ... apologies.
On RHEL and Fedora, the z3 header is installed to /usr/include/z3/ rather than /usr/include/. The z3-sys crate's bindgen step fails because pkg-config doesn't find z3 on these distros. Add the extra include path via BINDGEN_EXTRA_CLANG_ARGS in mise.toml — the -I flag is silently ignored on systems where the path doesn't exist.
0a34672 to
ca8815a
Compare
Summary
On RHEL and Fedora, the system
z3.pcfile returns a malformed include path (-I/usr/usr/include/z3— double/usrprefix), causing thez3-syscrate's bindgen step to fail with'z3.h' file not found. Add the correct include path via.cargo/config.tomlso bindgen can find the header regardless of the broken pkg-config output.Related Issue
None — discovered while testing the nftables migration (#1335) on a RHEL dev host.
Changes
.cargo/config.tomlwithBINDGEN_EXTRA_CLANG_ARGS = "-I/usr/include/z3"— picked up automatically by cargomise.tomlfor consistency with the mise-based workflow-Iflag for a nonexistent path is silently ignored by clang, so this is harmless on distros where z3 headers are in the default include pathTesting
mise run pre-commitpassescargo buildsucceeds on RHEL without manually settingCPATHChecklist