Bump nix 0.23 -> 0.30 for OpenHarmony (and current libc) compatibility#118
Open
social4hyq wants to merge 1 commit into
Open
Bump nix 0.23 -> 0.30 for OpenHarmony (and current libc) compatibility#118social4hyq wants to merge 1 commit into
social4hyq wants to merge 1 commit into
Conversation
nix 0.23.x does not gate aio_*, lio_listio, FDPIC_FUNCPTRS, UNAME26, __fsword_t, ST_RELATIME, etc. on target_env="ohos", so it fails to compile for *-unknown-linux-ohos targets. nix 0.30 gates these properly. Adopt the new API surface: shm_open returns OwnedFd (convert via into_raw_fd); ftruncate/fstat/mmap take BorrowedFd (wrap with borrow_raw); mmap takes Option<NonZeroUsize> for size and NonNull for addr; munmap takes NonNull.
This was referenced Jun 5, 2026
social4hyq
pushed a commit
to social4hyq/vite-plus
that referenced
this pull request
Jun 5, 2026
shared_memory PR is elast0ny/shared_memory#118; vite-task PR is voidzero-dev/vite-task#426.
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
Bump
nixfrom 0.23 to 0.30 soshared_memorybuilds undertarget_env="ohos"(and any other target wherenix0.23 is too old for the currentlibc).Why
nix = "0.23"doesn't compile on the OpenHarmony Tier-2 Rust targets (aarch64-unknown-linux-ohos,x86_64-unknown-linux-ohos, etc.). The OHOS port oflibchas diverged enough that the 0.23 wrappers no longer type-check; the workspace produces ~50 errors on the firstcargo check.nix0.30 builds cleanly on the same targets and is the current major release.What changed
Cargo.toml:nix = "0.23"→nix = { version = "0.30", default-features = false, features = ["fs", "mman"] }. The feature set is minimized to keep the dependency surface tight —shared_memoryonly usesfs(file descriptor wrappers) andmman(mmap/munmap/shm_open/shm_unlink).src/unix.rs: adapt to the 0.30 API:RawFdarguments that fed intommap/closenow useBorrowedFd<'_>/OwnedFd(viafrom_raw_fdat the boundary).mmaplength argument is nowNonZeroUsize.OwnedFdis consumed withinto_raw_fd()where we still need aRawFdto return through the public API.No behavior change; all changes are mechanical updates to match the new type signatures.
Test plan
cargo check --target x86_64-unknown-linux-ohos— greencargo check --target aarch64-unknown-linux-ohos— greenfspy(used by voidzero-dev/vite-task) compiles + runs against this branch on OHOScargo teston existing targets — not yet run locally, would appreciate CI verificationNotes
I'm aware the repo has been quiet for a while (last push Sep 2023). I'm filing this PR + a companion issue (#119) to check on maintenance status. If a co-maintainer or transfer is being considered, happy to help.
This is consumed by voidzero-dev/vite-plus#1766 and voidzero-dev/vite-task#426 for OHOS native build support.