maximoffua / flutter.nix

A flake for flutter package out of nixpkgs.
The Unlicense
11 stars 5 forks source link

`build_runner` failing in Flutter 3.22.2 #19

Open Andreas02-dev opened 1 week ago

Andreas02-dev commented 1 week ago

build_runner fails in Flutter 3.22.2. The following error gets thrown:

┌─ flutter_nix_repro/failing/test on  main is  v1.0.0+1 via  v3.4.3 via  impure (devenv-shell-env) 
└─> dart run build_runner doctor -v
Resolving dependencies in `/home/andreas/Downloads/flutter_nix_repro/failing/test`... 
Because test depends on flutter_test from sdk which doesn't exist (the Flutter SDK is not available), version solving failed.

Flutter users should use `flutter pub` instead of `dart pub`.

In an earlier version, build_runner worked correctly.

I have added a repro for the failing and working versions at https://github.com/Andreas02-dev/flutter_nix_repro/tree/main

Please let me know if any additional information is required, so this can be resolved.

Andreas02-dev commented 6 days ago

I've looked into this a little more, and it seems Flutter 3.19.4 in nixpkgs works, and the latest Flutter 3.22 in nixpkgs also fails. This leads me to believe something went wrong with the bump from Flutter 3.19 to Flutter 3.22 , what would the best course of action be?

maximoffua commented 6 days ago

Hi @Andreas02-dev, thanks for looking into it. My guess is that there is some change in Flutter SDK. Setting FLUTTER_SDK env doesn't help and it requires some deeper investigation. For now I am using

flutter pub run build_runner ...
Andreas02-dev commented 6 days ago

Hi @Andreas02-dev, thanks for looking into it. My guess is that there is some change in Flutter SDK. Setting FLUTTER_SDK env doesn't help and it requires some deeper investigation. For now I am using

flutter pub run build_runner ...

Thanks for your reply! I've also made a more minimal reproduction using standard nixpkgs Flutter, and filed a bug report there at https://github.com/NixOS/nixpkgs/issues/322871 . Since this issue isn't limited to flutter-nix but also exists there, would it be better to post our findings in that thread?