onepub-dev / dcli

An extensive library and tooling for building console/cli applications and scripts using the Dart programming language.
236 stars 26 forks source link

cli.waitFor now deprecated #229

Closed Rodsevich closed 1 month ago

Rodsevich commented 4 months ago

Describe the bug On master branch of flutter, when using copy() (at least) the dcli package fails as follows:

Synchronous waiting using dart:cli waitFor and C API Dart_WaitForEvent is deprecated and disabled by default. This feature will be fully removed in Dart 3.4 release. You can currently still enable it by passing --enable_deprecated_wait_for to the Dart VM. See https://dartbug.com/52121.
  dart:cli                                      waitFor
  package:dcli/src/util/wait_for_ex.dart 38:17  waitForEx
  package:dcli/src/functions/copy.dart 38:5     copy

To Reproduce use a copy():

copy('file1.txt','file2.txt');

Expected behavior The copy succeds

Logs If applicable, add any logs to help explain your problem.

Run dcli doctor: From the cli run dcli doctor

DCli version      3.3.5                                                  

os                linux                                                  
os version        Linux 6.5.0-17-generic #17-Ubuntu SMP PREEMPT_DYNAMIC Thu Jan 11 14:01:59 UTC 2024
path separator    /                                                      

dart version      3.4.0-52.0.dev                                         

String: Synchronous waiting using dart:cli waitFor and C API Dart_WaitForEvent is deprecated and disabled by default. This feature will be fully removed in Dart 3.4 release. You can currently still enable it by passing --enable_deprecated_wait_for to the Dart VM. See https://dartbug.com/52121. 
Stacktrace: dart:cli                                                  waitFor
package:dcli/src/util/wait_for_ex.dart 36:17              waitForEx
package:dcli/src/functions/which.dart 97:5                which
package:dcli/src/util/dcli_paths.dart 42:20               DCliPaths.pathToDCli
package:dcli/src/commands/doctor.dart 125:36              DoctorCommand._printExePaths
package:dcli/src/commands/doctor.dart 43:5                DoctorCommand.run
package:dcli/src/script/command_line_runner.dart 98:33    CommandLineRunner.process
package:dcli/src/script/entry_point.dart 44:44            EntryPoint._parseCmdLine
package:dcli/src/script/entry_point.dart 38:7             EntryPoint.process
.pub-cache/hosted/pub.dev/dcli-3.3.5/bin/dcli.dart 17:41  DCli.run
.pub-cache/hosted/pub.dev/dcli-3.3.5/bin/dcli.dart 12:16  main
dart:isolate                                              _RawReceivePort._handleMessage
package:dcli/src/util/wait_for_ex.dart 33:28              waitForEx
package:dcli/src/functions/which.dart 97:5                which
package:dcli/src/util/dcli_paths.dart 42:20               DCliPaths.pathToDCli
package:dcli/src/commands/doctor.dart 125:36              DoctorCommand._printExePaths
package:dcli/src/commands/doctor.dart 43:5                DoctorCommand.run
package:dcli/src/script/command_line_runner.dart 98:33    CommandLineRunner.process
package:dcli/src/script/entry_point.dart 44:44            EntryPoint._parseCmdLine
package:dcli/src/script/entry_point.dart 38:7             EntryPoint.process
.pub-cache/hosted/pub.dev/dcli-3.3.5/bin/dcli.dart 17:41  DCli.run
.pub-cache/hosted/pub.dev/dcli-3.3.5/bin/dcli.dart 12:16  main

Additional context https://github.com/dart-lang/sdk/issues/52121

bsutton commented 3 months ago

have a go of the dcli 4.0.1-beta.1 it should have fixes for most problems now.

bsutton commented 2 months ago

beta 4 has been released and it looks like we pretty much have these issues solved.

bsutton commented 1 month ago

4.0.0 has been released which resolve this issue.