Spec URL: https://dcavalca.fedorapeople.org/review/rust-libbpf-sys/rust-libbpf-sys.spec SRPM URL: https://dcavalca.fedorapeople.org/review/rust-libbpf-sys/rust-libbpf-sys-0.3.0~1-1.fc35.src.rpm Description: Rust bindings to libbpf from the Linux kernel. Fedora Account System Username: dcavalca
This package built on koji: https://koji.fedoraproject.org/koji/taskinfo?taskID=67433664
- You must install the LICENSE with %license in %files %package devel Summary: %{summary} BuildArch: noarch %description devel %{_description} This package contains library source intended for building other packages which use "%{crate}" crate. %files devel %license LICENSE %doc README.md %{cargo_registry}/%{crate}-%{version_no_tilde}/ - Can't you unbundle libbpf? We do have a libbpf-static in Fedora. - These should be required in the devel subpackages too: %package devel Summary: %{summary} BuildArch: noarch Requires: elfutils-libelf-devel Requires: zlib-devel so that when a package needs rust-libbpf-sys to build, it can fetch its lib dependencies.
Spec URL: https://dcavalca.fedorapeople.org/review/rust-libbpf-sys/rust-libbpf-sys.spec SRPM URL: https://dcavalca.fedorapeople.org/review/rust-libbpf-sys/rust-libbpf-sys-0.3.0~1-2.fc35.src.rpm Changelog: - Install license - Unbundle libbpf and use the system one instead - Add missing Requires to devel subpackages
- println!("cargo:rustc-link-lib=static=bpf"); + println!("cargo:rustc-link-lib=bpf"); This still should stay static I believe and depend on libbpf-static
I,ve changed this to: diff -Naur a/bindings.h b/bindings.h --- a/bindings.h 2021-01-19 11:12:47.000000000 -0800 +++ b/bindings.h 2021-05-09 10:40:12.043397710 -0700 @@ -1,8 +1,8 @@ -#include "libbpf/include/uapi/linux/if_link.h" -#include "libbpf/src/bpf.h" -#include "libbpf/src/btf.h" -#include "libbpf/src/libbpf.h" -#include "libbpf/src/xsk.h" +#include <linux/if_link.h> +#include <bpf/bpf.h> +#include <bpf/btf.h> +#include <bpf/libbpf.h> +#include <bpf/xsk.h> extern __u64 *_xsk_ring_prod__fill_addr(struct xsk_ring_prod *fill, __u32 idx); @@ -32,4 +32,4 @@ extern __u64 _xsk_umem__extract_offset(__u64 addr); -extern __u64 _xsk_umem__add_offset_to_addr(__u64 addr); \ No newline at end of file +extern __u64 _xsk_umem__add_offset_to_addr(__u64 addr); diff -Naur a/build.rs b/build.rs --- a/build.rs 2021-01-19 11:12:47.000000000 -0800 +++ b/build.rs 2021-05-09 10:41:00.968869985 -0700 @@ -10,39 +10,16 @@ fn main() { let out_dir_str = out_dir.to_str().unwrap(); if cfg!(target_os = "linux") { - let status = Command::new("make") - .arg("install") - .env("BUILD_STATIC_ONLY", "y") - .env("PREFIX", "/") - .env("LIBDIR", "") - .env("OBJDIR", out_dir.join("obj").to_str().unwrap()) - .env("DESTDIR", out_dir_str) - .env("CFLAGS", "-g -O2 -Werror -Wall -fPIC") - .current_dir(src_dir.join("libbpf/src")) - .status() - .unwrap(); - - assert!(status.success()); - - let status = Command::new("make") - .arg("clean") - .current_dir(src_dir.join("libbpf/src")) - .status() - .unwrap(); - - assert!(status.success()); - cc::Build::new() .file("bindings.c") - .include(src_dir.join("libbpf/include")) - .include(src_dir.join("libbpf/include/uapi")) .out_dir(out_dir_str) .compile("bindings"); println!("cargo:rustc-link-search=native={}", out_dir_str); println!("cargo:rustc-link-lib=elf"); println!("cargo:rustc-link-lib=z"); - println!("cargo:rustc-link-lib=static=bpf"); + println!("cargo:rustc-link-lib=static=bpf"); + println!("cargo:rustc-link-search=native={}", "/usr/lib64"); println!("cargo:include={}/include", out_dir_str); } } and it works but it shouldn't be hard-coded to "/usr/lib64", Maybe passed through an environment variable?
I've put up a PR to add a build flag to unbundle libbpf in libbpf-sys: https://github.com/alexforster/libbpf-sys/pull/18
Spec URL: https://dcavalca.fedorapeople.org/review/rust-libbpf-sys/rust-libbpf-sys.spec SRPM URL: https://dcavalca.fedorapeople.org/review/rust-libbpf-sys/rust-libbpf-sys-0.3.0~1-3.fc35.src.rpm Changelog: - Backport PR#18 and turn the novendor feature on by default
Spec URL: https://dcavalca.fedorapeople.org/review/rust-libbpf-sys/rust-libbpf-sys.spec SRPM URL: https://dcavalca.fedorapeople.org/review/rust-libbpf-sys/rust-libbpf-sys-0.3.0~2-1.fc35.src.rpm Changelog: - Update to 0.3.0~2
No need to repeat this: Requires: kernel-headers Requires: elfutils-libelf-devel Requires: libbpf-devel Requires: zlib-devel in %package -n %{name}+default-devel* as it already depends on -devel. Package approved.
Thanks! $ fedpkg request-repo rust-libbpf-sys 1958330 https://pagure.io/releng/fedora-scm-requests/issue/33925
(fedscm-admin): The Pagure repository was created at https://src.fedoraproject.org/rpms/rust-libbpf-sys
FEDORA-2021-efb45c264a has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-efb45c264a
FEDORA-2021-efb45c264a has been pushed to the Fedora 34 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf install --enablerepo=updates-testing --advisory=FEDORA-2021-efb45c264a \*` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-efb45c264a See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-efb45c264a has been pushed to the Fedora 34 stable repository. If problem still persists, please make note of it in this bug report.