Description
Goal: make it super easy for people to use bindgen
(and crates to depend on bindgen
without inflicting downstream pain), no installing libclang
manually, no configuring LIBCLANG_PATH
, no making sure your libclang
is the right version.
Previously, we have speculated about getting rustup
to distribute libclang
for us. I talked with @alexcrichton and he pointed out that we don't even need to do that to get what we want. We can bundle libclang.{so,dll,dylib}
into our crate directly and then have build.rs
setup LIBCLANG_PATH
as needed.
To be clear, this functionality would be behind a new feature, on by default. One could always turn this feature off to get the current behavior, and for targets for which we don't have a bundled libclang
available, we will also have the current behavior.
There are still some open questions:
-
Should we put the bundled
libclang
into this repository? A differentbindgen-libclangs
repository? -
Should we use
git lfs
? -
Should the
libclang
s be literally bundled in the crate, and downloaded with the rest of the crate's source, or should we fetch only the target'slibclang
insidebuild.rs
? -
What targets should we bundle
libclang
for? Tier-1 platforms? Start with one or two and then add more as we go?