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

ffi error with Dart 3 #12

Closed
jodinathan opened this issue Feb 23, 2023 · 9 comments
Closed

ffi error with Dart 3 #12

jodinathan opened this issue Feb 23, 2023 · 9 comments

Comments

@jodinathan
Copy link

when trying to run a console app:

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;

dart version
Dart SDK version: 3.0.0-263.0.dev (dev) (Tue Feb 21 17:59:38 2023 -0800) on "macos_x64"

@nikage
Copy link

nikage commented Apr 1, 2023

I'm encountering the same issue with compilation error when running $ pub global activate get_cli. The error message is as follows:

../.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;
$ flutter --version
Flutter 3.9.0-0.2.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 0df8557c56 (9 days ago) • 2023-03-23 22:02:01 -0500
Engine • revision 1cc4b2d280
Tools • Dart 3.0.0 (build 3.0.0-290.3.beta) • DevTools 2.22.2

I use MBP m1

$ sw_vers
ProductName:	macOS
ProductVersion:	12.6
BuildVersion:	21G115
Full error log
Failed to build get_cli:get:
../.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;
                                  ^
../.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;
                                  ^
../.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;
                ^
../.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;
                ^
../.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;
                                  ^
../.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;
                                  ^
../.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;
                                  ^
../.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;
                                  ^
../.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;
                                  ^
../.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;
                ^
../.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;
                                               ^
../.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;
                                     ^
../.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;
                                     ^
../.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;
                                     ^
../.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;
                                     ^
../.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;
                                     ^
../.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;
                                     ^
../.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;
                                     ^
../.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;
                                     ^
../.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;
                                     ^
../.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;
                                     ^
../.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;
                                     ^
../.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;
                                     ^
../.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;
                                     ^
../.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;
                                  ^
../.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;
                                  ^
../.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;
                                  ^
../.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;
                                  ^
../.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;
                                  ^
../.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;
                                  ^
../.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;
                                  ^
../.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;
                                  ^
../.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;
                                  ^
../.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;
                                  ^
../.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;
                                  ^
../.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;
                                  ^
../.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;

@shamblett
Copy link

I'm seeing these errors also, +1

@Skycoder42
Copy link

The 4.2.0 tag seems to work when directly referencing it as git tag. Why has it not been released on pub.dev yet?

@bsutton
Copy link
Collaborator

bsutton commented May 12, 2023

So the problem was layered

  1. I had a circular dependency issue with dcli.
    So I started on breaking dcli into multiple smaller package to remove this sort of problem.
  2. my laptop died so my evening work on dcli halted until I came to the realization that I need to buy a new
    laptop as my old one wasn't retrievable.
  3. By the time I got the new lap top I got distracted by the dcli work and completely forgot that I hadn't released this version.

:<

@bsutton
Copy link
Collaborator

bsutton commented May 12, 2023

I will try to get a release happening over the weekend.

@shamblett
Copy link

Great, thanks

@bsutton
Copy link
Collaborator

bsutton commented May 12, 2023

dart_posix 5.0.0 has now being published.
This appears to resolve the problem.

Please take it for a spin and let me know how it goes.

@bsutton bsutton closed this as completed May 12, 2023
@Skycoder42
Copy link

Works for me, thank you :)

@shamblett
Copy link

And me, thanks

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

5 participants