Giter VIP home page Giter VIP logo

Comments (2)

lukevp avatar lukevp commented on July 1, 2024

Windows build incompatibilities

  • install-wasi-sdk.sh doesn't work because 1) it's a shell script, 2) windows doesn't have real CURL, it's mapped to Invoke-WebRequest. Should probably implement this as a .ps1 script for windows
  • the makefile uses the syntax cd -. The equivalents on Win are push-location and pop-location. I'm not sure if the cd - is used to fix the pwd to always be correct in case the previous cd commands failed or if it's just a shorthand way to undo a previous cd. If the latter, this incompatibility could be fixed by just updating to cd ../.. and not using this syntax.

I worked around these issues by

  • Changing all cd - to cd ../.. in the cli and core scripts
  • reproducing the install-wasi-sdk.sh script manually
    • downloading the 12.0 wasi sdk release for windows directly from github
    • placing it in a wasi-sdk folder
    • setting $env:QUICKJS_WASM_SYS_WASI_SDK_PATH = "C:/Code/js-pdk/wasi-sdk"
  • running make

Windows runtime incompatibilities

  • the install.sh script doesn't work because it's a shell script. need an equivalent .ps1 script or should be on Chocolatey
    binaryen needs to be installed manually
    • I installed binaryen by downloading the zip and placing it on the filesystem at C:\Tools\binaryen-version_117 and then - adding a PATH to the bin folder
  • extism-js is able to build .wasm output files but it has weird error output:
PS C:\Code\js-pdk\examples\simple_js> ..\..\target\release\extism-js.exe .\script.js -i .\script.d.ts
child not found in parent
UNREACHABLE executed at D:\a\binaryen\binaryen\src\passes\Precompute.cpp:838!

the built wasm file is callable, but that's the extent I've tested it.

..\..\extism.exe call .\index.wasm greet --input "Luke" --wasi 
Hello, Luke!

from js-pdk.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.