WebAssembly / WebAssembly/tool-conventions
Proposal: a new subsection type in dylink.0 section to support runtime path
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 372
- Forks
- 75
- PR merge metrics
- No merged PRs in 30d
Description
Summary
I propose a new subsection type in dylink.0 section: WASM_DYLINK_RUNTIME_PATH.
This subsection is basically equivalent to runtime path (RPATH) in Linux, which is passed from the -rpath flag.
Background
The overall background is explained in the issue in the Emscripten repository: https://github.com/emscripten-core/emscripten/issues/22126
In Pyodide (Python runtime for the browser), we install packages during the runtime. Installing and loading packages requires loading multiple WASM modules (in Linux terms, shared libraries; in Emscripten terms, side modules) in the package, which has dependency relations.
In order to make the Python package portable, python packages often put all the shared libraries in the package and set the RPATH to the relative path to the shared libraries (PEP 513). However, currently Emscripten does not support RPATH in the WASM module, so we've been hacking around the internal Emscripten code to inject the directory path to the shared libraries.
So, I propose to add support for the runtime path.
Proposal Details
-
Add a new subsection type in dylink.0 section:
WASM_DYLINK_RUNTIME_PATH.
a.5 / WASM_DYLINK_RUNTIME_PATH -
This subsection contains following fields:
b.stringpath: the rpath string -
The special string
$ORIGINneed to be supported.
c.$ORIGINrepresents the directory where the WASM module is located in the (virtual) filesystem. -
Let emscripten use this field to locate the shared library in the runtime.
cc: @hoodmane
Contributor guide
No contributing guide indexed for this repository
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
No repository files or tests are named. Start by reading the proposed dylink.0 subsection details and the linked Emscripten issue, then trace how runtime loading currently locates shared libraries. Done means defining the subsection format, supporting $ORIGIN, and specifying how the runtime uses the path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wasm
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100