Conversation
…ported by dynamic loading as of now
There was a problem hiding this comment.
this file is redundent, should remove
rennergade
left a comment
There was a problem hiding this comment.
This one needs the most work:
-
run.shhas hardcoded path:/home/lind/lind-wasm/src/wasmtime/target/debug/wasmtime— won't work outside that specific container. Should uselind_runor be parameterized. -
clean.shreferences$SYSROOTwhich is never defined in that script — will fail with "unbound variable" underset -eu. -
clean.shusessudo rm -rf— dangerous in a build script. The build shouldn't require sudo. -
Modifies shared sysroot —
build_python_wasm.shcreates empty placeholder.afiles (libwasi-emulated-getpid.a, etc.) directly in$SYSROOT/lib/wasm32-wasi/. This modifies the shared sysroot and affects all other builds. Should use the overlay pattern instead. -
Hardcodes
CLANG_BINinstead of loading from.toolchain.envlike other scripts. -
make ... &> make.log— hides all build output. If the build fails, you have to dig into the log file to find the error. Other scripts useV=1to show output. -
run_tests.shmodifies the build Makefile withsed— very fragile. Will break if the Makefile format changes. -
Missing space before
||in lind-boot precompile call. -
build_shared_python_wasm.shduplicates the same 50-line dylink pipeline from PR #185 — should use a shared helper. -
Duplicate
--exportflags in the shared python link command —--export=__wasm_call_ctors,--export-if-defined=__wasm_init_tls, and--export=__tls_baseeach appear twice.
Cross-cutting feedback for all the dynamic PRs (#185, #188, #189, #190, #191):
The dylink pipeline (clang link → add-export-tool ×3 → wasm-opt → precompile → stage) should be extracted into a shared helper script. It's duplicated 8+ times across these PRs with only the library name changing. A single scripts/build_dynamic_lib.sh taking the static archive and output name as args would eliminate ~400 lines of duplication and make it much easier to update the pipeline when flags change.
@qianxichen233 and @vidyalakshmir worked on this.
This PR is aimed at
This is a cleaned up PR from the following PRs
Closes #40
Closes #128
Closes #148
Closes #113
Testing
Test dynamic build of python
Test static build of python