All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Use the cargo workspace package table This allows for inheritance of common fields from the workspace root. The following fields have been made common:
Option<NonZeroUsize>
is guaranteed to have the same size as usize
,
which is not guarnateed for Result
. This is a minor optimization, but
also results in simpler code.
avoid requiring Copy Before this change:
error[E0382]: use of moved value: `no_copy`
--> test/integration-ebpf/src/log.rs:35:9
|
33 | let no_copy = NoCopy {};
| ------- move occurs because `no_copy` has type `NoCopy`, which does not implement the `Copy` trait
34 |
35 | debug!(&ctx, "{:x}", no_copy.consume());
| ^^^^^^^^^^^^^^^^^^^^^-------^---------^
| | | |
| | | `no_copy` moved due to this method call
| | use occurs due to use in closure
| value used here after move
|
note: `NoCopy::consume` takes ownership of the receiver `self`, which moves `no_copy`
--> test/integration-ebpf/src/log.rs:28:24
|
28 | fn consume(self) -> u64 {
| ^^^^
= note: this error originates in the macro `debug` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0382`.
error: could not compile `integration-ebpf` (bin "log") due to previous error
fix compile errors
aya-log-ebpf-macros was failing to compile because it was referencing
a couple of DisplayHint
variants that no longer exist. These were
removed in #599.
``
Compiling aya-log-ebpf-macros v0.1.0 (/home/robert/aya/aya-log-ebpf-macros)
error[E0599]: no variant or associated item named
Ipv4found for enum
DisplayHintin the current scope
--> aya-log-ebpf-macros/src/expand.rs:93:22
|
93 | DisplayHint::Ipv4 => parse_str("::aya_log_ebpf::macro_support::check_impl_ipv4"),
| ^^^^ variant or associated item not found in
DisplayHint`
:i
token
Having separate format hints and tokens per IP address family is
unnecessary, since they are represented by different types and we handle
format hints for each type separately. So we can just have one format
hint.
Also, we should be consistent with the format strings grammar in
Rust[0]. The type
token, which is mapped to formatting traits, usually
consists of one letter1. It shouldn't consist of multiple letters. Our
:ipv4
and :ipv6
tokens were clearly breaking that convention, so we
should rather switch to something with one letter - hence :i
.
[0] https://doc.rust-lang.org/std/fmt/#syntax [1] https://doc.rust-lang.org/std/fmt/#formatting-traits
write
method could be selected.updated-dependencies:
{:mac}
(for lower-case hex representation) and {:MAC}
(for
upper-case hex representation) format hints for the [u8; 6]
type,
which is the standard one in Linux to store physical addresses in.
Tested with: https://github.com/vadorovsky/aya-examples/tree/main/xdp-mac
Add display hints This change adds optional display hints:
{:x}
, {:X}
- for hex representation of numbers
{:ipv4}
, {:IPv4}
- for IPv4 addresses
{:ipv6}
, {:IPv6}
- for IPv6 addresses
It also gets rid of dyn-fmt and instead comes with our own parser implementation.
Tested on: https://github.com/vadorovsky/aya-examples/tree/main/tc
04ee35d
`](https://github.com/aya-rs/aya/commit/04ee35d139
))
- Add missing changelogs ([`1d515fe
`](https://github.com/aya-rs/aya/commit/1d515fe810
))
- Release aya-log-common v0.1.14, aya-log v0.2.0 ([`c22a696
`](https://github.com/aya-rs/aya/commit/c22a6963d4
))
- Don't use path deps in workspace ([`13b1fc6
`](https://github.com/aya-rs/aya/commit/13b1fc63ef
))
- Merge pull request #882 from dave-tucker/metadata ([`0fadd69
`](https://github.com/aya-rs/aya/commit/0fadd69537
))
- Use the cargo workspace package table ([`b3e7ef7
`](https://github.com/aya-rs/aya/commit/b3e7ef741c
))
- Fix hygiene ([`2227223`](https://github.com/aya-rs/aya/commit/2227223a96
))
- Merge pull request #797 from aya-rs/rustfmt-group-imports ([`373fb7b
`](https://github.com/aya-rs/aya/commit/373fb7bf06
))
- Group_imports = "StdExternalCrate" ([`d16e607
`](https://github.com/aya-rs/aya/commit/d16e607fd4
))
- Merge pull request #735 from aya-rs/log-option-not-result ([`ecf0dd9
`](https://github.com/aya-rs/aya/commit/ecf0dd9739
))
- S/Result/Option/ ([`ca3f70b
`](https://github.com/aya-rs/aya/commit/ca3f70b16a
))
- Merge pull request #683 from aya-rs/logs-wtf ([`5ebaf5f
`](https://github.com/aya-rs/aya/commit/5ebaf5f393
))
- Refactor log macro for readability ([`b3db916
`](https://github.com/aya-rs/aya/commit/b3db9161eb
))
- Merge pull request #667 from vadorovsky/workspace-dependencies ([`f554d42
`](https://github.com/aya-rs/aya/commit/f554d42105
))
- Define dependencies on the workspace level ([`96fa08b
`](https://github.com/aya-rs/aya/commit/96fa08bd82
))
- Merge pull request #611 from probulate/check-refs-not-values ([`3f1a469
`](https://github.com/aya-rs/aya/commit/3f1a469f06
))
- Simplify argument validation ([`6feebef
`](https://github.com/aya-rs/aya/commit/6feebef9e5
))
- Avoid requiring Copy ([`de79724
`](https://github.com/aya-rs/aya/commit/de7972483b
))
- Fix compile errors ([`47a2f25
`](https://github.com/aya-rs/aya/commit/47a2f25fca
))
- Unify IP format hints into one, repsesent it by `:i` token ([`84e5e28
`](https://github.com/aya-rs/aya/commit/84e5e2894f
))
- Merge pull request #606 from Hanaasagi/check-format-in-log ([`58f1ecb
`](https://github.com/aya-rs/aya/commit/58f1ecbf00
))
- Check format and value type in proc macro ([`0970300`](https://github.com/aya-rs/aya/commit/0970300d1f
))
- Merge pull request #585 from probulate/tag-len-value ([`5165bf2
`](https://github.com/aya-rs/aya/commit/5165bf2f99
))
- Ensure WriteToBuf is used ([`4d098ef
`](https://github.com/aya-rs/aya/commit/4d098ef413
))
- Merge pull request #550 from aya-rs/dependabot/cargo/syn-2.0 ([`3ad3cb9
`](https://github.com/aya-rs/aya/commit/3ad3cb9ed8
))
- Update syn requirement from 1.0 to 2.0 ([`45072c0
`](https://github.com/aya-rs/aya/commit/45072c0789
))
- Merge pull request #456 from dmitris/uninlined_format_args ([`16b029e
`](https://github.com/aya-rs/aya/commit/16b029ed37
))
- Fix uninlined_format_args clippy issues ([`055d94f
`](https://github.com/aya-rs/aya/commit/055d94f58b
))
- Merge pull request #436 from vadorovsky/aya-log-mac-addr ([`3adb9b0
`](https://github.com/aya-rs/aya/commit/3adb9b049f
))
- Add format hints for MAC addresses ([`2223ab8
`](https://github.com/aya-rs/aya/commit/2223ab828d
))
- Fix the DisplayHint expression names ([`9a8409e
`](https://github.com/aya-rs/aya/commit/9a8409e3a2
))
- Add display hints ([`83ec27f
`](https://github.com/aya-rs/aya/commit/83ec27f06b
))
- Change from Rust edition 2018 to 2021 ([`944d6b8
`](https://github.com/aya-rs/aya/commit/944d6b8a16
))
- Merge pull request #350 from dave-tucker/monorepo ([`f37a514
`](https://github.com/aya-rs/aya/commit/f37a51433f
))
- Re-organize into a single workspace ([`dc31e11
`](https://github.com/aya-rs/aya/commit/dc31e11691
))