realize icon indicating copy to clipboard operation
realize copied to clipboard

Does not properly kill the executable on rebuild in Windows

Open cameracker opened this issue 6 years ago • 7 comments

On windows when realize detects that a file has been modified, it will correctly trigger a rebuild, but it is not guaranteed to kill the executable prior to the rebuild. If the executable has bound to network sockets, then this results in an error when the tool auto rebuilds:

image

Is there a work around available for this?

cameracker avatar Apr 05 '18 23:04 cameracker

The configuration for my run command is nothing really special, it looks like

schema:
- name: ...
  path: .
  commands:
    build:
      status: true
      dir: cmd/exec
    run:
      status: true
      dir: cmd/exec

Is there an additional option i need to put here for like a prerun that will kill the process?

cameracker avatar Apr 05 '18 23:04 cameracker

Could it be related to this? https://github.com/golang/go/issues/22381

cameracker avatar Apr 06 '18 00:04 cameracker

Hi Cameron, probably is related to golang/go#22381 but i'll make some test to confirm that

asoseil avatar Apr 06 '18 08:04 asoseil

Thanks for the follow up @Asoseil :)

We worked around it by introducing a before command that does:

scripts:
- type: before
  command: taskkill /im [executable].exe /F

But we're looking forward to getting rid of the hook hahah

cameracker avatar Apr 06 '18 22:04 cameracker

Any update?

vincentri avatar Jun 02 '18 18:06 vincentri

The issue still persists with the latest version. Any update on the this?

ayush987goyal avatar Oct 09 '18 10:10 ayush987goyal

Here is the solution, until it's merged to master use this on windows. https://github.com/oxequa/realize/pull/208

sumia01 avatar Oct 09 '18 10:10 sumia01