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

seccomp_export_bpf_mem #217

Merged
merged 1 commit into from
Jul 15, 2023
Merged

Conversation

rusty-snake
Copy link
Member

@rusty-snake rusty-snake commented Jun 28, 2023

Fixes #121

ToDo:

  • Where should the cfg go? The function, Separated impl, Separated impl in new module.

@rusty-snake rusty-snake added the enhancement New feature or request label Jun 28, 2023
@rusty-snake rusty-snake self-assigned this Jun 28, 2023
@rusty-snake
Copy link
Member Author

I'm going to prefer separate impl-blocks for new functions.

impl Scmp {
    // >=2.5.0 (min supported by us)
}
#[cfg(libseccomp_2_6_0)]
impl Scmp {
    // >=2.6.0
}

@rusty-snake rusty-snake force-pushed the export_bpf_mem branch 2 times, most recently from 2594d18 to 68c2456 Compare July 9, 2023 12:51
@ManaSugi
Copy link
Member

ManaSugi commented Jul 9, 2023

I'm going to prefer separate impl-blocks for new functions.

impl Scmp {
    // >=2.5.0 (min supported by us)
}
#[cfg(libseccomp_2_6_0)]
impl Scmp {
    // >=2.6.0
}

Looks good! Considering adding new apis in the future, it makes sense.

@rusty-snake rusty-snake added this to the 0.4.0 milestone Jul 9, 2023
@rusty-snake rusty-snake force-pushed the export_bpf_mem branch 2 times, most recently from c5cf6e6 to 62b49ee Compare July 9, 2023 16:24
@ManaSugi ManaSugi mentioned this pull request Jul 10, 2023
@rusty-snake rusty-snake force-pushed the export_bpf_mem branch 2 times, most recently from 1fdde26 to 3a7b79f Compare July 13, 2023 15:03
@codecov-commenter
Copy link

codecov-commenter commented Jul 13, 2023

Codecov Report

Merging #217 (8e84bb4) into main (2f8c65d) will increase coverage by 0.02%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main     #217      +/-   ##
==========================================
+ Coverage   98.24%   98.26%   +0.02%     
==========================================
  Files          13       13              
  Lines        1195     1211      +16     
==========================================
+ Hits         1174     1190      +16     
  Misses         21       21              
Impacted Files Coverage Δ
libseccomp/src/filter_context.rs 97.76% <100.00%> (+0.21%) ⬆️

Signed-off-by: rusty-snake <41237666+rusty-snake@users.noreply.github.com>
@rusty-snake rusty-snake marked this pull request as ready for review July 15, 2023 12:24
@rusty-snake
Copy link
Member Author

CI seems to pass now.

Release reminder: Check the cfged section on docs.rs.

@ManaSugi
Copy link
Member

ManaSugi commented Jul 15, 2023

@rusty-snake

Is this necessary?
not(doctest)

Without the attribute, I can pass the all tests on my environment (libseccomp v2.5.4)

@ManaSugi
Copy link
Member

ManaSugi commented Jul 15, 2023

Oops, the test failed, Sorry

@rusty-snake
Copy link
Member Author

rusty-snake commented Jul 15, 2023

FTR

libseccomp_v2_6 or (doc and not doctest)

We want to include the impl block if

  • compiling against libseccomp>=2.6
  • testing against libseccomp>=2.6
  • generating documentations (for docs.rs)
  • but not if we run doctests with libseccomp<2.6

Copy link
Member

@ManaSugi ManaSugi left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @rusty-snake !

@ManaSugi ManaSugi merged commit 27db06b into libseccomp-rs:main Jul 15, 2023
26 checks passed
@rusty-snake rusty-snake deleted the export_bpf_mem branch July 15, 2023 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

seccomp_export_bpf_mem
3 participants