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

If running hook/build.dart of a package fails, then we should not continue building dependent packages #1630

Open
mkustermann opened this issue Oct 4, 2024 · 0 comments

Comments

@mkustermann
Copy link
Member

It seems currently the build runner will make a plan (order of packages) and then build all of them. See here

  Future<HookResult> _run({}) async {
    ...
    final (buildPlan, packageGraph, planSuccess) = await _makePlan(...);
    ...
    for (final package in buildPlan) {
    ...
    final (hookOutput, packageSuccess) = await _runHookForPackageCached(...);
    final validateResult = validateNoDuplicateDylibs(hookResult.assets);
    if (validateResult.isNotEmpty) {
      for (final error in validateResult) {
        logger.severe(error);
      }
      hookResult = hookResult.copyAdd(HookOutputImpl(), false);
    }

    return hookResult;
  }

I don't see any path where it fails early, which seems problematic: If package:foo depends on package:bar, both of them have build hooks and foos hook depends on outputs from bars hook, then if bar fails to build, we shouldn't even attempt to build foo.

Conservatively it could fail after the first package that failed to build or verify correctly.

Slightly better would be to have a graph (or more precisely a DAG) and build everything whose dependencies have transitively been successfully built, but never attempt to build a package that has any transitive dependencies with build failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants