File tree Expand file tree Collapse file tree 7 files changed +49
-20
lines changed Expand file tree Collapse file tree 7 files changed +49
-20
lines changed Original file line number Diff line number Diff line change 1+ #![ cfg_attr(
2+ target_arch = "bpf" ,
3+ expect( unused_crate_dependencies, reason = "compiler_builtins" )
4+ ) ]
15#![ no_std]
26
37use core:: {
Original file line number Diff line number Diff line change 22
33set -eux
44
5+ cargo +nightly hack clippy \
6+ --target bpfel-unknown-none -Zbuild-std=core \
7+ --package aya-ebpf-bindings \
8+ --package aya-ebpf \
9+ --package aya-log-ebpf \
10+ --package integration-ebpf \
11+ --feature-powerset \
12+ -- --deny warnings
13+
514# `-C panic=abort` because "unwinding panics are not supported without std"; integration-ebpf
615# contains `#[no_std]` binaries.
716#
@@ -11,4 +20,9 @@ set -eux
1120# unwinding behavior.
1221#
1322# `+nightly` because "the option `Z` is only accepted on the nightly compiler".
14- cargo +nightly hack clippy " $@ " --all-targets --feature-powerset -- --deny warnings -C panic=abort -Zpanic_abort_tests
23+ cargo +nightly hack clippy " $@ " \
24+ --all-targets \
25+ --feature-powerset \
26+ -- --deny warnings \
27+ -C panic=abort \
28+ -Zpanic_abort_tests
Original file line number Diff line number Diff line change 1+ #![ cfg_attr(
2+ target_arch = "bpf" ,
3+ expect( unused_crate_dependencies, reason = "compiler_builtins" )
4+ ) ]
15#![ expect(
26 clippy:: all,
37 clippy:: cast_lossless,
Original file line number Diff line number Diff line change 1- use std:: env;
2-
31fn main ( ) {
4- check_rust_version ( ) ;
52 println ! ( "cargo:rerun-if-env-changed=CARGO_CFG_BPF_TARGET_ARCH" ) ;
6- if let Ok ( arch) = env:: var ( "CARGO_CFG_BPF_TARGET_ARCH" ) {
7- println ! ( "cargo:rustc-cfg=bpf_target_arch=\" {arch}\" " ) ;
8- } else {
9- let arch = env:: var ( "HOST" ) . unwrap ( ) ;
10- let mut arch = arch. split_once ( '-' ) . map_or ( & * arch, |x| x. 0 ) ;
11- if arch. starts_with ( "riscv64" ) {
12- arch = "riscv64" ;
13- }
14- println ! ( "cargo:rustc-cfg=bpf_target_arch=\" {arch}\" " ) ;
15- }
3+ println ! ( "cargo:rerun-if-env-changed=HOST" ) ;
4+
165 print ! ( "cargo::rustc-check-cfg=cfg(bpf_target_arch, values(" ) ;
176 for arch in [
187 "aarch64" ,
@@ -28,7 +17,20 @@ fn main() {
2817 }
2918 println ! ( "))" ) ;
3019
20+ if let Some ( arch) = std:: env:: var_os ( "CARGO_CFG_BPF_TARGET_ARCH" ) {
21+ let arch = arch. to_str ( ) . unwrap ( ) ;
22+ println ! ( "cargo:rustc-cfg=bpf_target_arch=\" {arch}\" " ) ;
23+ } else if let Some ( host) = std:: env:: var_os ( "HOST" ) {
24+ let host = host. to_str ( ) . unwrap ( ) ;
25+ let mut arch = host. split_once ( '-' ) . map_or ( host, |( arch, _rest) | arch) ;
26+ if arch. starts_with ( "riscv64" ) {
27+ arch = "riscv64" ;
28+ }
29+ println ! ( "cargo:rustc-cfg=bpf_target_arch=\" {arch}\" " ) ;
30+ }
31+
3132 println ! ( "cargo::rustc-check-cfg=cfg(generic_const_exprs)" ) ;
33+ check_rust_version ( ) ;
3234}
3335
3436#[ rustversion:: nightly]
Original file line number Diff line number Diff line change 88 html_logo_url = "https://aya-rs.dev/assets/images/crabby.svg" ,
99 html_favicon_url = "https://aya-rs.dev/assets/images/crabby.svg"
1010) ]
11- // TODO(https://github.com/rust-lang/rust/issues/141492): reenable this.
1211#![ cfg_attr(
1312 generic_const_exprs,
1413 expect( incomplete_features) ,
14+ expect( unstable_features) ,
1515 feature( generic_const_exprs)
1616) ]
17- #![ cfg_attr( target_arch = "bpf" , feature( asm_experimental_arch) ) ]
17+ #![ cfg_attr(
18+ target_arch = "bpf" ,
19+ expect( unused_crate_dependencies, reason = "compiler_builtins" ) ,
20+ expect( unstable_features) ,
21+ feature( asm_experimental_arch)
22+ ) ]
1823#![ warn( clippy:: cast_lossless, clippy:: cast_sign_loss) ]
1924#![ no_std]
2025
@@ -65,7 +70,6 @@ pub trait EbpfContext {
6570 }
6671}
6772
68- #[ cfg_attr( target_arch = "bpf" , expect( clippy:: missing_safety_doc) ) ]
6973mod intrinsics {
7074 use super :: cty:: c_int;
7175
Original file line number Diff line number Diff line change @@ -17,6 +17,3 @@ workspace = true
1717aya-ebpf = { version = " ^0.1.1" , path = " ../aya-ebpf" }
1818aya-log-common = { version = " ^0.1.15" , path = " ../../aya-log-common" }
1919aya-log-ebpf-macros = { version = " ^0.1.0" , path = " ../../aya-log-ebpf-macros" }
20-
21- [lib ]
22- path = " src/lib.rs"
Original file line number Diff line number Diff line change 1+ #![ cfg_attr(
2+ target_arch = "bpf" ,
3+ expect( unused_crate_dependencies, reason = "compiler_builtins" )
4+ ) ]
15#![ no_std]
26#![ warn( clippy:: cast_lossless, clippy:: cast_sign_loss) ]
37
You can’t perform that action at this time.
0 commit comments