The bindgen 0.59.1 installed from Ubuntu 22.04 apt source does not
support the following args:
'--formatter', 'rustfmt',
'--merge-extern-blocks',
'--allowlist-file', meson.project_source_root() + '/include/.*',
'--allowlist-file', meson.project_source_root() + '/.*',
'--allowlist-file', meson.project_build_root() + '/.*'
Ouch. --allowlist-file was added in 0.60, so Debian has it. I think we should ask Canonical if they can update bindgen in addition to rustc.
Paolo
The first two args are cosmetic and should not hurt if removed (but I
need to double check).
Removing the allowlist-file, however, causes IPPORT_RESERVED to be
generated twice using different types and thus break the
build. Allowlists for bindgen 0.59.1 can only be specified as regex on
function, type or var. I don't find (yet) an equivalent way of
--allowlist-file. A dirty trick is `--blocklist-item IPPORT_RESERVED`,
which works but is so ad-hoc.
--
Best Regards
Junjie Mao