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

Add minimal AnalysisDriverModel implementation #3814

Merged

Conversation

davidmorgan
Copy link
Contributor

@davidmorgan davidmorgan commented Feb 1, 2025

For #3811, review and merge #3813 first.

Make resolver_test.dart test AnalysisDriverModel exactly like it tests BuildAssetUriResolver.

Add minimal implementation to AnalysisDriverModel to make the tests pass.

Add TODOs where there is functionality not covered by tests that is therefore not added.

This implementation does work for real builds, a local edit to point BuildAssetUriResolver.shared to AnalysisDriverModel is enough to make the benchmarks run. Because there is no caching in the new implementation at all, it's slower :) which gives us a good starting point to add caching.

Copy link

github-actions bot commented Feb 1, 2025

Package publishing

Package Version Status Publish tag (post-merge)
package:build 2.4.2 already published at pub.dev
package:build_config 1.1.2 already published at pub.dev
package:build_daemon 4.0.3 already published at pub.dev
package:build_modules 5.0.11 already published at pub.dev
package:build_resolvers 2.4.4-wip WIP (no publish necessary)
package:build_runner 2.4.15-wip WIP (no publish necessary)
package:build_runner_core 8.0.1-dev ready to publish build_runner_core-v8.0.1-dev
package:build_test 2.2.4-wip WIP (no publish necessary)
package:build_web_compilers 4.1.1 already published at pub.dev
package:scratch_space 1.0.3-wip WIP (no publish necessary)

Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

Copy link

github-actions bot commented Feb 1, 2025

PR Health

Changelog Entry ✔️
Package Changed Files

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

@davidmorgan davidmorgan force-pushed the test-analysis-driver-model branch 4 times, most recently from 75be8cf to 3bc0a58 Compare February 3, 2025 13:39
tests `BuildAssetUriResolver`.

Add minimal implementation to `AnalysisDriverModel` to make the tests pass.

Add TODOs where there is functionality not covered by tests that is
therefore not added.
@davidmorgan davidmorgan force-pushed the test-analysis-driver-model branch from 3bc0a58 to 0797e9e Compare February 3, 2025 13:41
@davidmorgan davidmorgan marked this pull request as ready for review February 3, 2025 13:51
Copy link
Contributor Author

@davidmorgan davidmorgan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

build_resolvers/lib/src/analysis_driver_model.dart Outdated Show resolved Hide resolved
build_resolvers/lib/src/analysis_driver_model.dart Outdated Show resolved Hide resolved
Copy link
Contributor

@jakemac53 jakemac53 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgmt, test diff was a bit weird but it looked like no substantive changes, if there was something you wanted me to look at let met know

final nextId = nextIds.removeFirst();

// Skip if already seen.
if (!result.add(nextId)) continue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid putting these in the queue in the first place instead? There could be a lot of duplicates otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

if (!result.add(nextId)) continue;

// Skip if not readable.
if (!await reader.canRead(nextId)) continue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth leaving a comment that this does add the dependency on nextId just from checking for its existence

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor Author

@davidmorgan davidmorgan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

final nextId = nextIds.removeFirst();

// Skip if already seen.
if (!result.add(nextId)) continue;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

if (!result.add(nextId)) continue;

// Skip if not readable.
if (!await reader.canRead(nextId)) continue;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@davidmorgan davidmorgan merged commit 5c1ddd4 into dart-lang:master Feb 4, 2025
75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants