tmail-flutter icon indicating copy to clipboard operation
tmail-flutter copied to clipboard

`scripts/prebuild.sh` fails and pubspec.yaml dependencies not resolving.

Open EliRibble opened this issue 1 year ago • 2 comments

Description

I'm trying to build this project on NixOS. scripts/prebuild.sh is failing.

Expected result

scripts/prebuild.sh should do its work and exit with status 0.

Current behavior

scripts/prebuild.sh fails with status 1

Preconditions (optional)

> flutter --version
Flutter 3.22.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision nixpkgs000 () • 1970-01-01 00:00:00
Engine • revision edd8546116
Tools • Dart 3.4.3 • DevTools 2.34.3

Reproduction Steps

  1. Run NixOS
  2. remove *.lock from .gitignore
  3. Add the following to flake.nix definition (required due to #322871 in nixpkgs):
{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs =
    inputs:
    inputs.flake-utils.lib.eachDefaultSystem (
      system:
      let

        pkgs = import inputs.nixpkgs {
          inherit system;
          config = {
            allowUnfree = true;
          };
        };


        devShells.default = pkgs.mkShell
          {
            buildInputs = with pkgs;
              [
                flutter
              ];



            shellHook = ''
              export CHROME_EXECUTABLE=/run/current-system/sw/bin/google-chrome-stable
              export PATH="$PATH":"$HOME/.pub-cache/bin"
              export FLUTTER_ROOT="${pkgs.flutter}"

              fish
            '';
          };

      in
      {

        inherit devShells;

      }
    );


}
  1. run nix --experimental-features 'nix-command flakes' develop to enter a dev shell.
  2. Within the shell, run bash scripts/prebuild.sh

Acceptance criteria

As a developer, on latest Flutter stable, I am able to run scripts/prebuild.sh without errors.

Context

NixOS, but should be reproducible with a Nix install on any Nix-supported OS.

Additional information

EliRibble avatar Aug 30 '24 16:08 EliRibble

hi @EliRibble ,

Upgrading mockito still not make it work? An PR to fix it is welcome.

Thanks you.

hoangdat avatar Aug 31 '24 00:08 hoangdat

Yeah, after bumping all of the mokito entries from 5.4.2 to ^5.4.4 gets farther, but fails with:

Resolving dependencies... (4.5s)
Note: intl is pinned to version 0.19.0 by flutter_localizations from the flutter SDK.
See https://dart.dev/go/sdk-version-pinning for details.


Because tmail_ui_user depends on flutter_localizations from sdk which depends on intl 0.19.0, intl 0.19.0 is required.
So, because tmail_ui_user depends on intl 0.18.1, version solving failed.

which is in the

+ cd ../server_settings                                                                       
+ flutter pub get

An PR to fix it is welcome.

I'm happy to do that, but I think I may run up against whatever it is that's causing this project to hold tmail_ui_user on intl 0.18.1

EliRibble avatar Aug 31 '24 00:08 EliRibble