Commit Graph

1777 Commits (c44f8b0f5bddd820a4a98cff293126c0146b827a)
 

Author SHA1 Message Date
Tamir Duberstein 5691829fcf
Merge pull request #786 from aya-rs/no-sleep
integration-test: remove all sleeps
1 year ago
dependabot[bot] 9686092280
build(deps): update bindgen requirement from 0.66 to 0.68
Updates the requirements on [bindgen](https://github.com/rust-lang/rust-bindgen) to permit the latest version.
- [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.66.0...v0.66.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
1 year ago
Tamir Duberstein 0a144a0e69
integration-test: remove all sleeps 1 year ago
Andrew Stoycos 80d187d66d
Merge pull request #785 from astoycos/fix-ci
aya/ci: fixup broken debian kernel image url
1 year ago
astoycos 81f634abc6 aya/ci: fixup broken debian kernel image url
Signed-off-by: astoycos <astoycos@redhat.com>
1 year ago
Tamir Duberstein f0f09ac16e
Merge pull request #781 from aya-rs/build-badge
README: fix build badge
1 year ago
Tamir Duberstein 1aa1dc53db
README: fix build badge
Make it a link while I'm here.
1 year ago
Tamir Duberstein 92d3056db3
Merge pull request #775 from aya-rs/perf-as-raw-fd
async_perf_event_array: access inner through async
1 year ago
dependabot[bot] 18c7235dba
Merge pull request #780 from aya-rs/dependabot/github_actions/actions/checkout-4 1 year ago
dependabot[bot] 385b04c12b
build(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [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/v3...v4)

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

Signed-off-by: dependabot[bot] <support@github.com>
1 year ago
ajwerner 8d3fc49d68
Merge pull request #774 from ajwerner/try_from_LruHash
aya/maps: allow constructing HashMaps from LruHashMap
1 year ago
Andrew Werner 172859c66b aya/maps: support TryFrom for LRU hash maps
The macro to implement TryFrom for MapData didn't have the ability to
specify that more than one variant of MapData can be valid for a single
map implementation. Support for new syntax was added to the macro so that
the implementation can succeed for both valid variants in the HashMap
and PerCpuHashMap impl.

Fixes #636
1 year ago
ajwerner 792f467d40
Merge pull request #777 from ajwerner/ajwerner/TryFrom-macros
aya/maps: rework TryFrom macros
1 year ago
Andrew Werner 2a1bf609b2 aya/maps: rework TryFrom macros
The old macros were repetitive and inflexible. This unifies the various
macros used to generate TryFrom implementations for map implementations
from the relevant map enum variants.

Cleanup in anticipation of fixing #636.

The API changes are just about renaming the return to Self and
Self::Error; they are not real changes.
1 year ago
Tamir Duberstein 8b0c7f1204
async_perf_event_array: access inner through async
Avoid holding onto raw file descriptors.

Remove some implied bounds (BorrowMut implies Borrow).
1 year ago
Tamir Duberstein 8668436787
Merge pull request #772 from aya-rs/link-owned
programs: ProgAttachLink and LircLink hold owned FDs
1 year ago
Tamir Duberstein c4d1d1086a
Merge pull request #771 from aya-rs/xdp-raw
netlink: use OwnedFd
1 year ago
Tamir Duberstein 204d02022a
programs: ProgAttachLink and LircLink hold owned FDs
Updates #612.
1 year ago
Tamir Duberstein cee0265b52
netlink: use OwnedFd
Updates #612.
1 year ago
Tamir Duberstein c4643b395f
Merge pull request #723 from nrxus/map-program-owned-fd
File descriptor safety for program fd + prog attaching
1 year ago
Andrés Medina 6895b1e2ed
aya: Use AsFd when attaching fds to programs
This is a breaking change but adds another level of safety to ensure
the file descriptor we receive is valid. Additionally, this allows
aya to internally easily duplicate this file descriptor using std
library methods instead of manually calling `dup` which doesn't
duplicate with the CLOSE_ON_EXEC flag that is standard pratice to
avoid leaking the file descriptor when exec'ing.
1 year ago
Andrés Medina d2e74e562d
aya: Use BorrowedFd when using the program fd in sys/bpf.rs
This commit reveals but does not address a file descriptor leak in
LircLink2::query. This function returns a list of `LircLink`s where
each of them have a program file descriptor that is not going to be
closed. This commit does not add this leak; it merely makes it louder
in the code.
1 year ago
dependabot[bot] 4567c351fe
Merge pull request #768 from aya-rs/dependabot/cargo/nix-0.27.0 1 year ago
dependabot[bot] a38dc057b4
build(deps): update nix requirement from 0.26.2 to 0.27.0
Updates the requirements on [nix](https://github.com/nix-rust/nix) to permit the latest version.
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.26.2...v0.26.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
1 year ago
Tamir Duberstein e9690df834
Merge pull request #766 from aya-rs/obj-better-sense
aya-obj: reduce indirection in section parsing
1 year ago
Tamir Duberstein c139627f8f aya-obj: reduce indirection in section parsing
Remove repetition of permitted cgroup attach types. Make optionality of
name more explicit rather than pretending both kind and name are equal
to section.
1 year ago
Tamir Duberstein 116ddbd18d
Merge pull request #767 from aya-rs/fix-ci-again
github: fix CI
1 year ago
Tamir Duberstein 7803db22a0
github: remove symlinks to apple-provided python
See https://github.com/actions/setup-python/issues/577.
1 year ago
Tamir Duberstein f988e97b5f
Upgrade public-api
This fixes `cargo xtask public-api` by picking up
https://github.com/aDotInTheVoid/rustdoc-types/commit/577a774c2433beda6.
1 year ago
Tamir Duberstein 782eb85d4a
xtask: extract `Errors` type
This produces better errors in `cargo xtask public-api` because before
this change we'd print errors as display, which didn't show context.

Before:
```
Error: public API errors:
aya failed to check public API: public_api::Builder::build
aya-obj failed to check public API: public_api::Builder::build
aya-log failed to check public API: public_api::Builder::build
aya-log-common failed to check public API: public_api::Builder::build
aya-log-parser failed to check public API: public_api::Builder::build
aya-tool failed to check public API: public_api::Builder::build
aya-bpf failed to check public API: public_api::Builder::build
aya-bpf-bindings failed to check public API: public_api::Builder::build
aya-bpf-cty failed to check public API: public_api::Builder::build
aya-bpf-macros failed to check public API: public_api::Builder::build
aya-log-ebpf-macros failed to check public API: public_api::Builder::build
```

After:
```
Error: aya failed to check public API

Caused by:
    0: public_api::Builder::build
    1: unknown variant `type_alias`, expected one of `module`, `extern_crate`, `import`, `struct`, `struct_field`, `union`, `enum`, `variant`, `function`, `typedef`, `opaque_ty`, `constant`, `trait`, `trait_alias`, `impl`, `static`, `foreign_type`, `macro`, `proc_attribute`, `proc_derive`, `assoc_const`, `assoc_type`, `primitive`, `keyword` at line 1 column 3082463
aya-obj failed to check public API

Caused by:
    0: public_api::Builder::build
    1: unknown variant `type_alias`, expected one of `module`, `extern_crate`, `import`, `union`, `struct`, `struct_field`, `enum`, `variant`, `function`, `trait`, `trait_alias`, `impl`, `typedef`, `opaque_ty`, `constant`, `static`, `foreign_type`, `macro`, `proc_macro`, `primitive`, `assoc_const`, `assoc_type` at line 1 column 129355
aya-log failed to check public API

Caused by:
    0: public_api::Builder::build
    1: unknown variant `type_alias`, expected one of `module`, `extern_crate`, `import`, `struct`, `struct_field`, `union`, `enum`, `variant`, `function`, `typedef`, `opaque_ty`, `constant`, `trait`, `trait_alias`, `impl`, `static`, `foreign_type`, `macro`, `proc_attribute`, `proc_derive`, `assoc_const`, `assoc_type`, `primitive`, `keyword` at line 1 column 311910
aya-log-common failed to check public API

Caused by:
    0: public_api::Builder::build
    1: unknown variant `type_alias`, expected one of `module`, `extern_crate`, `import`, `union`, `struct`, `struct_field`, `enum`, `variant`, `function`, `trait`, `trait_alias`, `impl`, `typedef`, `opaque_ty`, `constant`, `static`, `foreign_type`, `macro`, `proc_macro`, `primitive`, `assoc_const`, `assoc_type` at line 1 column 130456
aya-log-parser failed to check public API

Caused by:
    0: public_api::Builder::build
    1: unknown variant `type_alias`, expected one of `module`, `extern_crate`, `import`, `struct`, `struct_field`, `union`, `enum`, `variant`, `function`, `typedef`, `opaque_ty`, `constant`, `trait`, `trait_alias`, `impl`, `static`, `foreign_type`, `macro`, `proc_attribute`, `proc_derive`, `assoc_const`, `assoc_type`, `primitive`, `keyword` at line 1 column 204930
aya-tool failed to check public API

Caused by:
    0: public_api::Builder::build
    1: unknown variant `type_alias`, expected one of `module`, `extern_crate`, `import`, `struct`, `struct_field`, `union`, `enum`, `variant`, `function`, `typedef`, `opaque_ty`, `constant`, `trait`, `trait_alias`, `impl`, `static`, `foreign_type`, `macro`, `proc_attribute`, `proc_derive`, `assoc_const`, `assoc_type`, `primitive`, `keyword` at line 1 column 234519
aya-bpf failed to check public API

Caused by:
    0: public_api::Builder::build
    1: unknown variant `type_alias`, expected one of `module`, `extern_crate`, `import`, `struct`, `struct_field`, `union`, `enum`, `variant`, `function`, `typedef`, `opaque_ty`, `constant`, `trait`, `trait_alias`, `impl`, `static`, `foreign_type`, `macro`, `proc_attribute`, `proc_derive`, `assoc_const`, `assoc_type`, `primitive`, `keyword` at line 1 column 741697
aya-bpf-bindings failed to check public API

Caused by:
    0: public_api::Builder::build
    1: unknown variant `type_alias`, expected one of `module`, `extern_crate`, `import`, `union`, `struct`, `struct_field`, `enum`, `variant`, `function`, `trait`, `trait_alias`, `impl`, `typedef`, `opaque_ty`, `constant`, `static`, `foreign_type`, `macro`, `proc_macro`, `primitive`, `assoc_const`, `assoc_type` at line 1 column 112445
aya-bpf-cty failed to check public API

Caused by:
    0: public_api::Builder::build
    1: unknown variant `type_alias`, expected one of `module`, `extern_crate`, `import`, `union`, `struct`, `struct_field`, `enum`, `variant`, `function`, `trait`, `trait_alias`, `impl`, `typedef`, `opaque_ty`, `constant`, `static`, `foreign_type`, `macro`, `proc_macro`, `primitive`, `assoc_const`, `assoc_type` at line 1 column 315
aya-bpf-macros failed to check public API

Caused by:
    0: public_api::Builder::build
    1: unknown variant `type_alias`, expected one of `module`, `extern_crate`, `import`, `struct`, `struct_field`, `union`, `enum`, `variant`, `function`, `typedef`, `opaque_ty`, `constant`, `trait`, `trait_alias`, `impl`, `static`, `foreign_type`, `macro`, `proc_attribute`, `proc_derive`, `assoc_const`, `assoc_type`, `primitive`, `keyword` at line 1 column 186226
aya-log-ebpf-macros failed to check public API

Caused by:
    0: public_api::Builder::build
    1: unknown variant `type_alias`, expected one of `module`, `extern_crate`, `import`, `struct`, `struct_field`, `union`, `enum`, `variant`, `function`, `typedef`, `opaque_ty`, `constant`, `trait`, `trait_alias`, `impl`, `static`, `foreign_type`, `macro`, `proc_attribute`, `proc_derive`, `assoc_const`, `assoc_type`, `primitive`, `keyword` at line 1 column 158055
```
1 year ago
Tamir Duberstein c0bc1866d8
github: update 6.4.0 URLs
Seems the previous spin was pulled.
1 year ago
Tamir Duberstein 461c2759c5
Merge pull request #765 from aya-rs/more-utf8-fixes
aya: support non-UTF8 probing
1 year ago
Tamir Duberstein 1ccfdbc175
aya: support non-UTF8 probing
Fixes #751.
1 year ago
Tamir Duberstein 8ffd9bb236
Merge pull request #742 from aya-rs/avoid-utf-assumption
maps,programs: avoid path UTF-8 assumptions
1 year ago
Tamir Duberstein 0bba9b14b0
maps,programs: avoid path UTF-8 assumptions 1 year ago
Tamir Duberstein 572d047e37
test: avoid lossy string conversions
We can be strict in tests.
1 year ago
Tamir Duberstein ff8c124770
Merge pull request #763 from aya-rs/lints
aya: deny various allow-by-default lints
1 year ago
Tamir Duberstein fb00fa13f3
Merge pull request #762 from aya-rs/remove-workaround
integration-test: Remove cargo symlink workaround
1 year ago
Tamir Duberstein ca2e43d318
integration-test: Remove cargo symlink workaround
https://github.com/rust-lang/cargo/pull/12369 fixed this bug and was
picked up in https://github.com/rust-lang/rust/pull/114027.
1 year ago
Tamir Duberstein abda239d63
aya: deny various allow-by-default lints
Notably:
- clippy::use_self: replaced many T with Self.
- single_use_lifetimes: removed some single use lifetimes.
- unreachable_pub: removed some unreachable pub items.
- unused_crate_dependencies: removed unused futures,parking_lot deps.
- unused_qualifications: found a potential `crate` vs `$crate` bug.
- let_underscore_drop: not enabled, seems to trigger false positives.
- missing_copy_implementations: not enabled, unclear if we want this.
- unsafe_op_in_unsafe_fn: not enabled, unclear if we want this.
- unused_results: not enabled, needs many fixes (but I think wanted).
1 year ago
vadorovsky 1fa1241ccb
Merge pull request #764 from aya-rs/fix-docs
aya: fix docs build
1 year ago
Tamir Duberstein b91d90d6b9
github: build qemu from source if bad signature
See https://github.com/Homebrew/homebrew-core/issues/140244.
1 year ago
Tamir Duberstein 9ff1bf3d3b
aya: fix docs build
Appease the new lint rustdoc::redundant_explicit_links that was added in
https://github.com/rust-lang/rust/pull/113167.
1 year ago
Tamir Duberstein 47a09a4ec9
Merge pull request #761 from aya-rs/mac-broken-qemu
Fix macOS CI
1 year ago
Tamir Duberstein 756e6b979a
github: brew reinstall qemu
See https://github.com/Homebrew/homebrew-core/pull/139492.
1 year ago
Tamir Duberstein 9ba0b04207
github: use gnubin rather than bespoke symlinks 1 year ago
Tamir Duberstein 1d5f764d07
Merge pull request #758 from aya-rs/map-fd-not-option
aya: MapData::fd is non-optional
1 year ago
Tamir Duberstein a31544b6e7
maps: BloomFilter::insert takes &mut self
This is consistent with all the other maps.
1 year ago
Tamir Duberstein 89bc255f1d
aya: MapData::fd is non-optional
The primary driver of change here is that `MapData::create` is now a
factory function that returns `Result<Self, _>` rather than mutating
`&mut self`. The remaining changes are consequences of that change, the
most notable of which is the removal of several errors which are no
longer possible.
1 year ago
Tamir Duberstein c7b5cd5eb5
Merge pull request #757 from aya-rs/attach-fd-owned
programs: `ProgramData::attach_prog_fd` is owned
1 year ago