Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(android): Update V8 to 7.8.279.23 #11294

Merged
merged 27 commits into from
Dec 11, 2019
Merged

Conversation

sgtcoolguy
Copy link
Contributor

@sgtcoolguy sgtcoolguy commented Oct 22, 2019

JIRA: https://jira.appcelerator.org/browse/TIMOB-27178

Description:
This is a work in progress to update to the latest V8 builds we can. Current Android SDK is on top of V8 7.3.492.26.

This PR currently updates us to V8 7.8.279.23
Current stable android v8 is 7.8.279.23 via https://omahaproxy.appspot.com

What I did:

  • Attempted to maintain backwards compatibility for APIs that modules may use in the appcelerator/v8_titanium builds
  • Update any V8 API usages in titanium_mobile to use the newer APIs and drop removed/deprecated API usages (including in the module template)
  • Cleaned up some of the templates/c++ code to try and remove unnecessary headers includes (to hopefully speed up builds of the SDK a little)
  • Commit c4aa037 includes a minor performance patch - it moves attempting to load "core" (read: native) modules after handling requires starting with '/' or '.'. When I turned on some debug logging in the c++ code, I saw that it kept trying to load bindings for '.'. This does mean that technically we'd "lose" the ability to load native modules starting with a '.', but I'm not even sure we allow that in module id naming.
    (Note that I also noticed a bug in the building of the require path used for add-on tests in the test suite where it was trying to load add-on test files with no '/' prefix, so it hit the "core" module code path and failed)

@build
Copy link
Contributor

build commented Oct 22, 2019

Messages
📖

💾 Here's the generated SDK zipfile.

📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖

✅ All tests are passing
Nice one! All 6676 tests are passing.
(There are 700 skipped tests not included in that total)

New dependencies added: request-promise-native.

request-promise-native

Author: Nicolai Kamenzky

Description: The simplified HTTP request client 'request' with Promise support. Powered by native ES6 promises.

Homepage: https://github.com/request/request-promise-native#readme

Createdover 3 years ago
Last Updatedabout 1 month ago
LicenseISC
Maintainers2
Releases10
Direct Dependenciesrequest-promise-core, stealthy-require and tough-cookie
Keywordsxhr, http, https, promise, request, then, thenable and native
README
Promises/A+ logo

Request-Promise-Native

Gitter
Build Status
Coverage Status
Dependency Status
Known Vulnerabilities

This package is similar to request-promise but uses native ES6+ promises.

Please refer to the request-promise documentation. Everything applies to request-promise-native except the following:

  • Instead of using Bluebird promises this library uses native ES6+ promises.
  • Native ES6+ promises may have fewer features than Bluebird promises do. In particular, the .finally(...) method was not included until Node v10.

Installation

This module is installed via npm:

npm install --save request
npm install --save request-promise-native

request is defined as a peer-dependency and thus has to be installed separately.

Migration from request-promise to request-promise-native

  1. Go through the migration instructions to upgrade to request-promise v4.
  2. Ensure that you don't use Bluebird-specific features on the promise returned by your request calls. In particular, you can't use .finally(...) anymore.
  3. You are done.

Contributing

To set up your development environment:

  1. clone the repo to your desktop,
  2. in the shell cd to the main folder,
  3. hit npm install,
  4. hit npm install gulp -g if you haven't installed gulp globally yet, and
  5. run gulp dev. (Or run node ./node_modules/.bin/gulp dev if you don't want to install gulp globally.)

gulp dev watches all source files and if you save some changes it will lint the code and execute all tests. The test coverage report can be viewed from ./coverage/lcov-report/index.html.

If you want to debug a test you should use gulp test-without-coverage to run all tests without obscuring the code by the test coverage instrumentation.

Change History

  • v1.0.8 (2019-11-03)
  • v1.0.7 (2019-02-14)
    • Corrected mistakenly set tough-cookie version, now ^2.3.3
      (Thanks to @evocateur for pointing this out.)
    • If you installed [email protected] please make sure after the upgrade that request and request-promise-native use the same physical copy of tough-cookie.
  • v1.0.6 (2019-02-14)
    • Using stricter tough-cookie@~2.3.3 to avoid installing tough-cookie@3 which introduces breaking changes
      (Thanks to @jasonmit for pull request #33)
    • Security fix: bumped lodash to ^4.17.11, see vulnerabilty reports
  • v1.0.5 (2017-09-22)
  • v1.0.4 (2017-05-07)
  • v1.0.3 (2016-08-08)
    • Renamed internally used package @request/promise-core to request-promise-core because there where too many issues with the scoped package name
  • v1.0.2 (2016-07-18)
    • Fix for using with module bundlers like Webpack and Browserify
  • v1.0.1 (2016-07-17)
    • Fixed @request/promise-core version for safer versioning
  • v1.0.0 (2016-07-15)

License (ISC)

In case you never heard about the ISC license it is functionally equivalent to the MIT license.

See the LICENSE file for details.

Generated by 🚫 dangerJS against df6866e

@sgtcoolguy sgtcoolguy changed the title feat(android): Update V8 to 7.4.288.28 feat(android): Update V8 to 7.8.279.19 Oct 31, 2019
@garymathews garymathews changed the title feat(android): Update V8 to 7.8.279.19 feat(android): Update V8 to 7.8.279.23 Nov 27, 2019
@garymathews
Copy link
Contributor

  • Updated to latest V8 version 7.8.279.23 which is patched to be fully backwards compatible with Titanium SDK 7.0.0+ native modules
  • Updated various V8 API usages to the latest revisions

package.json Outdated Show resolved Hide resolved
@@ -239,7 +240,7 @@ jobject TypeConverter::jsObjectToJavaFunction(Isolate* isolate, JNIEnv *env, Loc
{
Local<Function> func = jsObject.As<Function>();
Persistent<Function, CopyablePersistentTraits<Function>> jsFunction(isolate, func);
jsFunction.MarkIndependent();
// jsFunction.MarkIndependent(); // Method has been removed!
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to do anything here?

If this is where we box anonymous JS callbacks, then we shouldn't make it a weak reference since it might get garbage collected before invoked on the Java side.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is okay, it looks like we store a persistent reference to the JS function so it can't be garbage collected and release the reference when the Java function is destroyed Java_org_appcelerator_kroll_runtime_v8_V8Function_nativeRelease

// Set correct permissions for 'mksnapshot'
await fs.chmod(MKSNAPSHOT_PATH, 0o755);
// Obtain snapshot `id` and start new snapshot generation.
const id = await request.post(SNAPSHOT_URL, { body: { v8, script }, json: true });
Copy link
Contributor

Choose a reason for hiding this comment

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

If you don't have Internet access, then the await request.post() will reject and throw an exception. Perhaps we should catch it, log the reject's error, and continue without the snapshot?

Although for Jenkins builds of our SDK (namely release builds), we don't want this behavior.

Copy link
Contributor

@garymathews garymathews Dec 9, 2019

Choose a reason for hiding this comment

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

We're catching the exception here, so this shouldn't be an issue.

Copy link
Contributor

@jquick-axway jquick-axway left a comment

Choose a reason for hiding this comment

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

CR: Pass

@lokeshchdhry
Copy link
Contributor

FR Passed.

Checked liveview, kitchensink & native modules 7.0.0+.

Studio Ver: 6.0.0.201911251516
SDK Ver: 9.0.0 local build
OS Ver: 10.14.5
Xcode Ver: Xcode 11.2.1
Appc NPM: 5.0.0-2
Appc CLI: 7.1.2
Daemon Ver: 1.1.3
Ti CLI Ver: 5.2.2
Alloy Ver: 1.14.4
Node Ver: 12.13.1
NPM Ver: 6.12.1
Java Ver: 11.0.1
Android Devices: ⇨ google Pixel (Android 10)

@lokeshchdhry
Copy link
Contributor

Can someone please resolve the conflict.

@lokeshchdhry lokeshchdhry merged commit 9006b4d into tidev:master Dec 11, 2019
@sgtcoolguy sgtcoolguy deleted the v8-7.4 branch December 11, 2019 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants