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

Emit a warning when a builder is not run due to defaultRootPackageSources #3353

Open
aran opened this issue Aug 16, 2022 · 2 comments
Open

Comments

@aran
Copy link

aran commented Aug 16, 2022

When developing a new Builder, if the chosen build_extensions fall outside of defaultRootPackageSources, the builder does not run. Even when stepping through the build process in the debugger, it is not easy to see why. In this situation, it would be helpful to the new Builder developer to emit some kind of warning so it is not a silent failure, perhaps in --verbose mode. Adding some discussion of defaultRootPackageSources to the documentation and examples would help as well.

  • dart --version Dart SDK version: 2.19.0-edge.a547cfc0969ea9baca14529670dd553ad810131c (be) (Mon Aug 15 16:13:46 2022 +0000) on "macos_x64"
  • build 2.3.0, build_runner 2.2.0
  • I encountered this while writing a simple builder that input a configuration file in the project root and emitted dart code for those configuration values into lib/
@jakemac53
Copy link
Contributor

Sorry for the extremely late reply here, this issue was missed at the time it was filed it seems.

I am not sure exactly what action to take beyond documentation here, we don't look at all at files outside the listed ones (these could be huge trees of hidden files etc, its just not worth doing).

I could see adding some documentation, do you have a suggestion for where or what that should look like?

@jakemac53 jakemac53 added the needs-info Additional information needed from the issue author label Sep 1, 2023
@aran
Copy link
Author

aran commented Sep 1, 2023

I don't have a good enough understanding of the project goals and constraints to make great suggestions. But here are a few half-baked ideas:

  • track which sources result in outputs, and note (in --verbose?) which entries in sources do not result in outputs.
  • track which extensions in build_extensions do not result in builders being selected and warn.
  • for each builder that is available does not run, in --verbose output the combo of sources/build_extensions/anything else that were considered.
  • edit https://github.com/dart-lang/build/blob/master/build_config/README.md to document the default sources under the "sources" section, and in the build_extensions section, outline the algorithm for what is considered.
  • It's been a while, but I think my issue was something like making a stupid simple configuration with somethign like build_extensions: {".txt": [".txt.copy"]} and then putting a '.txt' file in the project root, and having nothing happen but also no errors.

@github-actions github-actions bot removed the needs-info Additional information needed from the issue author label Sep 2, 2023
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

No branches or pull requests

2 participants