chore: pub(crate) internals, fat LTO, SAFETY comments, temp-env in tests#96
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
engineanderrormodules inlib.rswerepub, leaking internal implementation as public API. Changed topub(crate); all public types remain accessible via the existingpub usere-exports.ltofrom"thin"to"fat"for better cross-crate inlining; addpanic = "abort"to drop the unwinding machinery (~10% binary size reduction). Verified: nocatch_unwindusage in code or deps.// SAFETY:comment to thelibc::chowncall instaging.rs(allgeteuidcall sites already had SAFETY comments).std::env::set_var/remove_varis UB in async multi-threaded contexts (Rust 1.85+). Addtemp-env = "0.3"to dev-deps; convert 4 integration tests from#[tokio::test] async fnto#[test] fnwithtemp_env::with_varwrapping atokio::runtime::Runtime::block_on, ensuring env var isolation via temp-env's internalMutex.Test plan
cargo check— clean, no warningscargo test— all 37 unit tests passCloses #85