Skip to content

Cannot build with libbpf-sys 1.1.0 #303

@krallin

Description

@krallin

Like it says in the title. A new version of libbpf-sys 1.1.0 was released and breaks this crate:

error[E0412]: cannot find type `size_t` in crate `libbpf_sys`
  --> /home/torozco/.cargo/registry/src/github.com-1ecc6299db9ec823/libbpf-rs-0.19.1/src/map.rs:39:43
   |
39 |                 data.len() as libbpf_sys::size_t,
   |                                           ^^^^^^ not found in `libbpf_sys`

error[E0412]: cannot find type `size_t` in crate `libbpf_sys`
  --> /home/torozco/.cargo/registry/src/github.com-1ecc6299db9ec823/libbpf-rs-0.19.1/src/object.rs:42:83
   |
42 |             sz: mem::size_of::<libbpf_sys::bpf_object_open_opts>() as libbpf_sys::size_t,
   |                                                                                   ^^^^^^ not found in `libbpf_sys`

error[E0412]: cannot find type `size_t` in crate `libbpf_sys`
   --> /home/torozco/.cargo/registry/src/github.com-1ecc6299db9ec823/libbpf-rs-0.19.1/src/object.rs:100:42
    |
100 |                 mem.len() as libbpf_sys::size_t,
    |                                          ^^^^^^ not found in `libbpf_sys`

error[E0412]: cannot find type `size_t` in crate `libbpf_sys`
   --> /home/torozco/.cargo/registry/src/github.com-1ecc6299db9ec823/libbpf-rs-0.19.1/src/perf_buffer.rs:114:43
    |
114 |                 self.pages as libbpf_sys::size_t,
    |                                           ^^^^^^ not found in `libbpf_sys`

error[E0412]: cannot find type `size_t` in crate `libbpf_sys`
   --> /home/torozco/.cargo/registry/src/github.com-1ecc6299db9ec823/libbpf-rs-0.19.1/src/perf_buffer.rs:175:86
    |
175 |             libbpf_sys::perf_buffer__consume_buffer(self.ptr, buf_idx as libbpf_sys::size_t)
    |                                                                                      ^^^^^^ not found in `libbpf_sys`

error[E0412]: cannot find type `size_t` in crate `libbpf_sys`
   --> /home/torozco/.cargo/registry/src/github.com-1ecc6299db9ec823/libbpf-rs-0.19.1/src/perf_buffer.rs:186:90
    |
186 |             unsafe { libbpf_sys::perf_buffer__buffer_fd(self.ptr, buf_idx as libbpf_sys::size_t) };
    |                                                                                          ^^^^^^ not found in `libbpf_sys`

error[E0412]: cannot find type `size_t` in crate `libbpf_sys`
   --> /home/torozco/.cargo/registry/src/github.com-1ecc6299db9ec823/libbpf-rs-0.19.1/src/program.rs:308:44
    |
308 |                 func_offset as libbpf_sys::size_t,
    |                                            ^^^^^^ not found in `libbpf_sys`

error[E0412]: cannot find type `size_t` in crate `libbpf_sys`
  --> /home/torozco/.cargo/registry/src/github.com-1ecc6299db9ec823/libbpf-rs-0.19.1/src/tc.rs:50:89
   |
50 |         tc_hook.hook.sz = std::mem::size_of::<libbpf_sys::bpf_tc_hook>() as libbpf_sys::size_t;
   |                                                                                         ^^^^^^ not found in `libbpf_sys`

error[E0412]: cannot find type `size_t` in crate `libbpf_sys`
  --> /home/torozco/.cargo/registry/src/github.com-1ecc6299db9ec823/libbpf-rs-0.19.1/src/tc.rs:51:89
   |
51 |         tc_hook.opts.sz = std::mem::size_of::<libbpf_sys::bpf_tc_opts>() as libbpf_sys::size_t;
   |                                                                                         ^^^^^^ not found in `libbpf_sys`

error[E0308]: mismatched types
  --> /home/torozco/.cargo/registry/src/github.com-1ecc6299db9ec823/libbpf-rs-0.19.1/src/ringbuf.rs:68:67
   |
68 |         let c_sample_cb: libbpf_sys::ring_buffer_sample_fn = Some(Self::call_sample_cb);
   |                                                                   ^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `u64`
   |
   = note: expected fn pointer `unsafe extern "C" fn(_, _, usize) -> _`
                 found fn item `unsafe extern "C" fn(_, _, u64) -> _ {RingBufferBuilder::<'_>::call_sample_cb}`

error[E0308]: mismatched types
   --> /home/torozco/.cargo/registry/src/github.com-1ecc6299db9ec823/libbpf-rs-0.19.1/src/skeleton.rs:172:17
    |
172 |             sz: size_of::<bpf_object_skeleton>() as c_ulong,
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `u64`

error[E0308]: mismatched types
   --> /home/torozco/.cargo/registry/src/github.com-1ecc6299db9ec823/libbpf-rs-0.19.1/src/skeleton.rs:182:21
    |
182 |         s.data_sz = self.data.len() as c_ulong;
    |         ---------   ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `u64`
    |         |
    |         expected due to the type of this binding

Some errors have detailed explanations: E0308, E0412.
For more information about an error, try `rustc --explain E0308`.

I'm guessing a new release of this crate is forthcoming considering they're maintained by the same organization, but until then perhaps this one can be pinned to the version of libbpf-sys it requires?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions