-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Enable install and build using node-chakracore #1777
Changes from 17 commits
eec8afa
4819b82
5d8ef9f
7924ebc
358b01b
e1b536b
c7124bb
6785d4d
8db7ad7
d39e552
d19aa55
5021dff
4077615
e334f71
a602a0b
15983e9
8591db4
e00e5bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,44 +32,53 @@ | |
- '%AppData%\npm-cache' | ||
|
||
environment: | ||
# https://github.com/jasongin/nvs/blob/master/doc/CI.md | ||
NVS_VERSION: 1.4.0 | ||
SKIP_SASS_BINARY_DOWNLOAD_FOR_CI: true | ||
matrix: | ||
- nodejs_version: 0.10 | ||
- NODEJS_VERSION: node/0.10 | ||
GYP_MSVS_VERSION: 2013 | ||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 | ||
- nodejs_version: 0.12 | ||
- NODEJS_VERSION: node/0.12 | ||
GYP_MSVS_VERSION: 2013 | ||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 | ||
- nodejs_version: 1.0 | ||
- NODEJS_VERSION: iojs/1 | ||
GYP_MSVS_VERSION: 2013 | ||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 | ||
- nodejs_version: 1 | ||
- NODEJS_VERSION: iojs/2 | ||
GYP_MSVS_VERSION: 2013 | ||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 | ||
- nodejs_version: 2 | ||
- NODEJS_VERSION: iojs/3 | ||
GYP_MSVS_VERSION: 2013 | ||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 | ||
- nodejs_version: 3 | ||
- NODEJS_VERSION: node/4 | ||
GYP_MSVS_VERSION: 2013 | ||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 | ||
- nodejs_version: 4 | ||
- NODEJS_VERSION: node/5 | ||
GYP_MSVS_VERSION: 2013 | ||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 | ||
- nodejs_version: 5 | ||
GYP_MSVS_VERSION: 2013 | ||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 | ||
- nodejs_version: 6 | ||
- NODEJS_VERSION: node/6 | ||
GYP_MSVS_VERSION: 2015 | ||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 | ||
- nodejs_version: 7 | ||
- NODEJS_VERSION: node/7 | ||
GYP_MSVS_VERSION: 2015 | ||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 | ||
- nodejs_version: 8 | ||
- NODEJS_VERSION: node/8 | ||
GYP_MSVS_VERSION: 2015 | ||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 | ||
- NODEJS_VERSION: chakracore/8.1.2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will a plain There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This raises the question of what kind of ABI guarantees we get with CharkraCore.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @matthargett. I was under the impression from #1777 (comment) that WASM wasn't supported in node-chakracore. Can you please confirm? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WASM is supported in Node-ChakraCore if you're using the WebAssembly methods from JavaScript. Using basic.wasm from here, the following code worked with Node-ChakraCore:
Note that ChakraCore doesn't expose JSRT APIs for embedders to directly invoke WASM from their applications- the workaround is they'll have to do it through JavaScript. Also, minor technical point but while node-chakracore was included in the N-API repo during N-API prototyping, N-API has merged into the master branch of nodejs/node, so active N-API development for Node-ChakraCore is now happening in the master branch of nodejs/node-chakracore. But the meta point still stands that node-chakracore supports N-API. |
||
GYP_MSVS_VERSION: 2015 | ||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 | ||
|
||
install: | ||
- ps: Install-Product node $env:nodejs_version $env:platform | ||
# Install NVS | ||
- git clone --branch v%NVS_VERSION% --depth 1 https://github.com/jasongin/nvs %LOCALAPPDATA%\nvs | ||
- set PATH=%LOCALAPPDATA%\nvs;%PATH% | ||
- nvs --version | ||
# Install selected version of Node.js using NVS | ||
- nvs add %NODEJS_VERSION% | ||
- nvs use %NODEJS_VERSION% | ||
|
||
- node --version | ||
- npm --version | ||
- npm install | ||
|
@@ -131,29 +140,41 @@ | |
- '%AppData%\npm-cache' | ||
|
||
environment: | ||
# https://github.com/jasongin/nvs/blob/master/doc/CI.md | ||
NVS_VERSION: 1.4.0 | ||
SKIP_SASS_BINARY_DOWNLOAD_FOR_CI: true | ||
matrix: | ||
- nodejs_version: 0.10 | ||
- NODEJS_VERSION: node/0.10 | ||
GYP_MSVS_VERSION: 2013 | ||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 | ||
- nodejs_version: 0.12 | ||
- NODEJS_VERSION: node/0.12 | ||
GYP_MSVS_VERSION: 2013 | ||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 | ||
- nodejs_version: 4 | ||
- NODEJS_VERSION: node/4 | ||
GYP_MSVS_VERSION: 2013 | ||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 | ||
- nodejs_version: 6 | ||
- NODEJS_VERSION: node/6 | ||
GYP_MSVS_VERSION: 2015 | ||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 | ||
- nodejs_version: 7 | ||
- NODEJS_VERSION: node/7 | ||
GYP_MSVS_VERSION: 2015 | ||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 | ||
- nodejs_version: 8 | ||
- NODEJS_VERSION: node/8 | ||
GYP_MSVS_VERSION: 2015 | ||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 | ||
- NODEJS_VERSION: chakracore/latest | ||
GYP_MSVS_VERSION: 2015 | ||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 | ||
|
||
install: | ||
- ps: Install-Product node $env:nodejs_version $env:platform | ||
# Install NVS | ||
- git clone --branch v%NVS_VERSION% --depth 1 https://github.com/jasongin/nvs %LOCALAPPDATA%\nvs | ||
- set PATH=%LOCALAPPDATA%\nvs;%PATH% | ||
- nvs --version | ||
# Install selected version of Node.js using NVS | ||
- nvs add %NODEJS_VERSION% | ||
- nvs use %NODEJS_VERSION% | ||
|
||
- node --version | ||
- npm --version | ||
- npm install | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,14 +56,20 @@ function afterBuild(options) { | |
*/ | ||
|
||
function build(options) { | ||
var args = [require.resolve(path.join('node-gyp', 'bin', 'node-gyp.js')), 'rebuild', '--verbose'].concat( | ||
['libsass_ext', 'libsass_cflags', 'libsass_ldflags', 'libsass_library'].map(function(subject) { | ||
return ['--', subject, '=', process.env[subject.toUpperCase()] || ''].join(''); | ||
})).concat(options.args); | ||
|
||
console.log('Building:', [process.execPath].concat(args).join(' ')); | ||
|
||
var proc = spawn(process.execPath, args, { | ||
var nodeGyp = resolveNodeGyp(); | ||
var nodeGypArgs = nodeGyp.args.concat([ | ||
'rebuild', | ||
'--verbose', | ||
'--libsass_ext=' + (process.env['LIBSASS_EXT'] || ''), | ||
'--libsass_cflags=' + (process.env['LIBSASS_CFLAGS'] || ''), | ||
'--libsass_ldflags=' + (process.env['LIBSASS_LDFLAGS'] || ''), | ||
'--libsass_library=' + (process.env['LIBSASS_LIBRARY'] || ''), | ||
]) | ||
.concat(options.args); | ||
|
||
console.log(['Building:', nodeGyp.exeName].concat(nodeGypArgs).join(' ')); | ||
|
||
var proc = spawn(nodeGyp.exeName, nodeGypArgs, { | ||
stdio: [0, 1, 2] | ||
}); | ||
|
||
|
@@ -83,6 +89,19 @@ function build(options) { | |
}); | ||
} | ||
|
||
/** | ||
* Resolve node-gyp command to invoke | ||
* | ||
* @api private | ||
*/ | ||
function resolveNodeGyp() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need this now that the version is bumped to 3.6? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No and that's why i removed my changes in 5021dff . I just kept the resolution of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 that makes sense |
||
var localNodeGypBin = require.resolve(path.join('node-gyp', 'bin', 'node-gyp.js')); | ||
|
||
return { | ||
exeName: process.execPath, | ||
args: [localNodeGypBin], | ||
}; | ||
} | ||
/** | ||
* Parse arguments | ||
* | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth looking at https://github.com/appveyor/ci/blob/master/scripts/nodejs-utils.psm1 to get "native" support for Chakra on Appveyor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is definitely an option (and likewise in
nvm
and hencenode-chakracore
), but at this time we just preferred usingnvs
since it added support for CI recently.