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

Make reproducible builds from master branch #1024

Closed
likern opened this issue Jul 25, 2020 · 5 comments · Fixed by #1026
Closed

Make reproducible builds from master branch #1024

likern opened this issue Jul 25, 2020 · 5 comments · Fixed by #1026
Labels

Comments

@likern
Copy link
Contributor

likern commented Jul 25, 2020

Description

Every time I try to build react-native-reanimated npm package from master it fails.

I use script createNPMPackage.sh, other ways didn't work. Being able to build complete npm package from master is very important, otherwise I can't test patches against master branch and can't verify they are working.

...
> Task :buildReanimate
...
make: Leaving directory '/home/me/react-native-reanimated/android/src/main/JNI'
/home/me/react-native-reanimated/android/build/third-party-ndk/folly/folly/FileUtil.cpp:37:14: error: no matching function for call to 'wrapNoInt'
  return int(wrapNoInt(open, name, flags, mode));
             ^~~~~~~~~
/home/me/react-native-reanimated/android/build/third-party-ndk/folly/folly/detail/FileUtilDetail.h:34:9: note: candidate template ignored: couldn't infer template argument 'F'
ssize_t wrapNoInt(F f, Args... args) {
        ^
1 error generated.
make: *** [/home/me/.local/opt/android-sdk/ndk-bundle/build/core/build-binary.mk:478: /home/me/react-native-reanimated/android/build/tmp/buildReanimated/local/arm64-v8a/objs/folly_json/folly/FileUtil.o] Error 1
> Task :buildReanimated FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildReanimated'.
> Process 'command '/home/me/.local/opt/android-sdk/ndk-bundle/ndk-build'' finished with non-zero exit value 2

It would be very good to have CI tests that check source code from master at least is building for iOS and Android.

@terrysahaidak
Copy link
Contributor

It seems like you're using some wrong version of folly.

Does run-android work for you? I would recommend to try to build for device/emulator using Android studio - what's how I used to build it.

@likern
Copy link
Contributor Author

likern commented Jul 26, 2020

It seems like you're using some wrong version of folly.

Does run-android work for you? I would recommend to try to build for device/emulator using Android studio - what's how I used to build it.

Script createNPMPackage.sh calls android tasks through gradle command line, I think there should be no difference whether I call tasks from command line or through Android Studio.

I've tried to call assembleDebug using Android Studio and see the same error.
Folly version is picked up and downloaded by downloadFolly task

Download https://github.com/facebook/folly/archive/v2020.01.13.00.tar.gz
> Task :downloadFolly
> Task :prepareFolly
def FOLLY_VERSION = reactProperties.getProperty("FOLLY_VERSION")
...
task downloadFolly(dependsOn: createNativeDepsDirectories, type: Download) {
    src("https://github.com/facebook/folly/archive/v${FOLLY_VERSION}.tar.gz")
    onlyIfNewer(true)
    overwrite(false)
    dest(new File(downloadsDir, "folly-${FOLLY_VERSION}.tar.gz"))
}

which takes FOLLY_VERSION from ./node_modules/react-native/ReactAndroid/gradle.properties

FOLLY_VERSION=2020.01.13.00

Is used the latest React Native version - now it is 0.63.2, released 4 days ago.

@likern
Copy link
Contributor Author

likern commented Jul 26, 2020

This is a related issue facebook/react-native#28298

@likern
Copy link
Contributor Author

likern commented Jul 26, 2020

It seems like you're using some wrong version of folly.

Does run-android work for you? I would recommend to try to build for device/emulator using Android studio - what's how I used to build it.

After successfully generating react-native-reanimated-2.0.0-alpha.4.tgz I still see "Unsatisfied Link Error" for reanimated.so when try to use this reanimated package as dependency (using yarn add file://...).

photo5204307569185762798

@likern
Copy link
Contributor Author

likern commented Jul 26, 2020

The same problem have with running Example app.
Screenshot_2020-07-26-19-06-43-170_com miui bugreport

karol-bisztyga pushed a commit that referenced this issue Jul 29, 2020
Fixes #1024

Solution was taken from facebook/react-native#28298.

Change wrapNoInt template function invocation to it's code, after downloading folly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants