Make litebox_packager OCI mode work cross-platform#815
Open
Conversation
- Remove crate-level #![cfg(target_os = "linux")] gate; gate only host-mode (ldd-based dependency discovery) behind #[cfg(target_os = "linux")] - Split run() into OCI dispatch + run_host_mode() (Linux-only) - Move --include handling into host-mode only (conflicts_with oci_image) - ELF files from --include are automatically rewritten through the rewriter - Track symlinks in-memory during OCI layer extraction instead of creating OS symlinks (Windows requires admin privileges for symlinks) - Record Unix permission modes from tar headers in HashMap instead of querying filesystem metadata (Windows lacks Unix permission bits) - Add OCI platform resolver to always pull linux/amd64 images regardless of host - Add path normalization (strip ./, resolve ..) for tar entry paths - Replace backslashes with forward slashes in tar paths for Windows compatibility - Switch tar format from GNU to USTAR (required by no_std tar reader) - Add whiteout pruning for in-memory symlink and permission maps - Delete build.rs (removes rtld_audit.so injection from packager) - Remove finalize_tar's rtld_audit injection and --include handling (moved to host-mode) - Add resolve_symlink_in_rootfs for cross-platform symlink chain resolution - Add materialize_symlinks to copy files/create dirs instead of OS symlinks - Handle Bun executables as hard errors (UnsupportedExecutable) - Update scan_rootfs to accept symlink_map and permissions parameters
- Normalize relative symlink targets in resolve_in_rootfs to prevent ../ components from escaping the rootfs boundary - Gate set_preserve_permissions/set_unpack_xattrs behind #[cfg(unix)] since they are unsupported on Windows and permissions are already tracked in the HashMap from tar headers
|
🤖 SemverChecks 🤖 Click for details |
Member
Author
|
This PR is ready for review. Thanks! |
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.
This PR makes the litebox packager's OCI mode work on Windows (and other non-Linux platforms) by removing Linux-specific assumptions from the OCI code path. Host mode (ldd-based dependency discovery) remains Linux-only.