Skip to content

flutter build macos succeeds even if native asset builds failed #137910

Description

@mkustermann

A simple flutter create hello app that depends on a package with native assets seems to build just fine with flutter build macos even though the actual native build of the depedency failed.

Repro: Create flutter create hello make it depend on foo, make foo simply throw an exception in build.dart. flutter build macos will then

% flutter build macos --verbose

[        ] [   +1 ms] Running `... .../build.dart   .../.dart_tool/native_assets_builder/a6d771ecb50a7ea677377d476b2a411d/config.yaml`.                                                                                                                                          [+1409 ms] [+1409 ms] Unhandled exception:                                                                                                                                                                                                                   [        ] [        ] foo                                                                                                                                                                                                                                      [        ] [        ] #0      main (...) 
[        ] [        ] #1      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:33)
[        ] [        ] #2      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)                                                                                                                                                  [  +25 ms] [  +25 ms] Building native assets for package:libexif failed.                                                                                                                                                                                     [        ]            build.dart returned with exit code: 255.                                                                                                                                                                                               [        ]            To reproduce run:                                                                                                                                                                                                                      [        ]            /Users/kustermann/repositories/flutter/bin/dart --packages=/Users/kustermann/na/hello/.dart_tool/package_config.json /Users/kustermann/na/libexif/build.dart             
...
[        ]     /
[  +39 ms] ** BUILD SUCCEEDED **
[  +32 ms] Building macOS application... (completed in 27.2s)
[   +2 ms] "flutter macos" took 29,083ms.
[ +154 ms] ensureAnalyticsSent: 152ms
[        ] Running 0 shutdown hooks
[        ] Shutdown hooks complete
[        ] exiting with code 0
% echo $?
0

Activity

  1. added
    in triagePresently being triaged by the triage team
    toolAffects the "flutter" command-line tool. See also t: labels.
    team-toolOwned by Flutter Tool team
    and removed
    in triagePresently being triaged by the triage team
    on Nov 6, 2023
  2. dcharkes commented on Nov 7, 2023

    @dcharkes
    Contributor

    Thanks for the report @mkustermann!

    I can reproduce this.

    In addition, flutter run also ignored build failures.

    I've uploaded a PR to address this.

  3. github-actions commented on Nov 21, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  4. locked as resolved and limited conversation to collaborators on Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

dependency: dartDart team may need to help usteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions