From c254661d37182a1680711cae922befa0d8465fb0 Mon Sep 17 00:00:00 2001 From: Jiajie Hu Date: Wed, 2 Aug 2017 07:22:47 +0000 Subject: [PATCH] configure: fix type of arm_version arm_version is compared with an integer 7 in V8's GYP files, instead of the string "7", so it seems that this variable should be an integer when it is representing a version number. Its default value in V8's standalone.gypi seconds this. It also seems that GYP can quietly convert an integer-like string to an integer in some scenarios, maybe during the merge of some dictionaries, so luckily no actual problem happens at the moment. However, the subtle difference between 7 and "7" will be observed when a new GYP variable is added to V8's toolchain.gypi like this: { 'variables': { ... 'conditions': [ ... ['arm_version==7', { 'myvar%': 'abc', }], ], ... }, ... } Interestingly no implicit conversion happens here when arm_version is "7", so GYP will complain about the undefined variable <(myvar) if it's referenced later on. --- configure | 6 +++--- test/common/index.js | 4 ++-- test/sequential/test-child-process-pass-fd.js | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configure b/configure index 9f327d1377028c..a12b8c7f0712b0 100755 --- a/configure +++ b/configure @@ -773,16 +773,16 @@ def configure_arm(o): if is_arch_armv7(): arm_fpu = 'vfpv3' - o['variables']['arm_version'] = '7' + o['variables']['arm_version'] = 7 else: - o['variables']['arm_version'] = '6' if is_arch_armv6() else 'default' + o['variables']['arm_version'] = 6 if is_arch_armv6() else 'default' o['variables']['arm_thumb'] = 0 # -marm o['variables']['arm_float_abi'] = arm_float_abi if options.dest_os == 'android': arm_fpu = 'vfpv3' - o['variables']['arm_version'] = '7' + o['variables']['arm_version'] = 7 o['variables']['arm_fpu'] = options.arm_fpu or arm_fpu diff --git a/test/common/index.js b/test/common/index.js index fc14cdacacc587..130937a31849a6 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -333,10 +333,10 @@ exports.platformTimeout = function(ms) { const armv = process.config.variables.arm_version; - if (armv === '6') + if (armv === 6) return 7 * ms; // ARMv6 - if (armv === '7') + if (armv === 7) return 2 * ms; // ARMv7 return ms; // ARMv8+ diff --git a/test/sequential/test-child-process-pass-fd.js b/test/sequential/test-child-process-pass-fd.js index 8cc11f6c11f5b4..5f417addd4cbc5 100644 --- a/test/sequential/test-child-process-pass-fd.js +++ b/test/sequential/test-child-process-pass-fd.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); -if ((process.config.variables.arm_version === '6') || - (process.config.variables.arm_version === '7')) +if ((process.config.variables.arm_version === 6) || + (process.config.variables.arm_version === 7)) common.skip('Too slow for armv6 and armv7 bots'); const assert = require('assert');