Skip to content

chore: pub(crate) internals, fat LTO, SAFETY comments, temp-env in tests#96

Merged
Jaro-c merged 1 commit into
developfrom
chore/quality
Jun 10, 2026
Merged

chore: pub(crate) internals, fat LTO, SAFETY comments, temp-env in tests#96
Jaro-c merged 1 commit into
developfrom
chore/quality

Conversation

@Jaro-c

@Jaro-c Jaro-c commented Jun 10, 2026

Copy link
Copy Markdown
Member

Summary

  • API-001: engine and error modules in lib.rs were pub, leaking internal implementation as public API. Changed to pub(crate); all public types remain accessible via the existing pub use re-exports.
  • PERF-018: Switch lto from "thin" to "fat" for better cross-crate inlining; add panic = "abort" to drop the unwinding machinery (~10% binary size reduction). Verified: no catch_unwind usage in code or deps.
  • DEP-009: Add // SAFETY: comment to the libc::chown call in staging.rs (all geteuid call sites already had SAFETY comments).
  • TEST-001: std::env::set_var/remove_var is UB in async multi-threaded contexts (Rust 1.85+). Add temp-env = "0.3" to dev-deps; convert 4 integration tests from #[tokio::test] async fn to #[test] fn with temp_env::with_var wrapping a tokio::runtime::Runtime::block_on, ensuring env var isolation via temp-env's internal Mutex.

Test plan

  • cargo check — clean, no warnings
  • cargo test — all 37 unit tests pass

Closes #85

API-001: engine and error modules are internal — change to pub(crate);
all public types are still accessible via existing re-exports.

PERF-018: switch lto from "thin" to "fat" for better inlining across
crate boundaries; add panic = "abort" to drop unwinding machinery
(verified: no catch_unwind usage in code or deps).

DEP-009: add // SAFETY: comment to libc::chown call in staging.rs
(geteuid sites already had SAFETY comments).

TEST-001: std::env::set_var/remove_var is UB in async multi-thread
context (Rust 1.85+). Add temp-env 0.3 to dev-deps; convert 4
integration tests from #[tokio::test] async fn to #[test] fn with
temp_env::with_var wrapping a fresh Runtime::block_on so env var
isolation is guaranteed via temp-env's internal Mutex.

Closes #85

Signed-off-by: Jaro-c <75870284+Jaro-c@users.noreply.github.com>
@Jaro-c Jaro-c merged commit cbdce45 into develop Jun 10, 2026
5 checks passed
@Jaro-c Jaro-c deleted the chore/quality branch June 10, 2026 10:07
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.

1 participant