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

Auto setup from remote #76

Closed
rainyl opened this issue Jun 5, 2024 · 9 comments · Fixed by #78 or #83
Closed

Auto setup from remote #76

rainyl opened this issue Jun 5, 2024 · 9 comments · Fixed by #78 or #83
Labels
enhancement New feature or request

Comments

@rainyl
Copy link
Owner

rainyl commented Jun 5, 2024

Is your feature request related to a problem? Please describe.

Current auto setup will still download libs from releases, using setup commands, but the command needs correct working directory, i.e., user project directory, and now the parent directory is the cached package directory of opencv_dart, which is not correct, BUT I didn't find any approaches to get user project directory, it seems Flutter didn't expose it although I see such SRCROOT=.... in build logs.

Describe the solution you'd like

  1. let users to install conan
  2. call conan build in cached opencv_dart package directory to build libs
  3. copy build libs to corresponding platform directory (already implemented in conanfile.py)

Additional context

@rainyl rainyl added the enhancement New feature or request label Jun 5, 2024
@rainyl rainyl mentioned this issue Jun 5, 2024
@rainyl rainyl linked a pull request Jun 5, 2024 that will close this issue
@rainyl rainyl closed this as completed in #78 Jun 5, 2024
@abdelaziz-mahdy
Copy link
Contributor

abdelaziz-mahdy commented Jun 5, 2024

i am confused, does you auto build opencv? that takes alot of time if understand correctly? or you build the c++ wrappers for this package, also may explain the difference to me?

also i would like to note weird behavior that happened to me, i was running ios but it kept saying

Failed to build iOS app
Error (Xcode): Framework 'opencv_dart' not found

Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)

Could not build the application for the simulator.
Error launching application on iPhone 15 Pro.

going to ios and running pod install fixed the problem, but i dont understand why it was not ran automatically

i can confirm this still happens

Failed to build iOS app
Error (Xcode): Building for 'iOS-simulator', but linking in dylib (/Users/AbdelazizMahdy/.pub-cache/hosted/pub.dev/opencv_dart-1.0.5+1/ios/opencv_dart.framework/opencv_dart) built for 'iOS'

Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)

Could not build the application for the simulator.
Error launching application on iPhone 15 Pro.

i will add a ci for running on simulator to be sure if it got fixed

@rainyl
Copy link
Owner Author

rainyl commented Jun 6, 2024

  1. yes, only wrappers will be built. allow me to explain it later. As you said, building opencv itself is time consuming, that's why I moved it to opencv.full to prebuild it, but building wrappers is fast, so I think build them locally is better, and in this way it will be convenient to add more atchtectures like linux aarch64, because it doesn't need a prebuild.

  2. have you set OPENCV_DART_ARCH environment variable? by default arm64 will be built, I have no apple devices so not sure whether arm64 or x64 simulator will be used on arm64 macos? I will test it on x64 hackintosh, thanks~

@rainyl
Copy link
Owner Author

rainyl commented Jun 6, 2024

Well, maybe we should make the default ARCH=x64 instead of arm64?

@abdelaziz-mahdy
Copy link
Contributor

Well, maybe we should make the default ARCH=x64 instead of arm64?

Let me test it , can't we make it a universal framework? Where are the framework built for iOS.to try to do so

@abdelaziz-mahdy
Copy link
Contributor

  1. yes, only wrappers will be built. allow me to explain it later. As you said, building opencv itself is time consuming, that's why I moved it to opencv.full to prebuild it, but building wrappers is fast, so I think build them locally is better, and in this way it will be convenient to add more atchtectures like linux aarch64, because it doesn't need a prebuild.

  2. have you set OPENCV_DART_ARCH environment variable? by default arm64 will be built, I have no apple devices so not sure whether arm64 or x64 simulator will be used on arm64 macos? I will test it on x64 hackintosh, thanks~

I think the simulation is arm too but will check again

@rainyl
Copy link
Owner Author

rainyl commented Jun 6, 2024

Well, maybe we should make the default ARCH=x64 instead of arm64?

Let me test it , can't we make it a universal framework? Where are the framework built for iOS.to try to do so

Will a universal framework produce a large app after distribution? If not I think we can try to make it universal.

I think the simulation is arm too but will check again

Thanks~

@rainyl rainyl reopened this Jun 7, 2024
@rainyl
Copy link
Owner Author

rainyl commented Jun 7, 2024

It's so annoying to process native libs distribution for dart, especially for ios, x64, arm64, arm64 simulator...., enough! I do not use iphone even not an apple user, so not expert in apple developement, and I have waste several days on solving ios releated problems.

So I decide to revert to download from releases, just as #66 but with fixed working directory.

@abdelaziz-mahdy
Copy link
Contributor

It's so annoying to process native libs distribution for dart, especially for ios, x64, arm64, arm64 simulator...., enough! I do not use iphone even not an apple user, so not expert in apple developement, and I have waste several days on solving ios releated problems.

So I decide to revert to download from releases, just as #66 but with fixed working directory.

note: the problem with simualtor does happen using setup command too without the local build, just to be clear
#66 (comment)
so the ios covering all archs option will be the best bet

@rainyl
Copy link
Owner Author

rainyl commented Jun 7, 2024

so the ios covering all archs option will be the best bet

Yes, it is in consideration too, almost finished :)

@rainyl rainyl changed the title Auto setup, compile locally Auto setup from remote Jun 7, 2024
@rainyl rainyl closed this as completed in #83 Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants