Skip to content

programs: skip ownership changes on WASI - #4988

Open
cerisier wants to merge 1 commit into
meta:devfrom
cerisier:cerisier/wasi-chown
Open

cerisier wants to merge 1 commit into
meta:devfrom
cerisier:cerisier/wasi-chown

Conversation

@cerisier

Copy link
Copy Markdown

WASI libc does not provide chown or fchown, but UTIL_setFDStat assumes they exist on every non-Windows target. This prevents the CLI source from compiling for WASI. Skip only the ownership updates on WASI; retain permission updates and the existing behavior elsewhere.

This surfaced in hermetic-llvm’s multi-stage FDO bootstrap, where an instrumented Clang compiles zstd for each supported target, including WASI, to generate its profile.

Reproducer: this WASI build compiled zstd's programs/util.c for wasm32-unknown-wasip1 and failed with call to undeclared function 'chown'.

wasi-libc's unistd.h explicitly notes that WASI has no chown.

AI assistance was used to investigate and prepare this patch.

@meta-cla meta-cla Bot added the CLA Signed label Nov 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant