File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -74,15 +74,20 @@ libc stubs) — no copying files or build scripts needed.
7474
7575### 3. Build and embed in hyperlight-js
7676
77- Build your custom runtime for the Hyperlight target and embed it:
77+ Set ` HYPERLIGHT_CFLAGS ` before building. The hyperlight target has no libc —
78+ QuickJS needs the stub headers from ` hyperlight-js-runtime/include/ ` and
79+ ` -D__wasi__=1 ` to disable pthreads.
7880
7981``` bash
80- # Build for the hyperlight target
81- cargo hyperlight build --manifest-path my-custom-runtime/Cargo.toml
82+ export HYPERLIGHT_CFLAGS=$( node -e "
83+ var m=JSON.parse(require('child_process').execSync(
84+ 'cargo metadata --format-version 1 --manifest-path my-custom-runtime/Cargo.toml',
85+ {encoding:'utf8',stdio:['pipe','pipe','pipe']}));
86+ var p=m.packages.find(function(p){return p.name==='hyperlight-js-runtime'});
87+ console.log('-I'+require('path').join(require('path').dirname(p.manifest_path),'include')+' -D__wasi__=1');
88+ " )
8289
83- # Build hyperlight-js with your custom runtime embedded
84- HYPERLIGHT_JS_RUNTIME_PATH=/path/to/my-custom-runtime \
85- cargo build -p hyperlight-js
90+ cargo hyperlight build --manifest-path my-custom-runtime/Cargo.toml
8691```
8792
8893### 4. Use from the host
You can’t perform that action at this time.
0 commit comments