You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use CompileDaemon with go generate, but have not been successful. I am running two instances of CompileDaemon to try accomplishing this. One instances watches the source files, which are .sql, and runs go generate when they change. The other watches all .go source files and runs go build. I believe my flags are set up so that the two are watching mutually exclusive files:
Hey @githubnemo, thank you for taking the time to respond, and sorry about the ambiguity. I am seeing CompileDaemon start another build as soon as it completes the first, and another after that, and so on. This issue occurs even if I run a single CompileDaemon process that runs a script as you describe.
My hypothesis is that because go generate alters .go files, the file watcher immediately queues another build while the first is running, and this continues forever. I might expect a single additional build to be queued when go generate changes watched files, but I'm not sure why it repeats after that. That said, I'm not familiar with the underlying implementation, so this could be totally off base.
Activity
githubnemo commentedon Sep 18, 2021
What do you mean with "an infinite loop"? It builds continuously?
I think in general it would be best to have the generate and build step in one pass as a script, no?
Something like this:
and have CompileDaemon run:
jameshochadel commentedon Sep 22, 2021
Hey @githubnemo, thank you for taking the time to respond, and sorry about the ambiguity. I am seeing CompileDaemon start another build as soon as it completes the first, and another after that, and so on. This issue occurs even if I run a single CompileDaemon process that runs a script as you describe.
My hypothesis is that because
go generatealters.gofiles, the file watcher immediately queues another build while the first is running, and this continues forever. I might expect a single additional build to be queued whengo generatechanges watched files, but I'm not sure why it repeats after that. That said, I'm not familiar with the underlying implementation, so this could be totally off base.Tiim commentedon Feb 10, 2024
Hi @jameshochadel, have you found a workaround for this in the meantime?
jameshochadel commentedon Feb 13, 2024
Hi @Tiim: Not to my knowledge, though it's been a few years. I've been using gow instead recently, although not with
go generate.