Commit Graph

21 Commits (create-pull-request/codegen)

Author SHA1 Message Date
Tim W 17573e0e47 aya-build: plumb features of ebpf crates
This allows callers to select features of the ebpf crate.
1 day ago
Tamir Duberstein 948b8553ee
aya-build: guess `bpf_target_arch` from `HOST`
Remove the use of `CARGO_CFG_TARGET_ARCH` in ebpf crate build scripts,
moving it back only to `aya_build::build_ebpf` where it refers to the
userspace crate's target. In the ebpf crates restore the use of `HOST`
as the default compilation target when neither `--cfg bpf_target_arch`
nor `AYA_BPF_TARGET_ARCH` are provided.
7 days ago
Tamir Duberstein fe3f5c4e7d
aya-build: read AYA_BPF_TARGET_ARCH
This allows users to set `bpf_target_arch` from the environment without
touching RUSTFLAGS.
7 days ago
Tamir Duberstein 4b0ddfc2b0
aya-build: simplify
Cargo sets `CARGO_CFG_BPF_TARGET_ARCH` so we don't have to inspect
`CARGO_ENCODED_RUSTFLAGS`.
7 days ago
Tamir Duberstein 0c7c8097b2
aya-build: clarify naming 7 days ago
Tamir Duberstein e2c50ac221
aya-build: use OsString::into_string 7 days ago
Tamir Duberstein b4bcf52ef1
aya-build: pass bpf_target_arch with cfg
Retire the use of `CARGO_CFG_BPF_TARGET_ARCH` -- using a `cfg` allows
cargo to properly use a cache per cfg, making `./clippy.sh` much faster.

```
Cold: ./clippy.sh --target x86_64-unknown-linux-gnu -p aya-build  75.38s user 137.28s system 211% cpu 1:40.43 total
Warm: ./clippy.sh --target x86_64-unknown-linux-gnu -p aya-build   4.46s user   3.41s system  71% cpu   11.01 total
```
1 week ago
Tamir Duberstein d9704be77d
aya-build: remove cargo_metadata from public API 1 week ago
Tamir Duberstein f610453ec2
ebpf: extract CARGO_CFG_BPF_TARGET_ARCH logic 1 week ago
Tamir Duberstein 5f5305c2a8
lint all crates; enable strict pointer lints 1 month ago
dependabot[bot] a7e3e6d4d9
build(deps): bump the cargo-crates group with 2 updates
Updates the requirements on [cargo_metadata](https://github.com/oli-obk/cargo_metadata) and [object](https://github.com/gimli-rs/object) to permit the latest version.

Updates `cargo_metadata` to 0.19.2
- [Release notes](https://github.com/oli-obk/cargo_metadata/releases)
- [Changelog](https://github.com/oli-obk/cargo_metadata/blob/main/CHANGELOG.md)
- [Commits](https://github.com/oli-obk/cargo_metadata/compare/0.19.0...0.19.2)

Updates `object` to 0.36.7
- [Changelog](https://github.com/gimli-rs/object/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gimli-rs/object/compare/0.36.0...0.36.7)

---
updated-dependencies:
- dependency-name: cargo_metadata
  dependency-version: 0.19.2
  dependency-type: direct:production
  dependency-group: cargo-crates
- dependency-name: object
  dependency-version: 0.36.7
  dependency-type: direct:production
  dependency-group: cargo-crates
...

Signed-off-by: dependabot[bot] <support@github.com>
5 months ago
Tamir Duberstein eab5661a0e aya-build: enable BTF 7 months ago
Thomas Eizinger 6d36fe13d3 aya-build: Allow setting Rust nightly version
At present, `aya_build` will always use `+nightly` to build the
eBPF kernel. This is problematic in environments such as CI, where
tools always need to be installed first. Installing the current
nightly Rust toolchain gives you a new toolchain every day. This
poisones caches and makes CI jobs non-deterministic.

Resolves: #1226
7 months ago
Tamir Duberstein 49a828ec56 taplo: reorder-keys
Group non-workspace keys before workspace ones for readability.
8 months ago
Tamir Duberstein a43e40ae1d introduce workspace lints, warn on unused crates
In practice this will forbid unused dependencies because we run clippy
with `--deny warnings`.

Workspace lints is a nice place to ratchet up lints through the codebase
all at once and consistently.
8 months ago
Tamir Duberstein f0a9f19ddc Bump edition to 2024
Change FromRawTracepointArgs::arg to return T rather than *const T which
seems to have been returning a dangling pointer.

Arguably this is not strictly necessary; edition 2024 seems to be
focused on increased strictness around unsafe code which doesn't unlock
new functionality for our users. That said, this work revealed an
apparent bug (see above) that we wouldn't otherwise catch due to
allow-by-default lints.
8 months ago
Tamir Duberstein 4101a5a55d Use #[expect(...)] rather than #[allow(...)]
This is stricter, and revealed a few unused allowances.
8 months ago
Tamir Duberstein 3d8cb08b7f aya-build: add explicit irrefutable pattern
This is required in Rust 1.80 at least.
11 months ago
Tamir Duberstein 015c0df0f4 aya-build: enable anyhow/std
This is needed before Rust 1.81.
11 months ago
Tamir Duberstein 6970353b58 aya-build: add description 11 months ago
Tamir Duberstein 2b2af44915 Extract aya-build for building eBPF crates
We'll use this in the template and book to avoid duplicating all the
code.
11 months ago