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

Use new JavaScriptCore from npm #22263

Closed
wants to merge 1 commit into from

Conversation

DanielZlotin
Copy link
Contributor

Summary:
Pull Request resolved: #22231

  • Use clang instead of the deprecated gcc
  • Use libc++ instead of the deprecated gnustl
  • Updated gradle and android plugin version
  • Fixed missing arch in local-cli template
  • clean task should now always succeed
  • clean task deletes build artifacts
  • No need to specify buildToolsVersion. It's derived.
  • Elvis operator for more readable code

Differential Revision: D13004499

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. ✅pr adds tests labels Nov 14, 2018
@pull-bot
Copy link

pull-bot commented Nov 14, 2018

Warnings
⚠️

🔒 package.json - Changes were made to package.json. This will require a manual import by a Facebook employee.

⚠️

📋 Test Plan - This PR appears to be missing a Test Plan.

⚠️

📋 Release Notes - This PR appears to be missing Release Notes.

Generated by 🚫 dangerJS

@DanielZlotin
Copy link
Contributor Author

  • I published the old jsc-android (the current one used by RN) to npm of the new jsc (jsc-android), under tag stock-react-native (version is 174650.0.0).
  • new jsc is on latest tag
  • The goal right now is that the user will be able to choose which version of jsc to use
  • Easiest way I see right now to solve the gnustl <--> libc++ issue is to bundle gnustl_shared.so inside the package of the old jsc (under the stock-react-native tag). The issue right now is that I need to find a way to compile it, gradle screams at me that it is no longer supported -_-"
Android NDK: APP_STL gnustl_shared is no longer supported. Please switch to either c++_static or c++_shared.

@DanielZlotin
Copy link
Contributor Author

Found it! in ANDROID_NDK/sources/cxx-stl/gnu-libstdc++/4.9/libs/...

@DanielZlotin DanielZlotin changed the title Update gradle and mk files (#22231) Update gradle and mk files Nov 15, 2018
@gengjiawen
Copy link
Contributor

@dulmandakh

@kelset kelset added the Platform: Android Android applications. label Nov 15, 2018
@kelset
Copy link
Contributor

kelset commented Nov 15, 2018

Can you add the Release notes please? 😇

@gusgard
Copy link
Contributor

gusgard commented Nov 16, 2018

@DanielZlotin
You should update to gradleVersion = 4.10.2 in local-cli/templates/HelloWorld/android/build.gradle

@DanielZlotin
Copy link
Contributor Author

Using npm is just not the right way to manage jsc as it's a native dependency. After fighting with it for a while I abandoned this approach. The correct approach (which will require some work in https://github.com/react-community/jsc-android-buildscripts) is to manage publications of jsc in maven. This way the user will be able to override / use other versions of jsc.

This PR just updates react-native to use the latest jsc from npm, with full x64 support.

@DanielZlotin DanielZlotin changed the title Update gradle and mk files [Android] Use new JavaScriptCore from npm Nov 25, 2018
@gengjiawen
Copy link
Contributor

I think it can, maven maybe too slow.

@@ -223,6 +223,7 @@
"flow-bin": "^0.86.0",
"jest": "24.0.0-alpha.6",
"jest-junit": "5.2.0",
"jsc-android": "latest",
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe keep it simple, not introduce jsc in this pr.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's the entire point of this PR

Copy link
Contributor

Choose a reason for hiding this comment

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

If that's the case, you need to clean the old jsc and lock jsc version.

Copy link

Choose a reason for hiding this comment

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

By clearing old JSC is there anything else except 64-bit libicu_common.so and libjsc.so files checked into this package?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is the thing I can think of.

@gengjiawen
Copy link
Contributor

gengjiawen commented Nov 25, 2018

But maven can make developer use different jsc more easily, it's more flexible.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@axe-fb has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Summary:
Pull Request resolved: facebook#22231

- Use clang instead of the deprecated gcc
- Use libc++ instead of the deprecated gnustl
- Updated gradle and android plugin version
- Fixed missing arch in local-cli template
- `clean` task should now always succeed
- `clean` task deletes build artifacts
- No need to specify buildToolsVersion. It's derived.
- Elvis operator for more readable code
Pull Request resolved: facebook#22263

Differential Revision: D13004499

fbshipit-source-id: b4eca5d76482539c2c91833801b534e90cf153eb
@@ -223,6 +223,7 @@
"flow-bin": "^0.86.0",
"jest": "24.0.0-alpha.6",
"jest-junit": "5.2.0",
"jsc-android": "latest",
Copy link
Contributor

Choose a reason for hiding this comment

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

If that's the case, you need to clean the old jsc and lock jsc version.

@@ -30,8 +30,3 @@ allprojects {
}
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't delete this, it's used to upgrade gradle.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Overriding wrapper scripts is deprecated and will be removed in future gradle versions

Copy link
Contributor

Choose a reason for hiding this comment

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

Any doc I can check on this deprecation ?

Copy link
Contributor

@radeno radeno Dec 20, 2018

Choose a reason for hiding this comment

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

@gengjiawen looks like there it is (hope) https://docs.gradle.org/4.8/release-notes.html#overwriting-gradle's-built-in-tasks but it says just about syntax, not whole overriding

@@ -31,9 +30,3 @@ allprojects {
}
}
}


task wrapper(type: Wrapper) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Overriding wrapper scripts is deprecated and will be removed in future gradle versions

@@ -84,17 +85,17 @@ task prepareFolly(dependsOn: dependenciesPath ? [] : [downloadFolly], type: Copy
from dependenciesPath ?: tarTree(downloadFolly.dest)
from 'src/main/jni/third-party/folly/Android.mk'
include "folly-${FOLLY_VERSION}/folly/**/*", 'Android.mk'
eachFile {fname -> fname.path = (fname.path - "folly-${FOLLY_VERSION}/")}
eachFile { fname -> fname.path = (fname.path - "folly-${FOLLY_VERSION}/") }
includeEmptyDirs = false

// Patch for folly build break on gcc 4.9 and could be removed after build by clang
Copy link

@hey99xx hey99xx Nov 27, 2018

Choose a reason for hiding this comment

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

Should clean the block below "Patch for folly build break on gcc 4.9 and could be removed after build by clang"

@akshetpandey
Copy link

Any updates on this?

@hramos hramos changed the title [Android] Use new JavaScriptCore from npm Use new JavaScriptCore from npm Dec 14, 2018
@hramos
Copy link
Contributor

hramos commented Dec 20, 2018

It's still being worked on. There's some changes we've had to make internally. We're close to shipping.

vovkasm pushed a commit to vovkasm/react-native that referenced this pull request Dec 31, 2018
Summary:
Pull Request resolved: facebook#22231

- Use clang instead of the deprecated gcc
- Use libc++ instead of the deprecated gnustl
- Updated gradle and android plugin version
- Fixed missing arch in local-cli template
- `clean` task should now always succeed
- `clean` task deletes build artifacts
- No need to specify buildToolsVersion. It's derived.
- Elvis operator for more readable code
Pull Request resolved: facebook#22263

Reviewed By: hramos

Differential Revision: D13004499

Pulled By: DanielZlotin

fbshipit-source-id: da54bb744cedb4c6f3bda590f8c25d0ad64086ef
@ben-manes
Copy link
Contributor

ben-manes commented Feb 4, 2019

This is great, but unfortunately there is a memory leak in an unresolved JSC bug (#23259). The GC does not support Android, so the default behavior only collects the young generation and OOME when the old is full. You can either compile with flags set to disable generational GC or apply the provided patch. Unfortunately without fixing JSC itself, RN will crash in long running application.

rozele pushed a commit to microsoft/react-native-windows that referenced this pull request Jul 18, 2019
Summary:
Pull Request resolved: facebook/react-native#22231

- Use clang instead of the deprecated gcc
- Use libc++ instead of the deprecated gnustl
- Updated gradle and android plugin version
- Fixed missing arch in local-cli template
- `clean` task should now always succeed
- `clean` task deletes build artifacts
- No need to specify buildToolsVersion. It's derived.
- Elvis operator for more readable code
Pull Request resolved: facebook/react-native#22263

Reviewed By: hramos

Differential Revision: D13004499

Pulled By: DanielZlotin

fbshipit-source-id: da54bb744cedb4c6f3bda590f8c25d0ad64086ef
KusStar pushed a commit to KusStar/react-native that referenced this pull request Oct 29, 2020
Summary:
Pull Request resolved: facebook#22231

- Use clang instead of the deprecated gcc
- Use libc++ instead of the deprecated gnustl
- Updated gradle and android plugin version
- Fixed missing arch in local-cli template
- `clean` task should now always succeed
- `clean` task deletes build artifacts
- No need to specify buildToolsVersion. It's derived.
- Elvis operator for more readable code
Pull Request resolved: facebook#22263

Reviewed By: hramos

Differential Revision: D13004499

Pulled By: DanielZlotin

fbshipit-source-id: da54bb744cedb4c6f3bda590f8c25d0ad64086ef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. JavaScript Platform: Android Android applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.