Commit Graph

35 Commits

Author SHA1 Message Date
Michal R
a7cfc694bd xtask: Allow to run VM integration tests without dpkg
Debian packages are just nested archives, where the outer one is ar
and the inner one is lzma2 tarball. Use Rust crates to unpack them.

Co-authored-by: Tamir Duberstein <tamird@gmail.com>
2025-10-23 21:17:31 +02:00
Tamir Duberstein
5f046899b5 xtask: teach integration-test vm to consume kernel debs directly
Bundle handling of Debian kernel archives into xtask so callers can pipe
the raw `.deb` paths straight into `cargo xtask integration-test vm …`.
The driver now extracts each archive into `<cache>/kernel-archives`,
locates the matching `vmlinuz-*`, `lib/modules/*`, and config files, and
feeds those into the initramfs build without requiring the user to
pre-run dpkg/tar. With this in place we drop
`.github/scripts/find_kernels.py`, simplify AGENTS.md/CI instructions to
use `find test/.tmp -name '*.deb'`, remove the gnu-tar requirement we no
longer need, and add `tar` as a workspace dependency for the extractor.
2025-10-08 08:59:03 -07:00
dependabot[bot]
f96250e80d build(deps): bump the cargo-crates group with 2 updates
Updates the requirements on [bindgen](https://github.com/rust-lang/rust-bindgen) and [which](https://github.com/harryfei/which-rs) to permit the latest version.

Updates `bindgen` to 0.71.1
- [Release notes](https://github.com/rust-lang/rust-bindgen/releases)
- [Changelog](https://github.com/rust-lang/rust-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/rust-bindgen/compare/v0.71.0...v0.71.1)

Updates `which` to 7.0.3
- [Release notes](https://github.com/harryfei/which-rs/releases)
- [Changelog](https://github.com/harryfei/which-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/harryfei/which-rs/compare/7.0.0...7.0.3)

---
updated-dependencies:
- dependency-name: bindgen
  dependency-version: 0.71.1
  dependency-type: direct:production
  dependency-group: cargo-crates
- dependency-name: which
  dependency-version: 7.0.3
  dependency-type: direct:production
  dependency-group: cargo-crates
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-09 10:11:33 -04:00
Tamir Duberstein
680402be0c Revert "ci: download gen_init_cpio with authentication"
This removes octorust which takes absolutely ages to compile and also
requires native TLS libraries which in turn require a C toolchain. The
latter is a pain when cross compiling from macOS.

This reverts commit cc2da4a2a4.
2025-04-08 07:59:35 -04:00
Dave Tucker
abe5f743a3 feat: Refactor init into test-distro
The init module contains a small init system for running our integration
tests against a kernel. While we don't need a full-blown linux distro,
we do need some utilities.

Once such utility is `modprobe` which allows us to load kernel modules.
Rather than create a new module for this utility, I've instead
refactored `init` into `test-distro` which is a module that contains
multiple binaries.

The xtask code has been adjusted to ensure these binaries are inserted
into the correct places in our cpio archive, as well as bringing in the
kernel modules.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2025-03-19 19:11:15 +00:00
Tamir Duberstein
49a828ec56 taplo: reorder-keys
Group non-workspace keys before workspace ones for readability.
2025-03-17 11:38:09 -04:00
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.
2025-03-06 14:46:03 -05:00
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.
2025-03-04 10:43:56 -05:00
Tamir Duberstein
cc2da4a2a4 ci: download gen_init_cpio with authentication
The raw endpoint[0] now[1] seems to return HTTP 429 on the first request
and unauthenticated API limits are exceeded after one request (so one of
ubuntu/macos builders fails). Hopefully this works with authentication.

Link: https://raw.githubusercontent.com/torvalds/linux/refs/heads/master/usr/gen_init_cpio.c [0]
Link: https://github.com/orgs/community/discussions/146957 [1]
2024-12-12 19:19:33 -05:00
Dave Tucker
13b1fc63ef chore: Don't use path deps in workspace
This moves the path dependencies back into the per-crate Cargo.toml.
It is required such that the release tooling can correctly calculate
which version constraints require changing when we perform a release.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2024-02-28 12:13:15 +00:00
Dave Tucker
b3e7ef741c chore: Use the cargo workspace package table
This allows for inheritance of common fields from the workspace root.
The following fields have been made common:

- authors
- license
- repository
- homepage
- edition

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2024-02-22 16:58:01 +00:00
Tamir Duberstein
bcbb7e08fa Cargo.toml: Remove default-features settings
These are all set to false at the root.
2023-08-08 10:40:29 -04:00
Tamir Duberstein
321bda7539 public-api: simplify and improve output 2023-07-26 18:41:43 -04:00
Dave Tucker
f833f1fc1d xtask: Add cargo-public-api
Adds cargo-public-api. This allows for public API changes to get caught
in CI, requiring new changes to be "blessed" by using:

  cargo xtask public-api --bless

When this file is changed for aya, Alessandro will need to review the PR.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2023-07-26 21:01:38 +01:00
Mike Rostecki
96fa08bd82 cargo: Define dependencies on the workspace level
This way we will avoid version mismatches and make differences in
features across our crates clearer.
2023-07-19 00:03:38 +02:00
Tamir Duberstein
e276c07f73 integration-ebpf: invalidate on bpf-linker
Extract the symlink-to-bpf-linker logic from integration-test to xtask
and use it in a new build script in integration-ebpf, causing ebpf
probes to be rebuilt when bpf-linker changes. Previously bpf-linker
changes would rebuild integration-test, but not integration-ebpf,
resulting in stale tests.

Note that this still doesn't address the possibility that a new
bpf-linker is added to the PATH ahead of the cached one. 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.
2023-07-18 16:58:27 -04:00
Tamir Duberstein
b86d42d1b0 xtask: remove assumptions from docs command
This slightly changes the site layout: crate documentation is now flat
rather than being nested under "user" and  "bpf".

- Run `cargo clean --doc` before generating docs to ensure hermiticity.
- Generate header.html into a temporary directory.
- Remove "site" on each run to ensure hermiticity.
- Invoke cargo only once.
- Avoid editing sources.
2023-07-13 15:03:51 -04:00
Tamir Duberstein
b0a4ab5f20 xtask: Standardize command logging
Don't run `cargo build --verbose`; it's too noisy.
2023-07-10 15:25:28 -04:00
Tamir Duberstein
9ca0af1a79 integration-test: Remove integration-test-macros
This doesn't add any value; use `cargo build --tests` with
`--message-format=json` instead; parse the output using `cargo_metadata`
to discover the location of the test binary.

Move test/integration-test/src/tests -> test/integration-test/tests to
conform to
https://doc.rust-lang.org/book/ch11-03-test-organization.html#integration-tests.
2023-07-07 16:48:12 -04:00
Tamir Duberstein
5a2906a6c9 test,xtask: Replace lazy_static with OnceCell
This doesn't affect MSRV because this is testing code.
2023-07-07 11:18:22 -04:00
dependabot[bot]
45072c0789 build(deps): update syn requirement from 1.0 to 2.0
Updates the requirements on [syn](https://github.com/dtolnay/syn) to permit the latest version.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.0...2.0.3)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-01 12:23:45 +01:00
dependabot[bot]
912ee06f39 build(deps): update indoc requirement from 1.0 to 2.0
Updates the requirements on [indoc](https://github.com/dtolnay/indoc) to permit the latest version.
- [Release notes](https://github.com/dtolnay/indoc/releases)
- [Commits](https://github.com/dtolnay/indoc/compare/1.0.0...2.0.0)

---
updated-dependencies:
- dependency-name: indoc
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-30 13:05:14 +00:00
Dmitry Savintsev
22340764a3 upgrade clap to 4.x 2022-12-05 16:53:14 +01:00
Alessandro Decina
832bdd280c {{crate_name}}: release version 0.1.13 2022-11-16 17:05:07 +11:00
Dave Tucker
ec2bd69053 cargo: Remove unused dependencies
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2022-10-05 22:02:51 +00:00
Dave Tucker
aaa20cc1fd aya-gen: Rename to aya-tool
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2022-08-31 16:57:10 +00:00
Michal Rostecki
944d6b8a16 Change from Rust edition 2018 to 2021
Rust 2021 adds more core prelude imports, including `TryFrom` and
`TryInto`.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2022-08-27 21:14:47 +01:00
Dave Tucker
79101e748a test: Replace RTF with Rust
This commit replaces the existing RTF test runner with a simple rust
binary package called - integration-test.

integration-test depends on integration-ebpf, which contains test eBPF
code written in Rust and C. `cargo xtask build-integration-test-ebpf`
can be used to build this code and supress rust-analyzer warnings. It
does require `bpf-linker`, but that is highly likely to be available to
developers of Aya. It also requires a checkout of `libbpf` to extract
headers like bpf-helpers.h.

Since everything is compiled into a single binary, it can be run
be run locally using `cargo xtask integration-test` or remotely using
`./run.sh` which re-uses the bash script from the old test framework
to spawn a VM in which to run the tests.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2022-07-03 14:33:24 +01:00
Dave Tucker
67951cd2d7 xtask: Fix docs generation
Publish user/kernel space docs seperately.
Add an index.html at the root for navigation.
Ensure that search engines don't index these pages.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2022-06-13 18:00:29 +01:00
Davide Bertola
cda9ab4f66 upgrade from structopt to clap 3 2022-06-07 09:59:21 +01:00
Alessandro Decina
16975e87d8 xtask: rework code generator for bpf helpers 2021-03-02 08:49:44 +00:00
Alessandro Decina
7ae3ddf2fa xtask: use aya-gen to generate the getters 2021-03-02 08:49:44 +00:00
Alessandro Decina
1bb3846071 xtask: fix getters source order
Generate getters in the same order as the fields they access. Avoids git
noise and makes for better docs.
2021-03-02 08:49:44 +00:00
Alessandro Decina
dc15c978f5 aya-bpf: generate bpf_probe_read getters for kernel types 2021-03-02 08:49:44 +00:00
Alessandro Decina
cdf960aaa1 bpf: initial bpf bindings 2021-03-02 08:49:44 +00:00