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

Run aya integration tests #69

Merged
merged 1 commit into from
Jul 11, 2023
Merged

Run aya integration tests #69

merged 1 commit into from
Jul 11, 2023

Conversation

tamird
Copy link
Member

@tamird tamird commented Jul 7, 2023

Fixes #65.

@tamird
Copy link
Member Author

tamird commented Jul 9, 2023

@alessandrod @ajwerner this is ready for review (see aya-rs/aya#641 for changes required to make this pass tests)

src/linker.rs Outdated
@@ -313,7 +313,7 @@ impl Linker {
in_type: Option<InputType>,
) -> Result<(), LinkerError> {
let mut data = Vec::new();
reader
let _: usize = reader
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need the type annotation here?

src/llvm/mod.rs Outdated
@@ -220,7 +220,7 @@ pub unsafe fn optimize(
}

debug!("running function passes");
LLVMInitializeFunctionPassManager(fpm);
let _modified = LLVMInitializeFunctionPassManager(fpm) != 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the advantage of doing this? the compiler isn't complaining about it, we never check it, the code seems worse to read to me after the change

src/lib.rs Outdated
@@ -1,4 +1,5 @@
#![deny(clippy::all)]
#![deny(unused_results)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, this. But why? Did you run into some LLVM stuff that's supposed to be #[must_use]? If so let's annotate that instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, this doesn't really belong in this PR specifically. It's a useful lint that avoids things like partial reads and writes which report the number of bytes and folks often forget to check; see src/linker.rs where I changed read to read_exact because the length read wasn't being checked -- this lint surfaced that.

I'll move this to another PR so we can discuss separately from this change.

@alessandrod alessandrod merged commit be43704 into main Jul 11, 2023
5 checks passed
@tamird tamird deleted the test-aya-integration branch July 11, 2023 14:48
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.

workflows: ensure bpf-linker works for aya integration tests
2 participants