Node.js issue: nodejs/node#49107
This repository contains a reproduction of a symlink handling issue in Node.js WASI preview1 implementation.
Relevant files are structured as follows:
.
├── Cargo.toml
└── dir
└── link -> ../Cargo.toml
When a WASI program attempts to read dir/link, it fails with error code 76 (notcapable).
- Cargo
- cargo-wasi (
cargo install cargo-wasi) - Node.js
- Deno (if you want to see expected behavior)
cargo wasi build(generates a WASM binary)./run-deno-wasi.ts(see expected behavior; requires Deno)./run-node-wasi.mjs(see Node.js behavior)
Following should be printed (contents of dir/link is successfully read):
Reading the contents of dir/link
[package]
name = "node-wasi-symlink-bug"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
Following error is printed:
Reading the contents of dir/link
Error: Os { code: 76, kind: Uncategorized, message: "Capabilities insufficient" }