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

Failed to compile the app with dart 3.0 compiler #213

Closed
imsamgarg opened this issue May 12, 2023 · 4 comments
Closed

Failed to compile the app with dart 3.0 compiler #213

imsamgarg opened this issue May 12, 2023 · 4 comments

Comments

@imsamgarg
Copy link

After upgrading my dart sdk to 3.0, I'm not able to compile my cli app.

I'm getting this error message. (related to posix package)

Info: Compiling with sound null safety.
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/grp.dart:369:35: Error: Field 'name' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? name;
                                  ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/grp.dart:372:35: Error: Field 'passwd' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? passwd;
                                  ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/grp.dart:376:17: Error: Field 'gid' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external int? gid;
                ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/grp.dart:379:48: Error: Field 'mem' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Pointer<ffi.Int8>>? mem;
                                               ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/pwd.dart:322:35: Error: Field 'name' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? name;
                                  ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/pwd.dart:326:35: Error: Field 'password' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? password;
                                  ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/pwd.dart:330:17: Error: Field 'uid' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external int? uid;
                ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/pwd.dart:334:17: Error: Field 'gid' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external int? gid;
                ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/pwd.dart:337:35: Error: Field 'gecos' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? gecos;
                                  ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/pwd.dart:340:35: Error: Field 'dir' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? dir;
                                  ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/pwd.dart:343:35: Error: Field 'shell' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? shell;
                                  ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:830:38: Error: Field '_unique___locales_item_0' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<locale_data>? _unique___locales_item_0;
                                     ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:832:38: Error: Field '_unique___locales_item_1' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<locale_data>? _unique___locales_item_1;
                                     ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:834:38: Error: Field '_unique___locales_item_2' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<locale_data>? _unique___locales_item_2;
                                     ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:836:38: Error: Field '_unique___locales_item_3' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<locale_data>? _unique___locales_item_3;
                                     ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:838:38: Error: Field '_unique___locales_item_4' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<locale_data>? _unique___locales_item_4;
                                     ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:840:38: Error: Field '_unique___locales_item_5' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<locale_data>? _unique___locales_item_5;
                                     ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:842:38: Error: Field '_unique___locales_item_6' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<locale_data>? _unique___locales_item_6;
                                     ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:844:38: Error: Field '_unique___locales_item_7' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<locale_data>? _unique___locales_item_7;
                                     ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:846:38: Error: Field '_unique___locales_item_8' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<locale_data>? _unique___locales_item_8;
                                     ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:848:38: Error: Field '_unique___locales_item_9' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<locale_data>? _unique___locales_item_9;
                                     ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:850:38: Error: Field '_unique___locales_item_10' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<locale_data>? _unique___locales_item_10;
                                     ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:852:38: Error: Field '_unique___locales_item_11' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<locale_data>? _unique___locales_item_11;
                                     ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:854:38: Error: Field '_unique___locales_item_12' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<locale_data>? _unique___locales_item_12;
                                     ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:861:35: Error: Field '_unique___names_item_0' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`. 
  external ffi.Pointer<ffi.Int8>? _unique___names_item_0;
                                  ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:863:35: Error: Field '_unique___names_item_1' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`. 
  external ffi.Pointer<ffi.Int8>? _unique___names_item_1;
                                  ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:865:35: Error: Field '_unique___names_item_2' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`. 
  external ffi.Pointer<ffi.Int8>? _unique___names_item_2;
                                  ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:867:35: Error: Field '_unique___names_item_3' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`. 
  external ffi.Pointer<ffi.Int8>? _unique___names_item_3;
                                  ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:869:35: Error: Field '_unique___names_item_4' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`. 
  external ffi.Pointer<ffi.Int8>? _unique___names_item_4;
                                  ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:871:35: Error: Field '_unique___names_item_5' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`. 
  external ffi.Pointer<ffi.Int8>? _unique___names_item_5;
                                  ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:873:35: Error: Field '_unique___names_item_6' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`. 
  external ffi.Pointer<ffi.Int8>? _unique___names_item_6;
                                  ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:875:35: Error: Field '_unique___names_item_7' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`. 
  external ffi.Pointer<ffi.Int8>? _unique___names_item_7;
                                  ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:877:35: Error: Field '_unique___names_item_8' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`. 
  external ffi.Pointer<ffi.Int8>? _unique___names_item_8;
                                  ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:879:35: Error: Field '_unique___names_item_9' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`. 
  external ffi.Pointer<ffi.Int8>? _unique___names_item_9;
                                  ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:881:35: Error: Field '_unique___names_item_10' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? _unique___names_item_10;
                                  ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:883:35: Error: Field '_unique___names_item_11' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? _unique___names_item_11;
                                  ^
/C:/Users/smile/AppData/Local/Pub/Cache/hosted/pub.dev/posix-4.1.0/lib/src/string/string.dart:885:35: Error: Field '_unique___names_item_12' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
  external ffi.Pointer<ffi.Int8>? _unique___names_item_12;
                                  ^
Error: AOT compilation failed
Generating AOT kernel dill failed!
@passsy
Copy link
Contributor

passsy commented May 12, 2023

See onepub-dev/dart_posix#12

@imsamgarg
Copy link
Author

@passsy Thanks!! I fixed the issue by using posix 4.2.0 (git) in dependency_overrides.

@bsutton
Copy link
Collaborator

bsutton commented May 12, 2023

posix 5.0 has been released.
I'm working towards an update dcli version with the new dependency.

@bsutton
Copy link
Collaborator

bsutton commented Oct 2, 2023

I've released dart 3.1.0 which should fix this issue.

re-open this issue if it is still an issue.

@bsutton bsutton closed this as completed Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants