Skip to content

[flutter_plugin_tools] Legacy analysis fails on @docImports of dev dependencies #196406

Open

Description

@QuncCccccc

Legacy analysis (.ci/scripts/analyze_legacy.sh, used by the Linux analyze_legacy N-1 and N-2 tasks in flutter/packages) runs remove-dev-dependencies and then analyze --lib-only. If a package's lib/ code has a @docImport of one of its dev dependencies, that import can't be resolved once the dev dependencies are removed, so analysis fails with uri_does_not_exist_in_doc_import.

Doc imports only affect dartdoc references, not compilation, so this is a false positive for what legacy analysis is meant to check (that client-facing code still analyzes on N-1 and N-2).

This first showed up in flutter/packages#13628: N-1 moved to 3.47.9, so cupertino_ui (which requires Flutter 3.47) is legacy-analyzed for the first time. 20 of its lib/ files have /// @docImport 'package:material_ui/material_ui.dart';, and material_ui is only a dev dependency (because material_ui depends on cupertino_ui). As a workaround, that PR adds // ignore: uri_does_not_exist_in_doc_import (or ignore_for_file) to those files.

Possible fixes:

  • Don't treat uri_does_not_exist_in_doc_import as an error in legacy analysis.
  • Have remove-dev-dependencies also remove @docImports of the packages it removes.

Once this is fixed, the ignores in packages/cupertino_ui/lib/ can be removed.

Activity

  1. added
    c: contributor-productivityTeam-specific productivity, code health, technical debt.
    p: toolingAffects the flutter_plugin_tools package
    packageflutter/packages repository. See also p: labels.
    P2Important issues not at the top of the work list
    on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: contributor-productivityTeam-specific productivity, code health, technical debt.p: toolingAffects the flutter_plugin_tools packagepackageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions