19 Commits (main)

Author SHA1 Message Date
wanjunlei 7c143de8af
add a build command (#108)
Add a new command to build ebpf and userspace programs without running.

```
cargo xtask build
```

Co-authored-by: Michal Rostecki <vadorovsky@protonmail.com>
4 months ago
Tamir Duberstein 1247fdea1d socket_filter: fix build
The signature of attach changed in
https://github.com/aya-rs/aya/pull/723.
1 year ago
Dmitry Savintsev 7008f570b0 fail with descriptive message
Co-authored-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Dmitry Savintsev 255c59cf98 Remove unix-specific executor in xtask
Change unix-specific executor to generic one
to enable xtask working on Windows and eventually
be able to cross-compile on Windows.

Fixes #76.

Signed-off-by: Dmitry Savintsev <dsavints@gmail.com>
2 years ago
Dmitry Savintsev c6c4082093 update anyhow, clap, and tokio 2 years ago
arctic-alpaca 5b3653c936
Only remove RUSTUP_TOOLCHAIN env var in xtask build-ebpf 2 years ago
arctic-alpaca 039c07f7a2
Honor rust-toolchain.toml file in xtask, remove cargo/rust env vars
Remove env vars related to rust and cargo before executing cargo.
2 years ago
Dmitry Savintsev e86392d422 Fix clippy issues in the generated code.
Fix template so that the generated code would not have any
clippy issues (per `cargo +nightly clippy`).
Add template conditionals on the program_type to avoid
a warning about unused 'opt' variable.

Fixes #66.
2 years ago
Michal Rostecki 76699e10b2 Update dependencies
Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Michal Rostecki 9297249e01 xtask: Use clap instead of structopt
structopt was merged into clap (starting from clap 3.0), therefore
becoming a deprecated project.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Michal Rostecki ec1910fffd Revert "Use release profile for eBPF programs by default"
This reverts commit ad9b8ee8dc.
3 years ago
Dmitry Savintsev aa3b2a4407 use edition 2021 3 years ago
Michal Rostecki ad9b8ee8dc Use release profile for eBPF programs by default
This change removes the differentiation between release and dev profiles
for eBPF programs. There is no way eBPF programs can be debugged and
building them with dev profile just makes them slower and often unable
to be verified. They should be always built with the release profile.

After this change, `cargo xtask build-ebpf` is going to build eBPF
programs with release profile. And the userspace program is going to
include eBPF program bytes from target/release/. Regardless of which
profile is being used in the userspace program.

`cargo xtask build-ebpf` has the --profile argument which can be
optionally used (i.e. for user-defined profiles), but by default the
value of that option is `release`.

Signed-off-by: Michal Rostecki <mrostecki@opensuse.org>
3 years ago
William Findlay dc7eb0410f
xtask/run: fix clippy lint 3 years ago
William Findlay a80359acca
userspace: use include_bytes_aligned! instead of --path flag 3 years ago
William Findlay ee77866a16
xtask/build_ebpf: document flags 3 years ago
William Findlay ee4336a643
xtask/build_ebpf: fix panic message 3 years ago
William Findlay d590d3a1ea
xtask: implement xtask run subcommand
This new subcommand provides a convenient way to run your aya application.

Features include:
    - automatic compilation of userspace + bpf code
    - support for user-defined runners, defaulting to `sudo -E` for convenience
    - no need to run `sudo cargo run` (gross) or `sudo target/debug/myapp` (also gross),
      it just works
    - an optional `-p` flag which automatically supplies the correct --path flag to the
      application
    - support for trailing args after a final -- which are passed to the application,
      cargo run-style
3 years ago
Dave Tucker 5d018fd6ba Add xtask for building ebpf programs
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago