-
Notifications
You must be signed in to change notification settings - Fork 249
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
When spin watch
terminates spin up, allow it to delete its temp dir
#1723
When spin watch
terminates spin up, allow it to delete its temp dir
#1723
Conversation
Well there's a bug where the docs site makes it go into an infinite loop so we're off to a flying start. ETA: It looks like what is happening is that a component |
@itowlson I'll take a look at this when I get a chance, but I won't have time today. Thanks for diving so deep on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @itowlson! I think we're headed in the right direction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I responded to your comments and took another pass over your changes. I think we're getting close. The only stuff that I really feel is still blocking is the ignore list work.
de232b5
to
f588c1c
Compare
@calebschoepp I think this addresses everything. I have left the commit history intact for now so you can see changes since first review if that's useful; if approved, I'll squash before merging (well if I remember anyway). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @itowlson , LGTM! Ship it 🚢
@calebschoepp I implemented your fix for the Mac source notification issue. It Works On My Machine(s) TM, but if you have time to test it on yours, that would greatly increase my confidence. Thanks! |
I built latest on this branch and we no longer get the infinite looping behaviour. I'm seeing one infinite loop bug persist though. I sent you a video of it in Slack. |
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
39085d4
to
cfa75c4
Compare
Fixes #1698.
A previous crack at this in #1711 ran aground on sychronising the
spin build
andspin up
processes whenspin up
was terminating asynchronously. I couldn't get the watch state to remain in sync with whatwatchexec
thought it was doing, resulting in either missed file changes or missed restarts.This is, I'm afraid, a more dramatic rework, and therefore carries a higher risk - the more so because, unlike the original implementation, it does not abstract notifications or defunctionalise process control, and so it way less amenable to unit testing. I'm not sure how to address that - I'd welcome ideas. On the plus side, the individual components at work here are rather more simple-minded, so hopefully less in need of unit testing once the inevitable initial bugs have been shaken out.
The change in strategy is twofold:
watchexec
watching all interesting files, and patching up "what command is watchexec running" depending on what files have changed, this now uses two separate watchexecs, one watching artifact files, one watching build files.spin up
until the build is complete.This means that the processor tasks are much less dependent on state than the previous implementation - they are pretty much simple loops going round and round waiting for the change notifications they're interested in and starting or restarting a child process. (The only piece of state that needs to be passed between notifications is "don't clear the screen because build just did".)
This has so far been tested only on a small Rust application. Next step is to try it on something like the docs site, where the build process makes much more far-reaching changes to the artifacts. It should also adopt some of the "stupid operating system does what" patches from the previous implementation!
In the meantime I'm putting this out for folks to kick the tyres and yell at the design/implementation. @calebschoepp needless to say, I would particularly value your experience and insight on the practicalities as well as the design!