File tree Expand file tree Collapse file tree 8 files changed +28
-16
lines changed
Expand file tree Collapse file tree 8 files changed +28
-16
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,12 @@ use libbpf_cargo::SkeletonBuilder;
77const SRC : & str = "src/bpf/capable.bpf.c" ;
88
99fn main ( ) {
10- let mut out =
11- PathBuf :: from ( env:: var_os ( "OUT_DIR" ) . expect ( "OUT_DIR must be set in build script" ) ) ;
12- out. push ( "capable.skel.rs" ) ;
10+ let out = PathBuf :: from (
11+ env:: var_os ( "CARGO_MANIFEST_DIR" ) . expect ( "CARGO_MANIFEST_DIR must be set in build script" ) ,
12+ )
13+ . join ( "src" )
14+ . join ( "bpf" )
15+ . join ( "capable.skel.rs" ) ;
1316
1417 let arch = env:: var ( "CARGO_CFG_TARGET_ARCH" )
1518 . expect ( "CARGO_CFG_TARGET_ARCH must be set in build script" ) ;
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ use time::macros::format_description;
1919use time:: OffsetDateTime ;
2020
2121mod capable {
22- include ! ( concat!( env!( "OUT_DIR " ) , "/capable.skel.rs" ) ) ;
22+ include ! ( concat!( env!( "CARGO_MANIFEST_DIR " ) , "/src/bpf /capable.skel.rs" ) ) ;
2323}
2424
2525use capable:: capable_types:: uniqueness;
Original file line number Diff line number Diff line change @@ -7,9 +7,12 @@ use libbpf_cargo::SkeletonBuilder;
77const SRC : & str = "src/bpf/runqslower.bpf.c" ;
88
99fn main ( ) {
10- let mut out =
11- PathBuf :: from ( env:: var_os ( "OUT_DIR" ) . expect ( "OUT_DIR must be set in build script" ) ) ;
12- out. push ( "runqslower.skel.rs" ) ;
10+ let out = PathBuf :: from (
11+ env:: var_os ( "CARGO_MANIFEST_DIR" ) . expect ( "CARGO_MANIFEST_DIR must be set in build script" ) ,
12+ )
13+ . join ( "src" )
14+ . join ( "bpf" )
15+ . join ( "runqslower.skel.rs" ) ;
1316
1417 let arch = env:: var ( "CARGO_CFG_TARGET_ARCH" )
1518 . expect ( "CARGO_CFG_TARGET_ARCH must be set in build script" ) ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ use time::macros::format_description;
1414use time:: OffsetDateTime ;
1515
1616mod runqslower {
17- include ! ( concat!( env!( "OUT_DIR " ) , "/runqslower.skel.rs" ) ) ;
17+ include ! ( concat!( env!( "CARGO_MANIFEST_DIR " ) , "/src/bpf /runqslower.skel.rs" ) ) ;
1818}
1919
2020use runqslower:: * ;
Original file line number Diff line number Diff line change @@ -7,9 +7,12 @@ use libbpf_cargo::SkeletonBuilder;
77const SRC : & str = "src/bpf/tc.bpf.c" ;
88
99fn main ( ) {
10- let mut out =
11- PathBuf :: from ( env:: var_os ( "OUT_DIR" ) . expect ( "OUT_DIR must be set in build script" ) ) ;
12- out. push ( "tc.skel.rs" ) ;
10+ let out = PathBuf :: from (
11+ env:: var_os ( "CARGO_MANIFEST_DIR" ) . expect ( "CARGO_MANIFEST_DIR must be set in build script" ) ,
12+ )
13+ . join ( "src" )
14+ . join ( "bpf" )
15+ . join ( "tc.skel.rs" ) ;
1316
1417 let arch = env:: var ( "CARGO_CFG_TARGET_ARCH" )
1518 . expect ( "CARGO_CFG_TARGET_ARCH must be set in build script" ) ;
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ use libbpf_rs::TC_H_MIN_INGRESS;
1919use libbpf_rs:: TC_INGRESS ;
2020
2121mod tc {
22- include ! ( concat!( env!( "OUT_DIR " ) , "/tc.skel.rs" ) ) ;
22+ include ! ( concat!( env!( "CARGO_MANIFEST_DIR " ) , "/src/bpf /tc.skel.rs" ) ) ;
2323}
2424use tc:: * ;
2525
Original file line number Diff line number Diff line change @@ -7,9 +7,12 @@ use libbpf_cargo::SkeletonBuilder;
77const SRC : & str = "src/bpf/tproxy.bpf.c" ;
88
99fn main ( ) {
10- let mut out =
11- PathBuf :: from ( env:: var_os ( "OUT_DIR" ) . expect ( "OUT_DIR must be set in build script" ) ) ;
12- out. push ( "tproxy.skel.rs" ) ;
10+ let out = PathBuf :: from (
11+ env:: var_os ( "CARGO_MANIFEST_DIR" ) . expect ( "CARGO_MANIFEST_DIR must be set in build script" ) ,
12+ )
13+ . join ( "src" )
14+ . join ( "bpf" )
15+ . join ( "tproxy.skel.rs" ) ;
1316
1417 let arch = env:: var ( "CARGO_CFG_TARGET_ARCH" )
1518 . expect ( "CARGO_CFG_TARGET_ARCH must be set in build script" ) ;
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ use libbpf_rs::TcHookBuilder;
1616use libbpf_rs:: TC_INGRESS ;
1717
1818mod tproxy {
19- include ! ( concat!( env!( "OUT_DIR " ) , "/tproxy.skel.rs" ) ) ;
19+ include ! ( concat!( env!( "CARGO_MANIFEST_DIR " ) , "/src/bpf /tproxy.skel.rs" ) ) ;
2020}
2121
2222use tproxy:: * ;
You can’t perform that action at this time.
0 commit comments