Skip to content

Instantly share code, notes, and snippets.

@dilijev
Last active May 31, 2017 01:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dilijev/d8f2fd58551360409b2ba3f50af144fd to your computer and use it in GitHub Desktop.
Save dilijev/d8f2fd58551360409b2ba3f50af144fd to your computer and use it in GitHub Desktop.
Easily set up eshost-cli with public binaries of various JS hosts

This Gist contains sources and instructions for setting up eshost-cli without needing to build anything. (However, some information about where to get sources and how to build is included, if you are so inclined.)

  • npm install -g eshost-cli
  • Run as eshost

(See also eshost)

Get JS Host Binaries

  • SpiderMonkey:
  • V8:
    • Builds of D8 are not available, but you can use node.js as a proxy for recent V8:
      • Install latest Node either via the installer or via NVS
      • Add to eshost with e.g. eshost --add node node %LOCALAPPDATA%\nvs\node\8.0.0\x64\node.exe
    • Build from source:
      • Source code available on GitHub at: https://github.com/v8/v8
      • See instructions at https://github.com/v8/v8#getting-the-code to get the source code and all dependencies to build
      • Get code or sync/update and compile:
        • fetch v8 (first time) or git pull origin; gclient sync (afterwards)
        • cd v8 if you're not already there
        • python tools\dev\v8gen.py x64.release
        • ninja -C out.gn\x64.release
        • out.gn\x64.release will contain the binaries, including d8
  • ChakraCore:
    • via ChakraCore Releases
      • Download ChakraCore-binaries.zip for a given release
      • Extract ChakraCore.dll and ch.exe from your chosen architecture
      • Add to eshost with e.g. eshost --add ch-1.4.4 ch c:\dev\eshost-bin\ch-1.4.4\ch.exe
    • via preview NuGet packages on MyGet:
      • Download package
      • Open in a zip archive viewer of your choice
      • Extract ChakraCore.dll and ch.exe from e.g. native\v140\x64\release\*
      • Add to eshost with e.g. eshost --add ch-1.5.0-pre ch c:\dev\eshost-bin\ch-1.5.0-pre\ch.exe
    • via Node-ChakraCore from NVS:
      • Add to eshost with e.g. eshost --add node-ch node %LOCALAPPDATA%\nvs\chakracore\8.0.0-pre3\x64\node.exe
    • Build from source:
  • WebKit:

TODO add instructions for non-Windows.

eshost configured with only pre-built binaries

Using the above sources (without building anything) I was able to set up eshost with (reasonably recent) coverage for SpiderMonkey, V8 (via node), and ChakraCore. (I included a few variants of variously recent ChakraCore.)

┌────────────┬─────────┬───────────────────────────────────────────────────────────────────────┬──────┐
│ name       │ type    │ path                                                                  │ args │
├────────────┼─────────┼───────────────────────────────────────────────────────────────────────┼──────┤
│ sm         │ jsshell │ E:\dd\eshost-bin\sm\js.exe                                            │      │
├────────────┼─────────┼───────────────────────────────────────────────────────────────────────┼──────┤
│ node       │ node    │ C:\Users\dilijev\AppData\Local\nvs\node\8.0.0\x64\node.exe            │      │
├────────────┼─────────┼───────────────────────────────────────────────────────────────────────┼──────┤
│ node-ch    │ node    │ C:\Users\dilijev\AppData\Local\nvs\chakracore\8.0.0-pre3\x64\node.exe │      │
├────────────┼─────────┼───────────────────────────────────────────────────────────────────────┼──────┤
│ ch-1.2.3   │ ch      │ E:\dd\eshost-bin\ch-1.2.3\ch.exe                                      │      │
├────────────┼─────────┼───────────────────────────────────────────────────────────────────────┼──────┤
│ ch-1.3.2   │ ch      │ E:\dd\eshost-bin\ch-1.3.2\ch.exe                                      │      │
├────────────┼─────────┼───────────────────────────────────────────────────────────────────────┼──────┤
│ ch-1.4.4   │ ch      │ E:\dd\eshost-bin\ch-1.4.4\ch.exe                                      │      │
├────────────┼─────────┼───────────────────────────────────────────────────────────────────────┼──────┤
│ ch-1.5.0   │ ch      │ E:\dd\eshost-bin\ch-1.5.0\ch.exe                                      │      │
└────────────┴─────────┴───────────────────────────────────────────────────────────────────────┴──────┘
> es -ts -e "2"
┌────────────┬───┐
│ sm         │ 2 │
│ node       │   │
│ node-ch    │   │
│ ch-1.2.3   │   │
│ ch-1.3.2   │   │
│ ch-1.4.4   │   │
│ ch-1.5.0   │   │
└────────────┴───┘
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment