Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
chakrashim: Remove option to build with 'chakra'
Browse files Browse the repository at this point in the history
chnext will only be able to built using chakracore and not chakra.
Removed msi/sdk changes for chakrashim that were mistakenly present in
chnext branch. They should be present in chnext-msi branch.

Fixes : #139
  • Loading branch information
kunalspathak committed Nov 18, 2015
1 parent c115f42 commit 1f2ab92
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 97 deletions.
20 changes: 4 additions & 16 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -65,34 +65,22 @@
'node_engine_include_dir%': 'deps/v8/include'
},
}],
['node_engine=="chakra" or node_engine=="chakracore"', {
['node_engine=="chakracore"', {
'target_defaults': {
'defines': [
'NODE_ENGINE="<(node_engine)"',
'NODE_ENGINE_CHAKRACORE',
'USE_EDGEMODE_JSRT',
],
'conditions': [
['node_engine=="chakra"', {
'defines': [ 'NODE_ENGINE_CHAKRA' ],
}],
['node_engine=="chakracore"', {
'defines': [ 'NODE_ENGINE_CHAKRACORE' ],
}],
['node_engine=="chakra" or target_arch=="arm"', {
['target_arch=="arm"', {
'msvs_windows_target_platform_version': '<(msvs_windows_target_platform_version)',
}],
],
},
'variables': {
'node_engine_include_dir%': 'deps/chakrashim/include',
'conditions': [
['node_engine=="chakra"', {
'node_engine_libs': [ '-lchakrart.lib' ],
}],
['node_engine=="chakracore"', {
'node_engine_libs': [ '-lchakracore.lib' ],
}],
],
'node_engine_libs': '-lchakracore.lib',
},
}],
],
Expand Down
10 changes: 1 addition & 9 deletions deps/chakrashim/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#define _WINSOCKAPI_
#endif

#if defined(NODE_ENGINE_CHAKRA) || defined(_M_ARM)
#if defined(_M_ARM)
#define CHAKRA_MIN_WIN32_WINNT _WIN32_WINNT_WIN10
#define CHAKRA_MIN_WIN32_WINNT_STR "_WIN32_WINNT_WIN10"
#else
Expand All @@ -55,15 +55,7 @@
#define USE_EDGEMODE_JSRT // Only works with edge JSRT
#endif

#ifdef NODE_ENGINE_CHAKRA
#include <jsrt.h>
#else
#include "chakracore.h"
#endif

#if (defined(NODE_ENGINE_CHAKRA) && !defined(_CHAKRART_H_))
#error Wrong Windows SDK version
#endif

#include <stdio.h>
#include <stdint.h>
Expand Down
2 changes: 1 addition & 1 deletion deps/chakrashim/src/v8debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static JsContextRef g_debugContext = JS_INVALID_REFERENCE;
bool Debug::EnableAgent(const char *name, int port, bool wait_for_connection) {
HRESULT hr = S_OK;

#ifdef NODE_ENGINE_CHAKRA
#ifndef NODE_ENGINE_CHAKRACORE
if (!g_EnableDebug) {
// JsStartDebugging needs COM initialization
IfComFailError(CoInitializeEx(nullptr, COINIT_MULTITHREADED));
Expand Down
2 changes: 1 addition & 1 deletion deps/chakrashim/src/v8v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void V8::SetFlagsFromCommandLine(int *argc, char **argv, bool remove_flags) {
}

bool V8::Initialize() {
#ifdef NODE_ENGINE_CHAKRA
#ifndef NODE_ENGINE_CHAKRACORE
if (g_EnableDebug && JsStartDebugging() != JsNoError) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/node_modules/node-gyp/addon.gypi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@
'deps/v8/tools/gyp/v8.gyp:v8_libplatform'
],
}],
['node_engine=="chakra" or node_engine=="chakracore"', {
['node_engine=="chakracore"', {
'include_dirs': [
'deps/chakrashim' # include/v8_platform.h
],
Expand Down Expand Up @@ -683,7 +683,7 @@
'deps/v8/tools/gyp/v8.gyp:v8_libplatform'
],
}],
['node_engine=="chakra" or node_engine=="chakracore"', {
['node_engine=="chakracore"', {
'dependencies': [ 'deps/chakrashim/chakrashim.gyp:chakrashim' ],
}],
],
Expand Down
2 changes: 1 addition & 1 deletion src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3394,7 +3394,7 @@ static void StartDebug(Environment* env, bool wait) {

env->debugger_agent()->set_dispatch_handler(
DispatchMessagesDebugAgentCallback);
#if defined(NODE_ENGINE_CHAKRA) || defined(NODE_ENGINE_CHAKRACORE)
#if defined(NODE_ENGINE_CHAKRACORE)
// ChakraShim does not support debugger_agent
debugger_running = v8::Debug::EnableAgent();
#else
Expand Down
70 changes: 4 additions & 66 deletions vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ set release_urls_arg=
set build_release=
set engine=v8
set openssl_no_asm=
set sdk=
set sdk_target_arch=
set save_release=

:next-arg
if "%1"=="" goto args-done
Expand Down Expand Up @@ -78,10 +75,8 @@ if /i "%1"=="intl-none" set i18n_arg=%1&goto arg-ok
if /i "%1"=="download-all" set download_arg="--download=all"&goto arg-ok
if /i "%1"=="ignore-flaky" set test_args=%test_args% --flaky-tests=dontcare&goto arg-ok
if /i "%1"=="v8" set engine=v8&goto arg-ok
if /i "%1"=="chakra" set engine=chakra&set chakra_jslint=deps\chakrashim\lib&goto arg-ok
if /i "%1"=="chakracore" set engine=chakracore&set chakra_jslint=deps\chakrashim\lib&goto arg-ok
if /i "%1"=="openssl-no-asm" set openssl_no_asm=--openssl-no-asm&goto arg-ok
if /i "%1"=="sdk" set sdk=1&goto arg-ok

echo Warning: ignoring invalid command line option `%1`.

Expand All @@ -104,22 +99,6 @@ if "%target_arch%"=="arm" (
if not "%openssl_no_asm%"=="--openssl-no-asm" goto arm-requires-openssl-no-asm
)

if defined sdk (
if "%target_arch%"=="x86" (
@rem gyp target_arch and process.arch are still ia32
set sdk_target_arch=ia32
) else (
set sdk_target_arch=%target_arch%
)

if not defined msi (
set save_release=1
) else (
set noprojgen=1
set nobuild=1
)
)

if "%config%"=="Debug" set debug_arg=--debug
if defined nosnapshot set snapshot_arg=--without-snapshot
if defined noetw set noetw_arg=--without-etw& set noetw_msi_arg=/p:NoETW=1
Expand All @@ -130,11 +109,6 @@ if "%i18n_arg%"=="full-icu" set i18n_arg=--with-intl=full-icu
if "%i18n_arg%"=="small-icu" set i18n_arg=--with-intl=small-icu
if "%i18n_arg%"=="intl-none" set i18n_arg=--with-intl=none

if defined NODE_VERSION_TAG (
set DISTTYPE=custom
set CUSTOMTAG=%NODE_VERSION_TAG%
)

if not exist "%~dp0deps\icu" goto no-depsicu
if "%target%"=="Clean" echo deleting %~dp0deps\icu
if "%target%"=="Clean" rmdir /S /Q %~dp0deps\icu
Expand Down Expand Up @@ -220,28 +194,11 @@ if "%target%" == "Clean" goto exit

:sign
@rem Skip signing if the `nosign` option was specified.
if defined nosign goto save_release
@rem Also skip signing if building msi with sdk
if defined sdk if defined msi goto save_release
if defined nosign goto licensertf

signtool sign /a /d "node" /t http://timestamp.globalsign.com/scripts/timestamp.dll Release\node.exe
if errorlevel 1 echo Failed to sign exe&goto exit

:save_release
@rem Save a copy of .exe/.lib for release
if not defined save_release goto licensertf

set engine_files=
set engine_libs=
if "%engine%"=="chakracore" (
set engine_files=chakracore.dll chakracore.pdb
set engine_libs=chakracore.lib
)
robocopy "%~dp0%config%" "%~dp0%config%\%sdk_target_arch%" node.exe node.pdb %engine_files%
if errorlevel 8 echo Failed to save built binaries&goto exit
robocopy "%~dp0%config%" "%~dp0%config%\sdk\%sdk_target_arch%" node.lib %engine_libs%
if errorlevel 8 echo Failed to save libs&goto exit

:licensertf
@rem Skip license.rtf generation if not requested.
if not defined licensertf goto msi
Expand All @@ -254,31 +211,12 @@ if errorlevel 1 echo Failed to generate license.rtf&goto exit
if not defined msi goto run

:msibuild
if defined NODE_VERSION_TAG (
set NODE_FULL_VERSION=%NODE_VERSION%.%NODE_VERSION_TAG%
) else (
set NODE_FULL_VERSION=%NODE_VERSION%
)
if not defined sdk (
set NODE_NAME=Node.js
set NODE_SHORTNAME=nodejs
set NODE_MSIOUTPUT=node-v%FULLVERSION%-%target_arch%
) else (
if "%engine%"=="chakra" (
set NODE_NAME=Node.js (%engine% next^)
set NODE_SHORTNAME=nodejs (%engine% next^)
) else (
set NODE_NAME=Node.js (%engine%^)
set NODE_SHORTNAME=nodejs (%engine%^)
)
set NODE_MSIOUTPUT=node-%engine%-v%FULLVERSION%-%target_arch%
)
echo Building %NODE_MSIOUTPUT%
msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build /p:PlatformToolset=%PLATFORM_TOOLSET% /p:GypMsvsVersion=%GYP_MSVS_VERSION% /p:Configuration=%config% /p:Platform=%target_arch% /p:SdkTargetArch=%sdk_target_arch% /p:NodeMsiOutput="%NODE_MSIOUTPUT%" /p:NodeEngine=%engine% /p:NodeName="%NODE_NAME%" /p:NodeShortName="%NODE_SHORTNAME%" /p:NodeUseSdk=%sdk% /p:NodeFullVersion=%NODE_FULL_VERSION% /p:NodeVersion=%NODE_VERSION% /p:FullVersion=%FULLVERSION% /p:DistTypeDir=%DISTTYPEDIR% %noetw_msi_arg% %noperfctr_msi_arg% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
echo Building node-v%FULLVERSION%-%target_arch%.msi
msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build /p:PlatformToolset=%PLATFORM_TOOLSET% /p:GypMsvsVersion=%GYP_MSVS_VERSION% /p:Configuration=%config% /p:Platform=%target_arch% /p:NodeVersion=%NODE_VERSION% /p:FullVersion=%FULLVERSION% /p:DistTypeDir=%DISTTYPEDIR% %noetw_msi_arg% %noperfctr_msi_arg% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
if errorlevel 1 goto exit

if defined nosign goto upload
signtool sign /a /d "node" /t http://timestamp.globalsign.com/scripts/timestamp.dll "%NODE_MSIOUTPUT%.msi"
signtool sign /a /d "node" /t http://timestamp.globalsign.com/scripts/timestamp.dll node-v%FULLVERSION%-%target_arch%.msi
if errorlevel 1 echo Failed to sign msi&goto exit

:upload
Expand Down

0 comments on commit 1f2ab92

Please sign in to comment.