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

build: fix ARM build #265

Merged
merged 2 commits into from
May 28, 2017
Merged

build: fix ARM build #265

merged 2 commits into from
May 28, 2017

Conversation

kfarnung
Copy link
Contributor

Several fixes needed:

  1. Don't pass in the platform to ChakraCore-
    it'll figure out the right SDK version
  2. Disable intl on ARM if cross-compiling
  3. Set the default SDK version if compiling ARM to
    be v10.0 since Node doesn't seem to compile for
    Windows on ARM with the older SDKs.
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

build

@kfarnung kfarnung self-assigned this May 26, 2017
@kfarnung
Copy link
Contributor Author

Thanks @digitalinfinity for finishing this change up!

@digitalinfinity
Copy link
Contributor

LGTM- @nodejs/platform-windows does the change in msvs.py look ok? Should we move that to upstream? It's not a problem in upstream generally since I don't believe regular Node.js supports compiling for Windows on ARM, but I'm curious where the right place to land that change is.

@refack
Copy link
Contributor

refack commented May 26, 2017

I'm -0.5 for patching GYP would suggest patching configure

@refack
Copy link
Contributor

refack commented May 26, 2017

https://github.com/nodejs/node-chakracore/blob/xplat/configure#L765
Not sure what would would work:
probably o['target_defaults']['msvs_windows_sdk_version'] = 'v10.0'
or o['variables']['msvs_windows_sdk_version'] = 'v10.0'

if "%target_arch%"=="arm" (
if "%PROCESSOR_ARCHITECTURE%" NEQ "ARM" (
echo Skipping building ARM with Intl on a non-ARM device
set configure_flags=%configure_flags% --without-intl
Copy link
Contributor

@refack refack May 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[FYI]
--without-intl will disable the inspector nodejs/node#12978
Not sure what's the equivalent for chakra, but all the #if HAVE_INSPECTOR code section will be off

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @refack, I filed #268 to explore whether we can support building ICU in the build machine's architecture and hopefully re-enable it. For now we'll just have to keep the lack of inspector as a known issue.

# Node for Windows on ARM requires at least the Windows 10 SDK
# to build. If it hasn't already been provided, set the default
# to v10.0
if "msvs_windows_sdk_version" not in configuration:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should move to configure as per my comment.

@digitalinfinity
Copy link
Contributor

@refack ah, so that was the magic configure incantation! I think a case can still be made for making the change in gyp in case anyone else using gyp runs into it, but I don't feel too strongly and I think for our purposes, a configure change works better since I don't want node-chakracore's gyp to diverge from upstream. @kfarnung I verified that digitalinfinity@1fdbbd4 builds fine on my Windows machine with ARM- feel free to cherry-pick into your PR.

@refack
Copy link
Contributor

refack commented May 26, 2017

I think a case can still be made for making the change in gyp in case anyone else using gyp runs into it

I'd agree but GYP attempts to be all-knowing-all-detecting so for pushing this upstream (GYP upstream that is) you'll need to add some detection logic instead of the "arbitrary" v10.0 value... (https://github.com/kfarnung/node-chakracore/blob/c6f78a5176324cf1a0e861f103392b653059f408/tools/gyp/pylib/gyp/generator/msvs.py#L297)

@kfarnung kfarnung force-pushed the arm branch 2 times, most recently from cb8bd7f to 7e3babf Compare May 26, 2017 22:13
@kfarnung
Copy link
Contributor Author

@refack @digitalinfinity I'm not able to confirm in CI yet, but I've incorporated your recommendations and rebased against xplat.

@@ -787,6 +787,9 @@ def configure_arm(o):

o['variables']['arm_fpu'] = options.arm_fpu or arm_fpu

if flavor == 'win':
o['msvs_windows_sdk_version'] = 'v10.0'
Copy link
Contributor

@refack refack May 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be o['target_defaults']['msvs_windows_sdk_version']

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

configure_arm is called from configure_node which is called from configure_engine (https://github.com/nodejs/node-chakracore/blob/xplat/configure#L1338). At the point configure_engine is called, output['target_defaults'] hasn't been defined yet- it gets defined later at https://github.com/nodejs/node-chakracore/blob/xplat/configure#L1376. So it looks like the way to get it propagated from configure_arm is to set the property directly on o here? Or did I misunderstand something?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep you are right.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's just a wierd hack at https://github.com/nodejs/node-chakracore/blob/xplat/configure#L1355 for the ['variables'] that always confuses me

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha yeah, I got thrown off by that too- it seemed like a roundabout way to do things 😄

Copy link
Contributor

@digitalinfinity digitalinfinity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @joaocgreis for triggering the test build: https://nodejs.org/download/test/v8.0.0-test201705267e3babf033/

Given that the arm build is unblocked, this PR is fine from my side

@kfarnung
Copy link
Contributor Author

@refack look good to you?

@joaocgreis
Copy link
Member

Copy link
Contributor

@refack refack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (% CI as always)

@kfarnung
Copy link
Contributor Author

Thanks for your help @refack!

Several fixes needed:
1. Don't pass in the platform to ChakraCore-
   it'll figure out the right SDK version
2. Disable intl on ARM if cross-compiling
3. Set the default SDK version if compiling ARM to
   be v10.0 since Node doesn't seem to compile for
   Windows on ARM with the older SDKs.

PR-URL: nodejs#265
Reviewed-By: Kunal Pathak <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Hitesh Kanwathirtha <[email protected]>
PR-URL: nodejs#265
Reviewed-By: Kunal Pathak <[email protected]>
Reviewed-By: Hitesh Kanwathirtha <[email protected]>
@kfarnung kfarnung merged commit e35fd86 into nodejs:xplat May 28, 2017
@kfarnung kfarnung deleted the arm branch May 28, 2017 02:02
kfarnung added a commit to kfarnung/node-chakracore that referenced this pull request May 31, 2017
Several fixes needed:
1. Don't pass in the platform to ChakraCore-
   it'll figure out the right SDK version
2. Disable intl on ARM if cross-compiling
3. Set the default SDK version if compiling ARM to
   be v10.0 since Node doesn't seem to compile for
   Windows on ARM with the older SDKs.

PR-URL: nodejs#265
Reviewed-By: Kunal Pathak <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Hitesh Kanwathirtha <[email protected]>
kfarnung added a commit to kfarnung/node-chakracore that referenced this pull request May 31, 2017
Several fixes needed:
1. Don't pass in the platform to ChakraCore-
   it'll figure out the right SDK version
2. Disable intl on ARM if cross-compiling
3. Set the default SDK version if compiling ARM to
   be v10.0 since Node doesn't seem to compile for
   Windows on ARM with the older SDKs.

PR-URL: nodejs#265
Reviewed-By: Kunal Pathak <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Hitesh Kanwathirtha <[email protected]>
kfarnung added a commit to kfarnung/node-chakracore that referenced this pull request May 31, 2017
PR-URL: nodejs#265
Reviewed-By: Kunal Pathak <[email protected]>
Reviewed-By: Hitesh Kanwathirtha <[email protected]>
kfarnung added a commit to kfarnung/node-chakracore that referenced this pull request May 31, 2017
Several fixes needed:
1. Don't pass in the platform to ChakraCore-
   it'll figure out the right SDK version
2. Disable intl on ARM if cross-compiling
3. Set the default SDK version if compiling ARM to
   be v10.0 since Node doesn't seem to compile for
   Windows on ARM with the older SDKs.

PR-URL: nodejs#265
Reviewed-By: Kunal Pathak <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Hitesh Kanwathirtha <[email protected]>
kfarnung added a commit to kfarnung/node-chakracore that referenced this pull request Jun 1, 2017
PR-URL: nodejs#265
Reviewed-By: Kunal Pathak <[email protected]>
Reviewed-By: Hitesh Kanwathirtha <[email protected]>
kfarnung added a commit to kfarnung/node-chakracore that referenced this pull request Jun 5, 2017
Several fixes needed:
1. Don't pass in the platform to ChakraCore-
   it'll figure out the right SDK version
2. Disable intl on ARM if cross-compiling
3. Set the default SDK version if compiling ARM to
   be v10.0 since Node doesn't seem to compile for
   Windows on ARM with the older SDKs.

PR-URL: nodejs#265
Reviewed-By: Kunal Pathak <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Hitesh Kanwathirtha <[email protected]>
kfarnung added a commit to kfarnung/node-chakracore that referenced this pull request Jun 5, 2017
PR-URL: nodejs#265
Reviewed-By: Kunal Pathak <[email protected]>
Reviewed-By: Hitesh Kanwathirtha <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants