EmbarkStudios / EmbarkStudios/rpmalloc-rs
rpmalloc-sys fails to build for wasm target on Windows: fatal error: 'unistd.h' file not found
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 160
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Description
Not sure if this allocator is intended to also work for wasm, but in my frontend I need speed more than size (it's a UI for a desktop application), so I thought I'd try it..
But it fails to build for wasm:
```
error: failed to run custom build command for `rpmalloc-sys v0.1.3`
--- stdout
TARGET = Some("wasm32-unknown-unknown")
HOST = Some("x86_64-pc-windows-msvc")
CC_wasm32-unknown-unknown = None
CC_wasm32_unknown_unknown = None
TARGET_CC = None
CC = None
CFLAGS_wasm32-unknown-unknown = None
CFLAGS_wasm32_unknown_unknown = None
TARGET_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
running: "clang" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=wasm32-unknown-unknown" "-Wall" "-Wextra" "-DENABLE_PRELOAD=1" "-o" "D:\\project\\target\\wasm32-unknown-unknown\\debug\\build\\rpmalloc-sys-21068dcc5b7ecde5\\out\\rpmalloc.o" "-c" "C:\\Users\\me\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\rpmalloc-sys-0.1.3\\rpmalloc\\rpmalloc\\rpmalloc.c"
cargo:warning=C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\rpmalloc-sys-0.1.3\rpmalloc\rpmalloc\rpmalloc.c:122:12: fatal error: 'unistd.h' file not found
cargo:warning=# include
cargo:warning= ^~~~~~~~~~
cargo:warning=1 error generated.
exit code: 1
--- stderr
error occurred: Command "clang" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "--target=wasm32-unknown-unknown" "-Wall" "-Wextra" "-DENABLE_PRELOAD=1" "-o" "D:\\project\\target\\wasm32-unknown-unknown\\debug\\build\\rpmalloc-sys-21068dcc5b7ecde5\\out\\rpmalloc.o" "-c" "C:\\Users\\me\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\rpmalloc-sys-0.1.3\\rpmalloc\\rpmalloc\\rpmalloc.c" with args "clang" did not execute successfully (status code exit code: 1).
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure by building rpmalloc-sys v0.1.3 for wasm32-unknown-unknown on Windows, then inspect rpmalloc/rpmalloc/rpmalloc.c around line 122 where unistd.h is included. Determine whether wasm is supported and verify the chosen fix by rerunning the same Cargo build successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, wasm
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100