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

Add CONTRIBUTING.md doc #76

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Contributing

Thanks for your interest in contributing to rust-landlock!

## Testing vs kernel ABI

The Landlock functionality exposed differs between kernel versions. In order
to test all possible variations, the rust-landlock tests will run different
subsets of tests based on the landlock support in the current kernel.

In order to fully test a change, it should be verified against a range of
kernel versions. This is done by the github actions CI, but is currently
challenging to do locally. For local development, running `cargo test` will
test against your currently running kernel version, which may result in some
tests being skipped.

The kernel to test against can be overridden using the LANDLOCK_CRATE_TEST_ABI
environmental variable. For more details see the comment in
`compat.rs:current_kernel_abi()`.

For more information about Landlock ABIs see https://landlock.io/rust-landlock/landlock/enum.ABI.html
2 changes: 1 addition & 1 deletion src/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ lazy_static! {
panic!("Unknown ABI: {n}");
}
}
Err(std::env::VarError::NotPresent) => ABI::iter().last().unwrap(),
Err(std::env::VarError::NotPresent) => ABI::new_current(),
Err(e) => panic!("Failed to read LANDLOCK_CRATE_TEST_ABI: {e}"),
};
}
Expand Down