Commit Graph

1341 Commits (45df2519b60613310e8827fbb4076f60c393c3bb)
 

Author SHA1 Message Date
Dave Tucker 68174d7d73
Merge pull request #685 from aya-rs/dependabot/cargo/cargo_metadata-0.17.0
build(deps): update cargo_metadata requirement from 0.15.4 to 0.17.0
1 year ago
dependabot[bot] 4b6579e2f1
build(deps): update cargo_metadata requirement from 0.15.4 to 0.17.0
Updates the requirements on [cargo_metadata](https://github.com/oli-obk/cargo_metadata) to permit the latest version.
- [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.15.4...0.15.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
1 year ago
vadorovsky aed74d5ab3
Merge pull request #669 from aya-rs/bpf-linker-hella-warnings
integration-test: shuttle linker logs to user
1 year ago
Tamir Duberstein b3db9161eb
Refactor log macro for readability
This happens to fix the miscompilation that occurs when bpf-linker is
moved to LLVM's new pass manager. A later commit will avoid the
miscompilation more convincingly.
1 year ago
Tamir Duberstein 74fc50bf7e
integration-test: shuttle stdio to user
Trampoline cargo-in-cargo stdio through cargo:warning to ensure the user
sees all the output.

Use bpf-linker from git in CI so we can see what's going on there.
1 year ago
Dave Tucker ec5ff01e41
Merge pull request #681 from aya-rs/fix-cargo-test
test: document cargo build scripts
1 year ago
Tamir Duberstein a84bd1a95d
test: document cargo build scripts 1 year ago
Tamir Duberstein 8cec4b25f9
Revert "integration-test: add to default-members"
This reverts commit 025c76780c.

Fixes #678.
1 year ago
Dave Tucker ff11c65734
Merge pull request #680 from dave-tucker/ci-cleanup
.github: Consolidate CI workflows into one
1 year ago
Dave Tucker 3b859ba70a ci: Bump ubunutu
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
1 year ago
Dave Tucker cf0c866458 .github: Consolidate CI workflows into one
This gives a better view of the CI pipeline in Github.
Gives us control over what runs and when.
And finally, lets us check only a single status in mergify.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
1 year ago
vadorovsky f554d42105
Merge pull request #667 from vadorovsky/workspace-dependencies
cargo: Define dependencies on the workspace level
1 year ago
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.
1 year ago
Tamir Duberstein 05e782abbf
Merge pull request #677 from aya-rs/ebpf-dep-better
rebuild ebpf on bpf-linker
1 year ago
Tamir Duberstein 6fc09ca07a
integration-test: build-dep on integration-ebpf
Remove the manual dependency tracking machinery in
integration-test/build.rs in favor of a build-dependency on
integration-ebpf. This required adding an empty lib.rs to create the
library target.

This allows integration-test/build.rs to be ignorant of bpf-linker.
Remove that in favor of the logic now in integration-ebpf.
1 year ago
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.
1 year ago
Tamir Duberstein 0168396604
integration-ebpf: add cargo config
Same reasoning as the one in bpf.
1 year ago
Tamir Duberstein 025c76780c
integration-test: add to default-members
This works now that build.rs does the right thing.

Update the `miri test` command in the lint job so it has the proper
exclusions; it is now in line with the invocations in the build-test job.
1 year ago
ajwerner b28d4c34ee
Merge pull request #674 from ajwerner/use-nightly-to-build-ebpf
test/integration-test: use +nightly for ebpf
1 year ago
Andrew Werner 97eb8afeac integration-test: use nightly toolchain with ebpf
The ebpf probes require a nightly compiler. Before this change, if you
ran `cargo xtask integration-test` with a stable compiler toolchain as
default, or you ran `cargo +stable xtask integration-test`, you would
have seen an error like the one below. This is now fixed by running the
cargo build command in the integration-ebpf directory and making sure
to clear the RUSTUP_TOOLCHAIN env var.

```
  --- stderr
  /home/ajwerner/src/github.com/aya-rs/aya/test/integration-test/bpf/ring_buf_sched_tracepoint.bpf.c:18:21: warning: declaration of 'struct switch_args' will not be visible outside of this function [-Wvisibility]
  int bpf_prog(struct switch_args* ctx)
                      ^
  1 warning generated.
  error: the `-Z` flag is only accepted on the nightly channel of Cargo, but this is the `stable` channel
  See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more information about Rust release channels.
  thread 'main' panicked at '"cargo" "build" "-p" "integration-ebpf" "-Z" "build-std=core" "--release" "--message-format=json" "--target" "bpfel-unknown-none" "--target-dir" "/home/ajwerner/src/github.com/aya-rs/aya/target/debug/build/integration-test-9bbcb3db5e9f8f57/out/integration-ebpf" exited
with status code 101:
  ', test/integration-test/build.rs:219:25
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: error while building userspace application

Caused by:
    Child { stdin: None, stdout: None, stderr: None, .. } exited with status code 101:
```
1 year ago
ajwerner 54ba471b41
Merge pull request #673 from ajwerner/update-test-readme
test: update README.md
1 year ago
Dave Tucker 7ac808cf55
Merge pull request #671 from dave-tucker/misc-fixes
Clippy fixes for latest nightly
1 year ago
Andrew Werner af747f8caa test: update README.md
A checkout of libbpf is no longer required.
1 year ago
Dave Tucker 764eb309b0 Clippy fixes for latest nightly
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
1 year ago
ajwerner 78ede184bd
Merge pull request #664 from ajwerner/always-initialize-submodules
xtask: ensure libbpf submodule is initialized
1 year ago
vadorovsky 2755713cf0
Merge pull request #668 from aya-rs/invalidate-bpf-linker
integration-test: invalidate on bpf-linker
1 year ago
Tamir Duberstein 55b2010f19
integration-test: invalidate on bpf-linker
It turns out that cargo ignores rerun-if-changed directives that point
into $CARGO_HOME; use a symlink to trick cargo into respecting my
authoritah.
1 year ago
Andrew Werner d5259ce789 xtask: move libbpf submodule 1 year ago
Andrew Werner 15b3c459ae xtask: ensure libbpf submodule is initialized
Libbpf is used by xtasks, in the command, ensure that the submodules
are initialized. This eases the user-experience so that users don't
need to think about the submodule, while retaining all the benefits
of using a submodule vs forcing the user to manually check out libbpf
and stick it in some pre-defined place.

We use the symbol pointing to libbpf in xtask in the build script
to avoid repeating this constant.

Also, we install git in the vm so that we can init the submodule
when we build in the vm.
1 year ago
vadorovsky dc3b0b8730
Merge pull request #666 from aya-rs/toml-fmt
toml: add formatter and check in CI
1 year ago
Tamir Duberstein c8bf646ef0
toml: add formatter and check in CI 1 year ago
Andrew Werner 4306b222d8 .github: update codegen workflow to use submodule 1 year ago
Tamir Duberstein 893ab76afa
Merge pull request #665 from aya-rs/dead-code-rm
aya: avoid an allocation
1 year ago
Tamir Duberstein 6f2a8c8a5c
aya: avoid an allocation
str::rsplitn(2, c) is a special case that can be expressed as
str::rsplit_once(c).
1 year ago
Tamir Duberstein d71d1e1993
aya: remove dead code
This logic moved in bb595c4e69. The
mutation here prevented the compiler from noticing.
1 year ago
Tamir Duberstein af54a819a3
Merge pull request #660 from aya-rs/log-test
Make logging test output more legible
1 year ago
Tamir Duberstein 703e7108f2
Make logging test output more legible
Presently when this test fails you just get "5 items instead of 6" but
not which item was lost.
1 year ago
Tamir Duberstein bbc6a73f4b
Merge pull request #657 from aya-rs/build-rs-invalidate-deps
integration-test: better cache invalidation
1 year ago
Tamir Duberstein 232cd45e41
Merge pull request #656 from aya-rs/kernel-version-fml
Handle WSL kernel version strings
1 year ago
Tamir Duberstein 581d5c8f5f
integration-test: bust cache on bpf-linker
This is useful when iterating on bpf-linker locally, which is otherwise
an undeclared input to this build.

We could use an artifact dependency[0] here, but they are unstable and
bpf-linker requires gymnastics to build correctly (for now).

[0] https://doc.rust-lang.org/cargo/reference/unstable.html#artifact-dependencies-dependency-declarations
1 year ago
Tamir Duberstein 2a6d2a6402
integration-test: transitive dep on Rust ebpf
Emit "cargo:rerun-if-changed={}" for each transitive dependency on
integration-ebpf. In a normal world we'd just add integration-ebpf to
our build-dependencies, but cargo ignores this because integration-ebpf
has no library targets.
1 year ago
Tamir Duberstein 35ed85a87f
Handle WSL kernel version strings
Fixes #654.
1 year ago
Tamir Duberstein 961f45da37
Replace matches with assert_matches
The matches crate has been archived now that `matches!` is in std.
However `assert_matches!` is still unstable in std, and the
assert_matches crate provides a more expressive form:

```
assert_matches!(foo, Ok(bar) => {
  assert_eq!(bar, baz);
});
```
1 year ago
Tamir Duberstein b875f83f22
Remove duplicate entry 1 year ago
Tamir Duberstein 61608e6458
Merge pull request #650 from aya-rs/test-cleanup
Remove async feature; misc test cleanup
1 year ago
Alessandro Decina 0766e70548
Merge pull request #584 from marysaka/fix/btf-kern-optional
aya: Ignore embedded BTF error if not truely required
1 year ago
Tamir Duberstein 8e9712ac02
Run tests with powerset of features 1 year ago
Tamir Duberstein 6d06e2bf3a
Include ~all crates in default members
Several tests were not running due to being omitted from this list.
1 year ago
Tamir Duberstein 5407d4a9a1
Don't use env::tempdir
This can cause test pollution. Create a new temp directory on each run.
1 year ago
Tamir Duberstein fa91fb4f59
Remove "async" feature
This feature is equivalent to async_tokio || async_std; removing it
avoids warnings emitted during `cargo hack check --feature-powerset`
where async is selected without either of the other features.

Use cargo hack to ensure clippy runs on the powerset of features.
1 year ago