Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove libbpf as a submodule #177

Merged
merged 1 commit into from
Mar 8, 2024
Merged

Conversation

jordalgo
Copy link
Contributor

@jordalgo jordalgo commented Mar 7, 2024

Instead clone the libbpf repo at a specific hash during setup. This is to fix an issue whereby submodules are not included in the tarball and therefore won't be updated/fetched during setup after unzipping the tarball.

@jordalgo jordalgo force-pushed the libbpf-shallow branch 2 times, most recently from 2e77529 to 23a3adf Compare March 7, 2024 23:49
Instead clone the libbpf repo at a specific hash during setup.
This is to fix an issue whereby submodules are not included
in the tarball and therefore won't be updated/fetched during
setup after unzipping the tarball.
@jordalgo
Copy link
Contributor Author

jordalgo commented Mar 8, 2024

Please feel free to revert this if it ends up causing issues. The meson stuff to get this to work is a little hacky.

@jordalgo jordalgo merged commit 6c7617a into sched-ext:main Mar 8, 2024
1 check passed
@arighi
Copy link
Contributor

arighi commented Mar 8, 2024

@jordalgo can we avoid fetching libbpf if libbpf_a=disabled is used?

Fetching/including libbpf breaks the deb build (or it makes it really tricky), so I'd be nice if there was a way to completely skip the libbpf fetch/build and rely on the version installed in the system.

I haven't looked at this in details, so there might be a way already...

@jordalgo
Copy link
Contributor Author

jordalgo commented Mar 8, 2024

@arighi I believe that should be happening with this change. Are you not seeing that? Here is my setup output:

[[email protected] ~/local/scx (libbpt-fetch)]$ /home/jordalgo/meson-1.3.0/meson.py setup build --prefix ~ -D systemd=disabled -D libbpf_a=disabled
The Meson build system
Version: 1.3.0
Source dir: /data/users/jordalgo/scx
Build dir: /data/users/jordalgo/scx/build
Build type: native build
Project name: sched_ext schedulers
Project version: 0.1.7
C compiler for the host machine: cc (gcc 11.4.1 "cc (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3)")
C linker for the host machine: cc ld.bfd 2.35.2-42
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program clang found: YES (/data/users/jordalgo/devtools/llvm/latest/bin/clang)
Program bpftool found: YES (/usr/sbin/bpftool)
Program cargo found: YES (/usr/bin/cargo)
Program /data/users/jordalgo/scx/meson-scripts/get_clang_ver found: YES (/data/users/jordalgo/scx/meson-scripts/get_clang_ver)
Program /data/users/jordalgo/scx/meson-scripts/bpftool_build_skel found: YES (/data/users/jordalgo/scx/meson-scripts/bpftool_build_skel)
Program /data/users/jordalgo/scx/meson-scripts/get_sys_incls found: YES (/data/users/jordalgo/scx/meson-scripts/get_sys_incls)
Program /data/users/jordalgo/scx/meson-scripts/test_sched found: YES (/data/users/jordalgo/scx/meson-scripts/test_sched)
Program /data/users/jordalgo/scx/meson-scripts/fetch_libbpf found: YES (/bin/bash /data/users/jordalgo/scx/meson-scripts/fetch_libbpf)
Program /data/users/jordalgo/scx/meson-scripts/build_libbpf found: YES (/data/users/jordalgo/scx/meson-scripts/build_libbpf)
Program /data/users/jordalgo/scx/meson-scripts/cargo_fetch found: YES (/data/users/jordalgo/scx/meson-scripts/cargo_fetch)
Found pkg-config: YES (/opt/fb-qemu/bin/pkg-config) 0.29.2
Run-time dependency libbpf found: YES 1.4.0
Message: cpu=x86_64 bpf_base_cflags=['-g', '-O2', '-Wall', '-Wno-compare-distinct-pointer-types', '-D__TARGET_ARCH_x86', '-mcpu=v3', '-mlittle-endian', '-idirafter /data/users/jordalgo/devtools/llvm/20230914/lib/clang/18/include', '-idirafter /usr/local/include', '-idirafter /usr/include']
Run-time dependency threads found: YES
Dependency threads found: YES unknown (cached)
Dependency threads found: YES unknown (cached)
Dependency threads found: YES unknown (cached)
Dependency threads found: YES unknown (cached)
Dependency threads found: YES unknown (cached)
Dependency threads found: YES unknown (cached)
Dependency systemd skipped: feature systemd disabled
Build targets in project: 16

sched_ext schedulers 0.1.7

  User defined options
    prefix  : /home/jordalgo
    libbpf_a: disabled
    systemd : disabled

Found ninja-1.10.2 at /usr/bin/ninja

"Fetching libbpf repo" is missing in output.

@arighi
Copy link
Contributor

arighi commented Mar 8, 2024

Hm... something odd is happening, I think my debian/rules calls a meson clean via dh_clean and that triggers the repo fetch, I'll investigate more.

@arighi
Copy link
Contributor

arighi commented Mar 8, 2024

Oh wait, meson doesn't have a clean command, but dh_clean calls a meson clean... how do we clean stuff with meson, do we just rm -rf build?

@jordalgo
Copy link
Contributor Author

jordalgo commented Mar 8, 2024

This is how I do a full clean from the scx root git clean -dffX.

meson clean (AFAICT) doesn't do anything but run the setup with "clean" as the build folder. The only clean option I see is when running compile e.g. meson compile --clean which "cleans" the build directory, though it definitely doesn't remove everything.

@arighi
Copy link
Contributor

arighi commented Mar 8, 2024

Apparently something in the debian build scripts is calling a plain meson clean (I'm still trying to figure out what/where), that's obviously wrong, because it doesn't actually clean anything and it triggers the fetch of libbpf (that breaks the build in the ppa, because in the ppa you can only download stuff from the Ubuntu archives).

I'll figure what it is and fix it on the deb packaging part, so your change should be fine for now.

@arighi
Copy link
Contributor

arighi commented Mar 8, 2024

@jordalgo found it and fixed on my side!

f790613

It was actually a bug in the deb packaging script, sorry for the noise. :)

@jordalgo
Copy link
Contributor Author

jordalgo commented Mar 8, 2024

No worries! Glad you found it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants