-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update for build scripts and aya-build
- Loading branch information
1 parent
8122e89
commit c1b0fee
Showing
111 changed files
with
550 additions
and
1,714 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use which::which; | ||
|
||
/// Building this crate has an undeclared dependency on the `bpf-linker` binary. This would be | ||
/// better expressed by [artifact-dependencies][bindeps] but issues such as | ||
/// https://github.com/rust-lang/cargo/issues/12385 make their use impractical for the time being. | ||
/// | ||
/// This file implements an imperfect solution: it causes cargo to rebuild the crate whenever the | ||
/// mtime of `which bpf-linker` changes. Note that possibility that a new bpf-linker is added to | ||
/// $PATH ahead of the one used as the cache key still exists. Solving this in the general case | ||
/// would require rebuild-if-changed-env=PATH *and* rebuild-if-changed={every-directory-in-PATH} | ||
/// which would likely mean far too much cache invalidation. | ||
/// | ||
/// [bindeps]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html?highlight=feature#artifact-dependencies | ||
fn main() { | ||
let bpf_linker = which("bpf-linker").unwrap(); | ||
println!("cargo:rerun-if-changed={}", bpf_linker.to_str().unwrap()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use anyhow::{anyhow, Context as _}; | ||
use aya_build::cargo_metadata; | ||
|
||
fn main() -> anyhow::Result<()> { | ||
let cargo_metadata::Metadata { packages, .. } = | ||
cargo_metadata::MetadataCommand::new() | ||
.no_deps() | ||
.exec() | ||
.context("MetadataCommand::exec")?; | ||
let ebpf_package = packages | ||
.into_iter() | ||
.find(|cargo_metadata::Package { name, .. }| name == "myapp-ebpf") | ||
.ok_or_else(|| anyhow!("myapp-ebpf package not found"))?; | ||
aya_build::build_ebpf([ebpf_package]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.