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

Allow builder authors to define custom "environment checks" #961

Open
natebosch opened this issue Feb 5, 2018 · 6 comments
Open

Allow builder authors to define custom "environment checks" #961

natebosch opened this issue Feb 5, 2018 · 6 comments
Labels
P3 A lower priority bug or feature request package:build_runner type-enhancement A request for a change that isn't a bug

Comments

@natebosch
Copy link
Member

These would run before a build (maybe not every time though?) and would give a hook to check on the user's environment and offer help.

Some examples:

  1. built_value could check that built_value_generator is in the dependencies so that it's builder will run.
  2. A proto compiler could check that the executable is installed an in $PATH and either give a nice error message or offer to install the tools.

We'd want these to be isolated from the rest of the build.

@natebosch natebosch added type-enhancement A request for a change that isn't a bug P3 A lower priority bug or feature request package:build_runner labels Feb 5, 2018
@matanlurey
Copy link
Contributor

I really like this idea, sort of a "doctor"-plugin.

@natebosch
Copy link
Member Author

Bonus points if we can use the generic hooks to set up things for build_runner itself, like validation on the build.yaml file for #885

@jakemac53
Copy link
Contributor

Imo anything opting into this should be able to return a success/failure state in some form as well so we don't attempt a build if things aren't set up properly. Not sure if we would need a way of overriding that check or not.

@jakemac53
Copy link
Contributor

Also we talked offline but this should run in a separate isolate so that builders can't do bad things - that allows us to expose information to them in this phase that wouldn't otherwise be accessible (such as the package graph), without worrying about breaking hermetic builds.

@natebosch
Copy link
Member Author

We might also want to consider only running this with a special command pub run build_runner doctor. We could also maybe do it automatically before some builds like the first build after .packages changes.

@matanlurey
Copy link
Contributor

I'd love to see it happen when the build script would change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 A lower priority bug or feature request package:build_runner type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants