GithubHelp home page GithubHelp logo

Windows support about watlings HOT 6 CLOSED

iscas-zac avatar iscas-zac commented on August 16, 2024
Windows support

from watlings.

Comments (6)

EmNudge avatar EmNudge commented on August 16, 2024

Good call-out! I don't have a windows computer, but I'll get started porting the bash scripts over to node and see if I can get a PR out by EOD. I'm currently at Wasmcon, so it may take longer than I'd like

from watlings.

EmNudge avatar EmNudge commented on August 16, 2024

Let me know if there are still issues on windows for now. I've migrated the bash scripts to node, but I don't have a windows machine of my own right now to verify there aren't any other issues.

from watlings.

iscas-zac avatar iscas-zac commented on August 16, 2024

Hi, thanks for responding! I tried the patch, but the problem with npm start 001_hello and npm run test in JeffersGlass's comment appeared. I have no idea about the reason currently.

from watlings.

iscas-zac avatar iscas-zac commented on August 16, 2024

I'm not sure why the spawn behaves erroneously on Windows, and I changed it a little.

Also, according to nodejs/node#37845, the filePath is to be acquired by fileURLToPath. I changed getWastParser.mjs like,

...

      var path = new URL(filePath, import.meta.url).pathname;
      const fileName = path.match(/\/([^\/]+)\.wat$/)[1];
      const wasmPath = fileURLToPath(new URL(`../../.cache/${fileName}.wasm`, import.meta.url))
      path = fileURLToPath(new URL(filePath, import.meta.url))
      
      
      return new Promise((res, rej) => {
        spawn('node', ['node_modules/wabt/bin/wat2wasm', path, '-o', wasmPath], { stdio:'inherit' })

...

, and it compiles 001 successfully. Note that there are backslashes after fileURLToPath on Windows, and I don't want to change the regex part, so I keep the first pathname.

from watlings.

EmNudge avatar EmNudge commented on August 16, 2024

Thanks for the comment! Has the latest commit fixed the issues?

from watlings.

iscas-zac avatar iscas-zac commented on August 16, 2024

Seems good. It compiles after npm run solve 001_hello and the two tests passed. I have only looked at that puzzle for now, but I suppose others are also fine. (Probably GitHub Actions can help test out other cases on all platforms.)

I think providing a npm run solve all and catching the error during npm run build when some puzzles are not done will be better (or even the watch mode like rustlings), but that is out of the scope of this issue.

Thanks for your work!

from watlings.

Related Issues (6)

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.