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

Build iOS - Turbo Module with Backward Compatibility - Fails #557

Closed
1 of 2 tasks
gladiuscode opened this issue May 24, 2024 · 4 comments
Closed
1 of 2 tasks

Build iOS - Turbo Module with Backward Compatibility - Fails #557

gladiuscode opened this issue May 24, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@gladiuscode
Copy link

Description

Hi all,

I think this is related to how turbo is setup to handle cocoapods cache, therefore it may be a bug.
Basically I've got a library that supports both the old architecture and the new one.
My github action that runs: build:ios, fails saying the following:

The following build commands failed:
2024-05-23T23:19:55.9038470Z 	CompileC /Users/runner/Library/Developer/Xcode/DerivedData/OrientationDirectorExample-cmbpwsqgntorrdetrsbzengqrrls/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Codegen.build/Objects-normal/x86_64/RNOrientationDirectorSpecJSI-generated.o /Users/runner/work/react-native-orientation-director/react-native-orientation-director/example/ios/build/generated/ios/RNOrientationDirectorSpecJSI-generated.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-Codegen' from project 'Pods')
2024-05-23T23:19:55.9043380Z 	CompileC /Users/runner/Library/Developer/Xcode/DerivedData/OrientationDirectorExample-cmbpwsqgntorrdetrsbzengqrrls/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Codegen.build/Objects-normal/x86_64/FBReactNativeSpecJSI-generated.o /Users/runner/work/react-native-orientation-director/react-native-orientation-director/example/ios/build/generated/ios/FBReactNativeSpecJSI-generated.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-Codegen' from project 'Pods')

It expects the output of Codegen (If i'm not mistaken) but my example app is not setup to build with the new architecture, so I don't understand how to properly fix this behaviour.
Locally i can't reproduce this issue, it runs smoothly.

Is it related to the pushed Podfile.lock?
If i delete the Podfile.lock, turbo resets the cocoapods cache and everything runs successfully, but I can't reset it everytime, I don't think that is the solution.

Has anyone got any idea?
My experience with Turbo is non-existent, so every help is really appreciated.

Thanks!

Packages

  • create-react-native-library
  • react-native-builder-bob

Selected options

✔ What is the name of the npm package? react-native-orientation-director
✔ What is the description for the package?
✔ What is the name of package author? gladiuscode
✔ What is the email address for the package author?
✔ What is the URL for the package author?
✔ What is the URL for the repository? https://github.com/gladiuscode/react-native-orientation-director
✔ What type of library do you want to develop? › Turbo module with backward compat
✔ Which languages do you want to use? › Kotlin & Objective-C

Link to repro

gladiuscode/react-native-orientation-director#1

Environment

React Native v74
Node 18
Yarn 3.x

@gladiuscode gladiuscode added the bug Something isn't working label May 24, 2024
@gladiuscode
Copy link
Author

Update:

It seems that by pushing the Podfile.lock after running:

RCT_NEW_ARCH_ENABLED=1 bundle exec pod install

solves the issue.

So I guess that for the CI we should always push a Podfile.lock for the new architecture to ensure compatibility, although it seems strange.

@atlj
Copy link
Collaborator

atlj commented May 24, 2024

Hey looks like you were able to fix it by enabling the New Arch on this commit. So you most likely still have an issue on the current arch.

And its failing on the current arch because it's not able to find the generated JSI spec (which is normal because you are not on the new arch)

Here is the error from your build:

2024-05-24T16:46:31.3700520Z error: Build input file cannot be found: '/Users/runner/work/react-native-orientation-director/react-native-orientation-director/example/ios/build/generated/ios/RNOrientationDirectorSpecJSI-generated.cpp'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it? (in target 'React-Codegen' from project 'Pods')

But its interesting that even though you are not building for the new arch, it still looks for the codegen generated code

@gladiuscode
Copy link
Author

Hey @atlj!
Yes i figured that out, i'm basically stuck in a loop.
For the time being the only proper way is to reset the cocoapods cache. Doing so resets turbo and allows a proper build.

I'll run some tests in the upcoming days to check whether the same happens during a simple build process after a pod install. I'll gather some data if i can :)

@atlj
Copy link
Collaborator

atlj commented Sep 15, 2024

Hey I'm assuming this was fixed, please reopen if not.

@atlj atlj closed this as completed Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@atlj @gladiuscode and others