Commit Graph

189 Commits

Author SHA1 Message Date
Tamir Duberstein
519abffef7 ci: bump bpf-linker llvm to 22 2026-01-31 06:30:33 -05:00
Tamir Duberstein
d10ed519c3 xtask: move libbpf-sys hacks to Rust
This restores my ability to run integration tests locally.

Replace `clippy.sh` with `cargo xtask clippy`.
2026-01-28 21:08:01 -05:00
vad
ab109e489c ci: Cancel stale PR runs automatically
Add a workflow-level concurrency group so PR workflows share a
`<workflow>-pr-<number>` group and GitHub cancels any in-progress run
when a new push arrives. Non-PR events fall back to the ref name, which
keeps push/cron runs isolated while still preventing multiple runs per
ref from piling up.
2026-01-28 20:03:49 +00:00
root
5cfe609872 integration-test: add btf_maps libbpf compatibility tests
Add integration tests to verify that btf_maps generated with the
generalized btf_map_def macro are compatible with libbpf's bpf_map_def.

Also add CI infrastructure for macOS cross-compilation to Linux musl,
including stub headers and autoconf cache variables for libbpf-sys
vendored dependencies.
2026-01-27 14:49:22 +00:00
dependabot[bot]
0780eef640 build(deps): bump the github-actions group with 3 updates
Bumps the github-actions group with 3 updates: [DavidAnson/markdownlint-cli2-action](https://github.com/davidanson/markdownlint-cli2-action), [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) and [actions/cache](https://github.com/actions/cache).


Updates `DavidAnson/markdownlint-cli2-action` from 21 to 22
- [Release notes](https://github.com/davidanson/markdownlint-cli2-action/releases)
- [Commits](https://github.com/davidanson/markdownlint-cli2-action/compare/v21...v22)

Updates `peter-evans/create-pull-request` from 7 to 8
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v7...v8)

Updates `actions/cache` from 4 to 5
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

---
updated-dependencies:
- dependency-name: DavidAnson/markdownlint-cli2-action
  dependency-version: '22'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: peter-evans/create-pull-request
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-16 11:15:51 +01:00
Michal R
800f9f9fea ci/lint: Do not install stable toolchain
We run clippy and miri only with nightly.
2025-12-09 16:34:09 +04:00
Michal R
ab187058d8 ci: Enable llvm-link-static feature for bpf-linker
Rust CI does not provide dynamic libLLVM tarballs for macOS—only static
ones. Since recent versions of bpf-linker require explicit linkage
configuration for libLLVM, enable the `llvm-link-static` feature to
ensure correct static linking.

Make sure bpf-linker's build.rs sees the downloaded LLVM by adding it
to PATH. On macOS, set the `{CXXSTDLIB,ZLIB}_PATH` variables to point
to the brew prefixes with static libraries it needs.

Given that now we link statically all libLLVM's dependencies and macOS
provides only dynamic zlib, we need to install static zlib from brew.
2025-12-09 16:34:09 +04:00
dependabot[bot]
fc2320bb5d build(deps): bump actions/checkout in the github-actions group
Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 5 to 6
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-24 08:27:31 -05:00
dependabot[bot]
75cd7e835f build(deps): bump DavidAnson/markdownlint-cli2-action
Bumps the github-actions group with 1 update: [DavidAnson/markdownlint-cli2-action](https://github.com/davidanson/markdownlint-cli2-action).


Updates `DavidAnson/markdownlint-cli2-action` from 20 to 21
- [Release notes](https://github.com/davidanson/markdownlint-cli2-action/releases)
- [Commits](https://github.com/davidanson/markdownlint-cli2-action/compare/v20...v21)

---
updated-dependencies:
- dependency-name: DavidAnson/markdownlint-cli2-action
  dependency-version: '21'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-17 09:24:21 -05:00
Tamir Duberstein
7a8ad146f4 Add macos-latest
There's no way to get hardware acceleration on arm64 at all, so let's at
least make sure our stuff keeps working on macOS.
2025-11-13 11:29:15 -05:00
Tamir Duberstein
2a33c642de .github: remove push-to-fork
We need to create the fork first.
2025-11-11 09:58:20 -05:00
Tamir Duberstein
62a92af00e .github: restrict permissions 2025-11-11 09:57:49 -05:00
Tamir Duberstein
b21284f36b .github: move permissions to workflow root 2025-11-11 09:52:52 -05:00
Tamir Duberstein
a3282e1d14 .github: make minimally-authorized token
We only use this to download public repos.
2025-11-11 09:22:24 -05:00
Tamir Duberstein
9518ff8ca6 .github: use alls-green 2025-11-11 09:22:24 -05:00
Tamir Duberstein
5dd6d94342 .github: update reference
The referenced issue has hundreds of automated mentions, making it quite
hard to look at.
2025-11-11 09:08:04 -05:00
Friday Ortiz
ab38afe95d perf_event: support hardware breakpoints
Implement `PerfEventConfig::Breakpoint`, allowing users to attach
hardware breakpoints. Generate `HW_BREAKPOINT_*` and `struct
bpf_perf_event_data` in support of this feature and update the type of
`PerfEventContext` accordingly.

Add a test exercising R, W, RW, and X breakpoints. Note that R
breakpoints are unsupported on x86, and this is asserted in the test.

Extend the VM integration test harness and supporting infrastructure
(e.g. `download_kernel_images.sh`) to download kernel debug packages and
mount `System.map` in initramfs. This is needed (at least) on the aarch
6.1 Debian kernel which was not compiled with `CONFIG_KALLSYMS_ALL=y`
for some reason, and the locations of globals are not available in
kallsyms. To attach breakpoints to these symbols in the test pipeline,
we need to read them from System.map and apply the KASLR offset to get
their real address. The `System.map` file is not provided in the kernel
package by default, so we need to extract it from the corresponding
debug package. The KASLR offset is computed using `gunzip` which appears
in kallsyms on all Debian kernels tested.

Co-authored-by: Tamir Duberstein <tamird@gmail.com>
2025-11-10 16:33:54 -05:00
Tamir Duberstein
fd18c3f4ab .github: shard arm64 virtualized integration
Github arm64 runners don't support nested virtualization and they broke
nested virtualization on macos-15-intel so we must go nuclear.
2025-11-10 16:33:52 -05:00
Tamir Duberstein
e2f09ac62f .github: move comments to Brewfile
This is where the dependencies are.
2025-11-10 15:47:01 -05:00
Tamir Duberstein
7288a2b8da .github: remove stale comment
GNU tar is not needed since 5f046899b5.
2025-11-10 15:47:00 -05:00
Tamir Duberstein
65865e8dfc .github: disable macos-15-intel
These builds are timing out, see
https://github.com/actions/runner-images/issues/13277.
2025-11-10 09:13:27 -05:00
Tamir Duberstein
112ab47fcd Add clippy coverage for doctests 2025-11-09 18:26:39 -05:00
Tamir Duberstein
4dc4a6ce08 .github: exercise targets for real 2025-10-29 09:00:06 -04:00
Tamir Duberstein
e5eb3058aa .github: save CI time
These jobs take 18 seconds of machine time and 21 seconds of setup;
consolidate them into one job to cut down on the overhead.
2025-10-26 07:24:45 -04:00
Godones
4b4b9f83bd enable bpf_target_arch = loongarch64
Signed-off-by: Godones <chenlinfeng25@outlook.com>
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
2025-10-24 20:01:06 -04:00
Tamir Duberstein
e3f69829de .github: run old kernels first 2025-10-17 22:16:28 -04:00
Tamir Duberstein
c7d4cd3943 ci: test against 5.10
This is the earliest LTS that still exists on debian mirrors.
2025-10-17 22:16:28 -04: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
Tamir Duberstein
d82ed60795 .cargo/config: use musl-cross on x86_64 as well
This allows us to run virtualized integration tests on macOS hosts.

Bump Ubuntu to 24.04 because we seem to be getting miscompilation on
x86_64 otherwise (when using `x86_64-linux-musl-gcc`). Add `apt install
liblzma-dev` since it doesn't seem to be present in ubuntu-24.04.
2025-10-08 08:06:26 -07:00
Tamir Duberstein
82750ae3b1 .github: attempt to enable KVM 2025-10-08 08:06:24 -07:00
Tamir Duberstein
a2324e6e50 Add Brewfile 2025-10-05 07:47:13 -04:00
Tamir Duberstein
d1fdbb9930 Update to macOS 15 (#1351) 2025-09-26 08:18:46 -04:00
Tamir Duberstein
222b2cb88f .github: avoid spurious CI failures in forks
This spams my email every day.
2025-09-06 07:04:13 -04:00
Tamir Duberstein
a01b1d8b76 .github: build bpf-linker with llvm-21 2025-08-18 11:54:53 -04:00
dependabot[bot]
9a367c11b0 build(deps): bump actions/checkout in the github-actions group
Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 4 to 5
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-11 21:32:15 -04:00
Tamir Duberstein
9996f7a300 Allow +debN kernels
Seems 6.12 is now being marked `+deb13`.
2025-08-11 16:20:33 -04:00
Tamir Duberstein
5b9d432a61 github: fix PR triggers 2025-08-03 11:13:17 -04:00
Michal Rostecki
727dfcd7ee ci: Fix bpf-linker installation (#1295)
We've recently added an xtask to bpf-linker (aya-rs/bpf-linker#282),
which resulted in multiple binary targets. Therefore, bpf-linker has
to be installed with the following command:

```
cargo install --git https://github.com/aya-rs/bpf-linker.git bpf-linker
```

The last argument (`bpf-linker`) specifies the binary target.
2025-07-15 15:22:51 +00:00
Tamir Duberstein
eda29958f8 Use CRABBY_GITHUB_TOKEN for regen PRs
See https://github.com/peter-evans/create-pull-request/issues/48.
2025-06-09 13:45:59 -04:00
dependabot[bot]
e1fa363619 build(deps): bump DavidAnson/markdownlint-cli2-action
Bumps the github-actions group with 1 update: [DavidAnson/markdownlint-cli2-action](https://github.com/davidanson/markdownlint-cli2-action).


Updates `DavidAnson/markdownlint-cli2-action` from 19 to 20
- [Release notes](https://github.com/davidanson/markdownlint-cli2-action/releases)
- [Commits](https://github.com/davidanson/markdownlint-cli2-action/compare/v19...v20)

---
updated-dependencies:
- dependency-name: DavidAnson/markdownlint-cli2-action
  dependency-version: '20'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-02 06:26:35 -04:00
Tamir Duberstein
0237e36dbe ci: test against 6.12 rather than 6.10
6.12 is an LTS kernel, while 6.10 is not. The latter has reached EOL and
no longer lives on debian mirrors.
2025-04-14 15:42:59 -04:00
Tamir Duberstein
e967d0aea2 Use nul bytes as delimiters 2025-04-08 07:59:35 -04:00
Tamir Duberstein
e692e5ffc5 Remove stale comments
Upstream isn't planning to do this.
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
0153bdd950 github: update dependabot docs link 2025-03-17 11:38:09 -04:00
Tamir Duberstein
9916092f5c codegen: tidy up
- Document the need for external rustfmt invocation.
- Remove reexports.
- Remove `write_to_file`.
- Avoid allocating strings when using bindgen to write bindings.
2025-03-04 15:59:00 -05:00
Tamir Duberstein
e16f0482f8 Revert "ci: remove cross toolchain"
Turns out this was actually being used through magic.

Remove mips since it is a tier 3 target that is only supported on
nightly and dtolnay/rust-toolchain doesn't seem to handle installing
targets without std.

Exclude xtask since it depends on `ring` which doesn't build on all
targets.

Fix compilation on armv7 which had rotted.

This reverts commit d92fc95c39.
2025-03-04 15:59:00 -05:00
Tamir Duberstein
34319cba12 ci,xtask: sort architectures 2025-03-04 15:59:00 -05:00
Tamir Duberstein
b18b4f7369 ci: use output rather than env
This appeases my IDE and removes annoying yellow squiggles.
2025-03-04 15:59:00 -05:00
Tamir Duberstein
56ebe1406e aya-tool: do not attempt to run rustfmt
This can be done externally. Do so in CI.

This is an attempt to resolve the inconsistency between CI and local
rustfmt in the generated bindings.

Restore running CI on generated branches; the presence of a PR is
apparently not enough.
2025-03-04 11:45:05 -05:00