Merge pull request #217 from sched-ext/fix-rustland-core-crate

scx_rustland_core: separate crate source code from assets
This commit is contained in:
Tejun Heo 2024-04-04 09:51:43 -10:00 committed by GitHub
commit 1c6af78b79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 13 additions and 9 deletions

View File

@ -7,12 +7,6 @@ license = "GPL-2.0-only"
repository = "https://github.com/sched-ext/scx"
description = "Framework to implement sched_ext schedulers running in user space"
include = [
"src/bpf/intf.h",
"src/bpf/main.bpf.c",
"src/bpf.rs",
]
[dependencies]
anyhow = "1.0"
libbpf-rs = "0.23"
@ -24,3 +18,13 @@ scx_utils = { path = "../scx_utils", version = "0.7" }
tar = "0.4"
walkdir = "2.4"
scx_utils = { path = "../scx_utils", version = "0.7" }
[lib]
name = "scx_rustland_core"
path = "src/lib.rs"
include = [
"assets/bpf/intf.h",
"assets/bpf/main.bpf.c",
"assets/bpf.rs",
]

View File

@ -30,9 +30,9 @@ impl RustLandBuilder {
pub fn build(&mut self) -> Result<()> {
// Embed the BPF source files.
let intf = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/bpf/intf.h"));
let skel = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/bpf/main.bpf.c"));
let bpf = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/bpf.rs"));
let intf = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/assets/bpf/intf.h"));
let skel = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/assets/bpf/main.bpf.c"));
let bpf = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/assets/bpf.rs"));
// Generate BPF backend code (C).
self.create_file("intf.h", intf);