Skip to content

Conversation

natebosch
Copy link
Member

The package:coverage library imports dart:io directly and cannot be
a dependency of apps compiled to platforms without dart:io. All
imports and uses of package:coverage must be through platform specific
imports. Add extra indirection in the coverage.dart and
coverage_stub.dart libraries so that engine.dart does not need to
import package:coverage or refer to the HitMap type it exports. Add
a forwarding implementation of the merge extension.

The `package:coverage` library imports `dart:io` directly and cannot be
a dependency of apps compiled to platforms without `dart:io`. All
imports and uses of `package:coverage` must be through platform specific
imports. Add extra indirection in the `coverage.dart` and
`coverage_stub.dart` libraries so that `engine.dart` does not need to
import `package:coverage` or refer to the `HitMap` type it exports. Add
a forwarding implementation of the `merge` extension.
@natebosch natebosch requested a review from a team as a code owner September 23, 2025 00:40
@natebosch
Copy link
Member Author

This will unbreak the google3 build and unblock package rolls.

Copy link

PR Health

Changelog Entry
Package Changed Files
package:test_core pkgs/test_core/lib/src/runner/coverage.dart
pkgs/test_core/lib/src/runner/coverage_stub.dart
pkgs/test_core/lib/src/runner/engine.dart

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check.

@natebosch
Copy link
Member Author

health check is broken globally for now - will have to merge with failing CI.

dart-lang/ecosystem#371

@dcharkes
Copy link
Contributor

I believe @liamappelbe is the right person to review this.

@natebosch natebosch merged commit 8083c8f into master Oct 3, 2025
66 of 68 checks passed
@natebosch natebosch deleted the hide-coverage-import branch October 3, 2025 22:28
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Oct 6, 2025
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (https://github.com/dart-lang/dartdoc/compare/669b15f..ec2a4fe):
  ec2a4fee  2025-10-06  dependabot[bot]  Bump test_reflective_loader from 0.2.3 to 0.4.0 (dart-lang/dartdoc#4111)
  2ec3e4ef  2025-10-02  Konstantin Scheglov  Stop using TypeDefiningElement. (dart-lang/dartdoc#4112)
  f65c7e21  2025-10-01  dependabot[bot]  Bump the github-actions group with 3 updates (dart-lang/dartdoc#4113)

ecosystem (https://github.com/dart-lang/ecosystem/compare/36e514d..96ee861):
  96ee861  2025-10-02  Devon Carew  misc repo metadata updates (dart-lang/ecosystem#372)
  0d7ffaa  2025-10-02  Moritz  Rename comments (dart-lang/ecosystem#373)
  a3cf960  2025-10-01  dependabot[bot]  Bump the github-actions group with 5 updates (dart-lang/ecosystem#374)

test (https://github.com/dart-lang/test/compare/a16f149..8083c8f):
  8083c8f2  2025-10-03  Nate Bosch  Make all package:coverage imports conditional (dart-lang/test#2544)

tools (https://github.com/dart-lang/tools/compare/ce9d2ad..6866f9b):
  6866f9b1  2025-10-06  Morgan :)  Allow more time for tests on Windows. (dart-lang/tools#2193)
  1264445e  2025-10-06  Morgan :)  Fix flaky test on Windows. (dart-lang/tools#2192)

webdev (https://github.com/dart-lang/webdev/compare/0b2a408..29ba1b1):
  29ba1b12  2025-10-01  dependabot[bot]  Bump the github-actions group with 3 updates (dart-lang/webdev#2693)

Change-Id: I9582b0380b2b974a2d05ab4f77c67c14e92aaa63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/453580
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants