Skip to content

fix(sandbox): landlock 0.4.5 API compatibility#97

Open
Svtter wants to merge 1 commit into
lingcoder:mainfrom
Svtter:fix/landlock-0.4.5-compat
Open

fix(sandbox): landlock 0.4.5 API compatibility#97
Svtter wants to merge 1 commit into
lingcoder:mainfrom
Svtter:fix/landlock-0.4.5-compat

Conversation

@Svtter

@Svtter Svtter commented Jun 11, 2026

Copy link
Copy Markdown

Problem

crab-sandbox fails to compile with landlock = "0.4" (resolves to 0.4.5). The landlock crate made a breaking change within the 0.4.x semver range.

Closes #96

Changes

All changes in crates/sandbox/src/backend/landlock.rs:

  1. Imports: Added Access, BitFlags, RulesetCreatedAttr; removed unused RulesetHandle
  2. Return type: path_access_to_landlock now returns BitFlags<AccessFs> instead of AccessFs
  3. Removed .into() calls: from_read/from_write/from_all already return BitFlags<AccessFs>

Verification

cargo build --release -p crab-cli
# Compiles successfully, produces 34M binary

Error messages before fix

error[E0432]: unresolved import `landlock::RulesetHandle`
error[E0599]: no method named `add_rules` found (needs RulesetCreatedAttr trait)
error[E0308]: expected `AccessFs`, found `BitFlags<AccessFs, u64>`
error[E0599]: no associated function `from_all` (needs Access trait)

landlock 0.4.5 changed AccessFs methods to return BitFlags<AccessFs>
instead of AccessFs, and removed RulesetHandle. This patch updates
imports and return types to match.

Closes lingcoder#96
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.

Build failure: landlock 0.4.5 API incompatibility (BitFlags<AccessFs> migration)

1 participant