rainyl / opencv_dart

OpenCV bindings for Dart language and Flutter.
https://pub.dev/packages/opencv_dart
Apache License 2.0
78 stars 10 forks source link

Cannot operate on packages inside the cache #86

Closed rainyl closed 2 weeks ago

rainyl commented 2 weeks ago

Dart doesn't allow run setup commands inside cache dir, so we need to find another way to download the libs

abdelaziz-mahdy commented 2 weeks ago

i think this is related ? i was testing ios, but it didnt work and running pod install gave me that error

Analyzing dependencies
Running auto setup, command: cd /Users/AbdelazizMahdy/.pub-cache/hosted/pub.dev/opencv_dart-1.0.6/ios/.. && dart run opencv_dart:setup ios --arch os64
PathNotFoundException: Cannot open file, path = '/Users/AbdelazizMahdy/.pub-cache/hosted/pub.dev/opencv_dart-1.0.6/.dart_tool/package_config.json' (OS Error: No such file or directory, errno = 2)
#0      _File.throwIfError (dart:io/file_impl.dart:675:7)
#1      _File.openSync (dart:io/file_impl.dart:490:5)
#2      _File.readAsBytesSync (dart:io/file_impl.dart:574:18)
#3      _File.readAsStringSync (dart:io/file_impl.dart:624:18)
#4      readTextFile (package:pub/src/io.dart:200:48)
#5      Entrypoint._loadPackageConfig (package:pub/src/entrypoint.dart:242:26)
#6      Entrypoint.ensureUpToDate.isResolutionUpToDate.#packageConfig#initializer (package:pub/src/entrypoint.dart:979:34)
#7      Entrypoint.ensureUpToDate.isResolutionUpToDate (package:pub/src/entrypoint.dart)
#8      Entrypoint.ensureUpToDate (package:pub/src/entrypoint.dart:1106:13)
#9      getExecutableForCommand (package:pub/src/executable.dart:320:38)
#10     RunCommand.run (package:dartdev/src/commands/run.dart:321:26)
<asynchronous suspension>
#11     CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#12     DartdevRunner.runCommand (package:dartdev/dartdev.dart:232:18)
<asynchronous suspension>
#13     runDartdev (package:dartdev/dartdev.dart:46:16)
<asynchronous suspension>
#14     main (file:///Volumes/Work/s/w/ir/x/w/sdk/pkg/dartdev/bin/dartdev.dart:13:5)
<asynchronous suspension>

make: *** [setup] Error 1
Downloading dependencies
image
rainyl commented 2 weeks ago

Yes, I am trying to download and extract in build scripts (cmakelists.txt, gradle...)

abdelaziz-mahdy commented 2 weeks ago

Yes, I am trying to download and extract in build scripts (cmakelists.txt, gradle...)

I do think that's a cleaner approach, since that's what most packages do

When I used your setup script it was the easiest approach and does the same job but I guess the path problem is the main concern now

rainyl commented 2 weeks ago

When I used your setup script it was the easiest approach and does the same job but I guess the path problem is the main concern now

Yes, I personally prefer an universal approach, but using setup commands via dart run opencv_dart:setup is impossible so far...

rainyl commented 2 weeks ago

@abdelaziz-mahdy 1.0.6+1 has been published, could you please try the new version?

abdelaziz-mahdy commented 2 weeks ago

@abdelaziz-mahdy 1.0.6+1 has been published, could you please try the new version?

ios simulator builds successfully finally <3 thank you for your awesome work <3

rainyl commented 2 weeks ago

Thanks for your contributions and tests too. :smile: