appveyor / ci

AppVeyor community support repository
https://www.appveyor.com
344 stars 66 forks source link

Node.js on ChakraCore #1148

Open xzyfer opened 8 years ago

xzyfer commented 8 years ago

Add support for node-chakracore. They provide precompiled msi binaries for each GH release.

This will help adoption, and stress testing of node-chakracore.

Related https://github.com/nodejs/node-chakracore/issues/136 https://github.com/sass/node-sass/issues/1776 https://github.com/sass/node-sass/pull/1777

IlyaFinkelshteyn commented 8 years ago

Hello, you can install msi you need at init stage of AppVeyor build with simple script which takes about 20 seconds and looks like this:

Write-Host "Installing node-chakracore..." -ForegroundColor Cyan
Write-Host "Downloading..."
$msiPath = "$env:USERPROFILE\node-chakracore-x64.msi"
(New-Object Net.WebClient).DownloadFile('https://github.com/nodejs/node-chakracore/releases/download/node-chakracore-7.0.0-pre9/node-chakracore-x64.msi', $msiPath)
Write-Host "Installing..."
cmd /c start /wait msiexec /i $msiPath /quiet
Write-Host "node-chakracore installed" -ForegroundColor Green

--ilya.

xzyfer commented 8 years ago

Thanks @IlyaFinkelshteyn. I've tried something similar but run into an issue with DownloadFile.

Exception calling "DownloadFile" with "2" argument(s): "The request was aborted: The connection was closed unexpectedly."
At line:5 char:3
+   (New-Object Net.WebClient).DownloadFile('https://github.com/nodejs/ ...
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException

Installing...
node-chakracore installed
IlyaFinkelshteyn commented 8 years ago

Please try script provided, it was tested with AppVeyor before publishing here,

IlyaFinkelshteyn commented 8 years ago

Also you can implement retry if network connection appears to be flaky.

xzyfer commented 8 years ago

I have tried what you have suggested. I'm getting the above error.

https://ci.appveyor.com/project/sass/node-sass/build/2116/job/df741m5revs5eiy6

https://github.com/sass/node-sass/compare/trash/chakra

xzyfer commented 8 years ago

I can get it installing now but node appears to still be executing node 4.

IlyaFinkelshteyn commented 8 years ago

OK, I am not very familiar with this product, but I see that when you install msi, it creates Node.js (chakracore) command prompt shortcut from which commands supposed to be executed. No difference with AppVeyor I believe. This shortcut calls C:\Windows\System32\cmd.exe /k "C:\Program Files\nodejs (chakracore)\nodevars.bat". Please try to add this command before executing you node code and see if this helps.

xzyfer commented 8 years ago

I have managed to get this working in https://github.com/sass/node-sass/blob/trash/chakra/appveyor.yml.

For reference node-chakracore is an experimental new Node.js engine currently primarily targeted at Windows. It's something Node projects on Windows will want to start testing against. It's for this reason I opened this request for an official support.

Install-Product node-chakracore $env:nodejs_version $env:platform
kunalspathak commented 8 years ago

@IlyaFinkelshteyn . currently https://github.com/sass/node-sass/pull/1777 is fetching the msi from node-chakracore release page. We are working on getting CI builds from node-cahkracore in nodejs org. Once that is done, we should add custom installation in nodejs-utils.psm1 for node-chakracore which will download the version specific binaries from https://nodejs.org/dist/. That way, we (node-chakracore or node-sass team) won't have to worry editing the appveyor.yml of node-sass every time we release new binary.

kunalspathak commented 7 years ago

Alternatively we could use nvs that supports running various versions of node in CI environment. It has support for both appveyor and Travis.

dougwilson commented 7 years ago

I would like to see out-of-the-box nvs available in Appveyor, both for Node.js versions and for Chakra like @kunalspathak pointed out. I think that may work better in the end vs the PowerShell script used currently?

smola commented 6 years ago

Once that is done, we should add custom installation in nodejs-utils.psm1 for node-chakracore which will download the version specific binaries from https://nodejs.org/dist/. That way, we (node-chakracore or node-sass team) won't have to worry editing the appveyor.yml of node-sass every time we release new binary.

@kunalspathak You could also retrieve latest tag from GitHub to build the download URL. For example: https://gist.github.com/smola/388b05b2602fd91c33975744ba653975#powershell