scx_utils: Explain what's going on with bindgen version and suppress deprecation warning

This is a followup to https://github.com/sched-ext/scx/pull/50. See the
comment in BpfBuilder::bindgen_bpf_intf() for details.
This commit is contained in:
Tejun Heo 2023-12-29 06:54:08 +09:00
parent 1d868dbf89
commit c47a4b6716
2 changed files with 10 additions and 0 deletions

View File

@ -9,6 +9,8 @@ description = "Utilities for sched_ext schedulers"
[dependencies]
anyhow = "1.0"
# FIXME - We need to allow both 0.68 and 0.69 to accommodate fedora. See the
# comment in BpfBuilder::bindgen_bpf_intf() for details.
bindgen = ">=0.68, <0.70"
glob = "0.3"
lazy_static = "1.4"

View File

@ -493,6 +493,14 @@ impl BpfBuilder {
// Tell cargo to invalidate the built crate whenever the wrapper changes
deps.insert(input.to_string());
// FIXME - bindgen's API changed between 0.68 and 0.69 so that
// `bindgen::CargoCallbacks::new()` should be used instead of
// `bindgen::CargoCallbacks`. Unfortunately, as of Dec 2023, fedora
// is shipping 0.68. To accommodate fedora, allow both 0.68 and 0.69
// of bindgen and suppress deprecation warning. Remove the following
// once fedora can be updated to bindgen >= 0.69.
#[allow(deprecated)]
// The bindgen::Builder is the main entry point to bindgen, and lets
// you build up options for the resulting bindings.
let bindings = bindgen::Builder::default()