air-verse / air

☁️ Live reload for Go apps
GNU General Public License v3.0
16.53k stars 779 forks source link

Air doesn't work with Colima #420

Closed zachgrayio closed 9 months ago

zachgrayio commented 1 year ago

For air users hoping to use Colima as a replacement for Docker Desktop for Mac, unfortunately today the two don't work together, because file change events from Colima are sent as an event type that's filtered out by air, as is discussed here. https://github.com/abiosoft/colima/issues/261#issuecomment-1502492874

To make this work, the chmod events from inotify via fsnotify need to be consumed by air and trigger a reload; today they are the 1 event type that is filtered out. #418 fixes this by removing the code which was filtering chmod/modified events.

Thanks!

abdil1234 commented 1 year ago

hi, any update for this issue?

xiantang commented 1 year ago

sorry I use orbstack, I think it's better replacement for Docker Desktop for mac.

zachgrayio commented 1 year ago

Looks like the fix was merged 15 days ago so this should be working in the next release or built from source on main branch?

lorandfazakas commented 1 year ago

Hi @zachgrayio , As far as I can see the fix was reverted in v1.44.0 because it caused other issues. As a result Air is still not working with Colima. Any plans to fix this in the near future?

xiantang commented 9 months ago

I think v1.46.0 should fixed

markgeejw commented 7 months ago

It’s still not working.

The chmod event is filtered away due to the validEvent check. @cosmtrek commented that the check can’t be removed due to the checksum in the PR. Can this be explained more so I could maybe work on it too.

choznerol commented 6 months ago

The existing poll option can workaround this perfectly for me.

// .air.yaml

+ # Use polling instead of fsnotify to workaround Colima comptibility issue:
+ # - https://github.com/cosmtrek/air/issues/420
+ poll = true
+ poll_interval = 500    # ms

P.s. M1, Sonoma 14.2, Colima at 0.6.7, air at devel