Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Hosting binding.node built using node-chakracore #1776

Open
kunalspathak opened this issue Oct 29, 2016 · 7 comments
Open

Hosting binding.node built using node-chakracore #1776

kunalspathak opened this issue Oct 29, 2016 · 7 comments

Comments

@kunalspathak
Copy link

  • NPM version (npm -v): 3.10.3
  • Node version (node -v): v7.0.0-pre9
  • Node Process (node -p process.versions):
{ http_parser: '2.7.0',
  node: '7.0.0-pre9',
  chakracore: '1.3.0.0',
  uv: '1.9.1',
  zlib: '1.2.8',
  ares: '1.10.1-DEV',
  modules: '48',
  openssl: '1.0.2h' }
  • Node Platform (node -p process.platform):win32
  • Node architecture (node -p process.arch):
  • node-sass version (node -p "require('node-sass').info"):
  • npm node-sass versions (npm ls node-sass):

When encountering a syntax, or compilation issue:

Currently binding.node released are built using nodejs v8. Developers who want to use node-chakracore, can't rely on this binary and need to build it locally using node-chakracore. I would like to start a discussion on what will it take to start hosting binding.node that is built using node-chakracore. Needless to say, this will need some changes in download script inside scripts\install.js to take care of downloading appropriate binding.node based on node engine that is running the install script.

If you delete this text without following it, your issue will be closed.

kunalspathak added a commit to kunalspathak/node-sass that referenced this issue Oct 29, 2016
Today, `npm install` downloads the pre-built `binding.node` binary from [node-sass repo](https://github.com/sass/node-sass/releases).
However these binaries are compiled using `nodev8` and an attempt to use it with [node-chakracore](https://github.com/nodejs/node-chakracore) would fail.
One option is to have `node-sass` host binaries pre-built using node-chakracore and during installation have a way to detect the engine (using `process.jsEngine')
and download the appropriate engine compliant binary. I have opened sass#1776 to start the discussion for this.

For now, as an interim solution, I have disabled downloading the pre-built binary if running with node-chakracore. In `postinstall` stage, it would see that the binary
is not present and then would build the binary (only one-time) with node-chakracore.
@nschonni
Copy link
Contributor

I could be wrong, but I think the best place to get this fixed/compatible would be with https://github.com/nodejs/nan

@kunalspathak
Copy link
Author

@nschonni , node-chakracore is already compatible with nan APIs, however chakrashim, the shim layer of node-chakracore has its own implementation of v8 data-structures. With that module compiled with v8 can't work with chakracore because of difference in native objects layout, etc.

To give you an analogy, it is like someapp.exe can't work on Ubuntu even if the source code of someapp is same.

@matthargett
Copy link

Very much looking forward to get getting fixed for the next release so we can use several popular react and react-native projects with node-chakracore. Let me know if any additional testing of the PR is needed before merging.

@xzyfer
Copy link
Contributor

xzyfer commented Nov 1, 2016

I want Node Sass to support chakracore but we won't do a half-job of it. It will take a little while, but we will ship aim to ship officially support, not a hack.

xzyfer pushed a commit that referenced this issue Nov 3, 2016
Today, `npm install` downloads the pre-built `binding.node` binary from [node-sass repo](https://github.com/sass/node-sass/releases).
However these binaries are compiled using `nodev8` and an attempt to use it with [node-chakracore](https://github.com/nodejs/node-chakracore) would fail.
One option is to have `node-sass` host binaries pre-built using node-chakracore and during installation have a way to detect the engine (using `process.jsEngine')
and download the appropriate engine compliant binary. I have opened #1776 to start the discussion for this.

For now, as an interim solution, I have disabled downloading the pre-built binary if running with node-chakracore. In `postinstall` stage, it would see that the binary
is not present and then would build the binary (only one-time) with node-chakracore.
@matthargett
Copy link

Does the release of this tool help move this along? https://github.com/felixrieseberg/windows-build-tools

@xzyfer
Copy link
Contributor

xzyfer commented Jan 2, 2017

@matthargett that is unrelated to ChakraCore. nodejs/node-gyp#873 is the most relevant discussion atm

@kunalspathak
Copy link
Author

@xzyfer - Is there anything else needed apart from #1777 to address this issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants