Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aya-log: Move the Pod implementations from aya-log-common to aya-log #591

Merged
merged 1 commit into from
Apr 27, 2023

Conversation

vadorovsky
Copy link
Member

Keeping the Pod implementations and optional dependency on aya in aya-log-common breaks the clippy checks (which are made on the entire workspace).

The reason is that when different crates inside the workspace have the same dependency with different features, that dependency is built only once with the sum of features needed by all crates. It's not being built separately with different feature sets.

That's why, before this change, aya-log-common was built once for the entire workspace with userspace feature enabled. That made importing aya-log-ebpf inside integration-ebpf impossible. The aya-log-common build, with userspace feature enabled, was pulling std as a dependency. Therefore, importing aya-log-ebpf inside integration-ebpf resulted in including std and errors like:

error[E0152]: found duplicate lang item `panic_impl`
  --> test/integration-ebpf/src/log.rs:23:1
   |
23 | fn panic(_info: &core::panic::PanicInfo) -> ! {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: the lang item is first defined in crate `std` (which `aya` depends on)

This change fixes the problem by removing the userspace feature from aya-log-common and moving the Pod implementations to aya-log.

@netlify
Copy link

netlify bot commented Apr 27, 2023

Deploy Preview for aya-rs-docs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 5603d72
🔍 Latest deploy log https://app.netlify.com/sites/aya-rs-docs/deploys/644a6b88ef211c0008b4af03
😎 Deploy Preview https://deploy-preview-591--aya-rs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

aya-log/src/lib.rs Outdated Show resolved Hide resolved
Keeping the `Pod` implementations and optional dependency on aya in
aya-log-common breaks the clippy checks (which are made on the entire
workspace).

The reason is that when different crates inside the workspace have the
same dependency with different features, that dependency is built only
once with the sum of features needed by all crates. It's **not** being
built separately with different feature sets.

That's why, before this change, aya-log-common was built once for the
entire workspace with `userspace` feature enabled. That made importing
aya-log-ebpf inside integration-ebpf impossible. The aya-log-common
build, with `userspace` feature enabled, was pulling std as a
dependency. Therefore, importing aya-log-ebpf inside integration-ebpf
resulted in including std and errors like:

```
error[E0152]: found duplicate lang item `panic_impl`
  --> test/integration-ebpf/src/log.rs:23:1
   |
23 | fn panic(_info: &core::panic::PanicInfo) -> ! {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: the lang item is first defined in crate `std` (which `aya` depends on)
```

This change fixes the problem by removing the `userspace` feature from
aya-log-common and moving the `Pod` implementations to aya-log.
@alessandrod alessandrod merged commit 3d3ce8b into aya-rs:main Apr 27, 2023
@vadorovsky vadorovsky deleted the aya-log-impl-pod branch April 27, 2023 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants