Allow static and dynamic linking#70
Conversation
Currently both `userfaultfd` and `userfaultfd-sys` always load libclang dynamically. This commit keeps this as the default behavior but adds the "static" and "runtime" features. The "static" feature will statically link libclang, while "runtime" will load libclang at runtime. Users using `default-features=false` will need to specify `features = ["runtime"]` to maintain current behavior, but they should be in the minority, given that neither crate currently has default features.
|
I see the workflow is failing due to github having retired their ubuntu 20 images. I also see there's a problem with simply updating to the more recent ubuntu 22 images, since they're running kernel 6.8 and as a consequence the syscall path for creating a file descriptor would no longer be tested. I can see at least two options for addressing this problem: 1.) Modify the public API of the crate to allow the user to choose which method to use - either use the syscall or the ioctl. |
|
Hi @ureeves and thanks for the contribution. I would be in favour of the latter solution (introducing features) where, by default, we 'd be trying to use |
Currently both
userfaultfdanduserfaultfd-sysalways load libclang dynamically. This commit keeps this as the default behavior but adds the "static" and "runtime" features. The "static" feature will statically link libclang, while "runtime" will load libclang at runtime.Users using
default-features=falsewill need to specifyfeatures = ["runtime"]to maintain current behavior, but they should be in the minority, given that neither crate currently has default features.