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

Move input tracking to BuildStep #3884

Merged

Conversation

davidmorgan
Copy link
Contributor

@davidmorgan davidmorgan commented Feb 26, 2025

For #3811.

Tracking of inputs is owned by BuildStepImpl, but the work is currently split across BuildStepImpl, SingleStepReader and the whole hierarchy of readers.

Part of the reason for the split is that BuildStepImpl is in package:build so it doesn't actually know about the types it needs to know about to do the work.

So, move it to build_runner_core, make it explicitly use SingleStepReader, including creating SingleStepReader without an AssetGraph for that use case.

Now tracking happens in exactly one place and is removed from AssetReader altogether.

Some tests need to know "what files were read" from readers that are not even part of a build; add this as test functionality to TestReaderWriter. Tests that do actually need access to InputTracker results get it via some global state which is not ideal, will see if I can come up with a better way in future PRs :)

@davidmorgan davidmorgan force-pushed the one-input-tracker-move-to-build-step branch from 91ac59f to cea571d Compare February 26, 2025 09:21
Copy link

github-actions bot commented Feb 26, 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 one-input-tracker-move-to-build-step branch 2 times, most recently from 143669f to ade6b2e Compare February 26, 2025 09:47
@davidmorgan davidmorgan force-pushed the one-input-tracker-move-to-build-step branch 3 times, most recently from 9e96d43 to d9a27c6 Compare February 26, 2025 10:25
`BuildStepImpl` always uses a `SingleStepReader`.
@davidmorgan davidmorgan force-pushed the one-input-tracker-move-to-build-step branch from d9a27c6 to c661cbc Compare February 26, 2025 10:39
@davidmorgan davidmorgan marked this pull request as ready for review February 26, 2025 10:53
@davidmorgan davidmorgan requested a review from jensjoha February 26, 2025 10:53
@davidmorgan davidmorgan merged commit 5948b20 into dart-lang:master Feb 26, 2025
76 checks passed
@davidmorgan davidmorgan deleted the one-input-tracker-move-to-build-step branch February 26, 2025 11:57
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.

2 participants