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

Automatically restart build_runner watch after pub get is exected #3454

Open
rrousselGit opened this issue Feb 7, 2023 · 3 comments
Open

Comments

@rrousselGit
Copy link

Hello!

Currently when using build_runner watch, the command will quit if a dependency change is detected.
This is understandable, but at the same time problematic.

The build_runner watch command is typically a command which we start once, and leave it running in the background without looking at it.
So if the command inadvertently stops, it's easy to forget to restart it, which can cause a bit of confusion.
It doesn't help that many times, the dependency change has no impact on the execution of build_runner. As it's likely a dependency added for the application, not a new generator or an analyzer/build_runner version change.

Would it be possible for the command to automatically restart itself when a dependency change is detected?
Or alternatively, if that is technically challenging, could the exit be made optional?

@rrousselGit
Copy link
Author

rrousselGit commented Feb 7, 2023

More niche, but I think this could be extended to plugin compilation errors too.

While working on code generators, it's common that for a few seconds when making changes, one file in the sources of a plugin has an error.
The error is only temporary and will be fixed soon. But this quits the watch mode. So the command has to be restarted after fixing it, which is a bit of a pain

I've ended up voluntarily not saving files as often as I'd like to, just to bypass this problem.

@jakemac53
Copy link
Contributor

There is a hidden option --skip-build-script-check which should do what you want (just ignore build script changes)

@jakemac53
Copy link
Contributor

Having it auto-restart by default would be nice though, and I actually thought we already supported this? The main entrypoint will just regenerate and re-run as long as the exit code is 75. Maybe we aren't setting that appropriately?

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