Commit Graph

222 Commits (21a7dd216e396c64ddb5ae1dc9a96dbaa95f6780)
 

Author SHA1 Message Date
Thomas Eizinger 21a7dd216e
Merge 8e746d08cd into ab8d5d7c0a
Tamir Duberstein ab8d5d7c0a ci: `brew update` to install LLVM 20
Thomas Eizinger 8e746d08cd
Use `target_arch = "bpf"` for `panic_handler`-cfg
The `panic_handler` defined in the eBPF crate is only required if we are
compiling for the bpf target. When compiling for the host-system, be it to
run tests or by compiling the entire workspace with `cargo check --workspace`
we don't want to define the `panic_handler`, otherwise it will clash with
the one defined by the standard library.

Related: https://github.com/aya-rs/book/issues/214
Andras Gemes bc8848eb62 docs: update LSM hook prompt to reference lsm_hook_defs.h
Tamir Duberstein 273f30a0da ci: use latest stable rust
cargo_metadata depends on e.g. `home`[0] whose MSRV is N-2[1], so we
can't easily pin our Rust version.

Link: https://crates.io/crates/home [0]
Link: https://github.com/rust-lang/cargo/commit/c6c1df47 [1]
Tamir Duberstein 6580d77fa4 Use aya-build
Tamir Duberstein cb9ab79705 toml: fmt
Tamir Duberstein 77cbc8bcf9 Remove rust-toolchain
Doesn't make much sense in a workspace.
Tamir Duberstein 59c882cebf Enable unwinding in userspace
Xiaobo Liu 1b37aad7f5 Update aya crate to 0.13.1
Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Tamir Duberstein b1d6fb31ea Always build eBPF; remove xtask
Tamir Duberstein 27e7867528 Add cross-compilation to CI
Updates the README to use cargo target config instead of RUSTFLAGS to
avoid setting the linker for ebpf in cargo-in-cargo.
Tamir Duberstein 89eb550856 Reformat test.sh
Zero King 0c8fb43804 chore: Format Cargo.toml
Tamir Duberstein 20ce988ecf Document cross-compilation on macOS
The instructions in the book are now out of date for projects generated
with this template. Since the instructions are much shorter these days,
put them in the README.
Tamir Duberstein 5622ca4df1 Test execution of projects
Tamir Duberstein 940a60e0a3 Move user-facing messages to from log to print
Tamir Duberstein 32f914aa6d Add error context
Tamir Duberstein 263f115fdc Use destructuring
Tamir Duberstein f131e87764 Use TCP listener instead of stream
This doesn't require a listener on the other side.
Tamir Duberstein dec0021b58 Use cancel-in-progress
Tamir Duberstein b6ecbb8bd1 Appease shellcheck
Tamir Duberstein 7425e7bd2d Add Rust 1.80.1 to CI
Tamir Duberstein 8250a09bc0 Add rustfmt to CI
Tamir Duberstein 5811d6ff56 Replace xtask builds with build scripts
Adapt https://github.com/aya-rs/aya/commit/3d463a3 and subsequent work
to the template. This has worked very well for us in the main project,
and our users should get the same hotness.

Note that xtask is still used for running, as it is in the main project.
Tamir Duberstein 4da4bf4729 Run clippy in CI
Install Rust stable *after* nightly so that the default is stable.
Tamir Duberstein ee45752006 Move dependencies to workspace
Add "{{project-name}}-ebpf" to workspace. Update various cargo configs
to match main aya repo.
Dave Tucker e064758d59
Merge pull request from cppcoffee/main
Update aya version to 0.13
Xiaobo Liu d889dd373b Upgrade aya version
Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Xiaobo Liu 44c1f66b7e ebpf: merge rust-analyzer settings
Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Xiaobo Liu 04b631eb7c ebpf: consolidate rust-analyzer settings
Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Tamir Duberstein 91518b64b3 Build on ubuntu-22.04
This matches the version used in the bpf-linker binstall job. Otherwise
we fail with:
```
  = note: bpf-linker: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by bpf-linker)
          bpf-linker: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by bpf-linker)
          bpf-linker: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bpf-linker)
```

Add a nightly build so we catch these earlier.
Zero King 0afbca858c
chore: remove Cargo.lock from .gitignore ()
Fixes 
Zero King 79b73bf2ef fix: emacs directory locals
- Emacs vectors do not have "," separator.
- The .dir-locals.el list is checked against major mode names, but
  lsp-mode could be a minor mode. Use the generic prog-mode instead.
Sandeep Nambiar d3435676f7
feat: add emacs directory locals to configure rust-analyzer ()
.dir-locals.el is the emacs equivalent of .vim directory in the project here.

This PR adds a simple configuration to map the same rust-analyzer
configuration variable as the vim version to make use of new aya
projects seamless with emacs projects that use emacs-lsp + rust analyzer.
catalin-h a006355e62
lsp: support rust-analyzer on helix editor ()
This patch allows the helix editor to correctly initialize the
rust-analyzer when opening a source file from {{project-name}}-ebpf.

To find the Cargo.toml the helix editor must be launched from
the {{project-name}}-ebpf directory or provide the workspace path
as follows:

hx -w <path to {{project-name}}-ebpf> [relative path in {{project-name}}-ebpf]

The patch was tested using helix version 23.10.
Chris Pick 2ad877309a build: Set `resolver = "2"` at the workspace's Cargo.toml
This is the default resolver for the 2021 edition, but needs to be set
manually in virtual workspaces.

https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html#detail
Chris Pick d9ce1b7169 ebpf: use TC_ACT_PIPE in classifier
Demonstrate using the correct constant instead of a magic number.
wanjunlei 7c143de8af
add a build command ()
Add a new command to build ebpf and userspace programs without running.

```
cargo xtask build
```

Co-authored-by: Michal Rostecki <vadorovsky@protonmail.com>
Michal Rostecki f642921fee chore: Use `aya`, `aya-ebpf` and `aya-log` from crates.io
Michal Rostecki 97e817d110
chore: Rename aya-bpf to aya-ebpf ()
aya-bpf crate got renamed to aya-ebpf. Reflect this change
in the template.
blacker1230 1185fd49d2 Fix sk_msg.
pdliyan 3bee1bcc0f Reverse of sk_msg.
pdliyan 17fe98c37c Have no idea about this failed.
pdliyan 5d04aef980 Try fix the usage of fd().
pdliyan c68f239ad0 Try fix test failed. Let's see if that would pass.
pdliyan 628e6a4f81 Fix unchanged Bpf reference. Would check sock_map latter.
pdliyan bc61bdeeba Rename aya-bpf to aya-ebpf.
pdliyan dce5317f2c Rename aya-bpf to aya-ebpf.
dependabot[bot] 9dc5296e47
Merge pull request from aya-rs/dependabot/github_actions/actions/checkout-4