realize icon indicating copy to clipboard operation
realize copied to clipboard

Cannot do `--run` with go1.11 using go mod under windows.

Open DarthPestilane opened this issue 5 years ago • 17 comments

------------ directory: -- main.go -- go.mod

main.go:

package main

import "fmt"

func main() {
    fmt.Println("hello")
}

start realize:

realize start --run --nc

error shows:

[10:54:52][TEST] : Watching 1 file/s 0 folder/s
[10:54:52][TEST] : Install started
[10:54:52][TEST] : Install
 exec: not started

But when I remove go.mod, everything works fine.

DarthPestilane avatar Sep 21 '18 02:09 DarthPestilane

realize version: 2.0.3

DarthPestilane avatar Sep 21 '18 02:09 DarthPestilane

Ok, glad I wasn't the only one experiencing this. I was going mad trying to figure out why this tool wouldnt work :)

chrisgoffinet avatar Sep 23 '18 02:09 chrisgoffinet

And it's not only for windows, but mac also. Please fix this as soon as possible. Thanks!

DarthPestilane avatar Sep 28 '18 01:09 DarthPestilane

Same on Linux

dlq84 avatar Oct 03 '18 08:10 dlq84

Any news?

Nicolab avatar Oct 14 '18 09:10 Nicolab

If I recall correctly I was able to workaround by trying...

$ GO111MODULE=auto|off|on realize start ...

Can't remember which flag I set for realize to work, try different values to see if it works for you.

mikegleasonjr avatar Oct 15 '18 10:10 mikegleasonjr

I had to go get -d github.com/oxequa/realize and checkout to v2.0.2 then reinstalled manually. Finally, it works again.

But realize --version shows Realize version 2.1. Wired.

DarthPestilane avatar Oct 16 '18 02:10 DarthPestilane

related to #207

llonchj avatar Oct 31 '18 21:10 llonchj

I'm getting project not found when doing what @DarthPestilane suggested. Any ideas?

mraerino avatar Nov 03 '18 17:11 mraerino

thanks for the support and for the reports, in the last months we had some company changes but in the first trimester 2019 we will release a new version

asoseil avatar Dec 10 '18 18:12 asoseil

if anyone’s looking for a quick and dirty solution before this is resolved, i’ve put together some shell scripts into a makefile/docker image which you can find at https://github.com/zephinzer/golang-dev

zephinzer avatar Dec 20 '18 16:12 zephinzer

@Asoseil everything ok? Is this project still alive?

frederikhors avatar Dec 28 '18 17:12 frederikhors

@all, Any workaround on this until new version will fix?

frederikhors avatar Dec 28 '18 17:12 frederikhors

@frederikhors https://github.com/cortesi/modd

llonchj avatar Dec 29 '18 07:12 llonchj

I came up with this issue as well and worked out a solution. realize executes go install to rebuild your project into $GOPATH/bin first before actually running it. When you are using go modules, go install fails because there is no longer $GOPATH, thus "exec: not started".

As a workaround, you can modify your .realize.yaml like this:

commands:
  install:
    status: true
    method: go build -o <path/to/built/binary>
  run:
    status: true
    method: <path/to/built/binary>

evshiron avatar Jan 31 '19 03:01 evshiron

I happened to the same issue. Finally, I realized that the trash .go file was the troublemaker. I used the feature of VSCode to generate history file to .history folder. Inside .history folder there are a lot of .go files. After I added .history to ignore list (.realize.yaml). Everything works well. if someone also using the feature of VScode, you could have a try.

  watcher:
    extensions:
    - go
    paths:
    - /
    ignore:
      paths:
      - .git
      - .realize
      - vendor
      - .history

xiangrui-zeng avatar Oct 29 '19 06:10 xiangrui-zeng

➜ xgk-wechat-go-gin git:(master) realize s [07:36:42][REALIZE] : Started on localhost:5002 ⇨ http server started on 127.0.0.1:5002 [07:36:42][XGK-WECHAT-GO-GIN] : Watching 12 file/s 13 folder/s [07:36:42][XGK-WECHAT-GO-GIN] : Command "pkill xgk-wechat-go-gin"

[07:36:42][XGK-WECHAT-GO-GIN] : Install started [07:36:44][XGK-WECHAT-GO-GIN] : Install completed in 1.574 s [07:36:44][XGK-WECHAT-GO-GIN] : Running.. panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x10cbc0b]

goroutine 14 [running]: os.(*Process).signal(0x0, 0x16745a0, 0x19b8a60, 0x0, 0x0) /usr/local/opt/go/libexec/src/os/exec_unix.go:56 +0x3b os.(*Process).Signal(...) /usr/local/opt/go/libexec/src/os/exec.go:131 github.com/oxequa/realize/realize.(*Project).run.func1(0xc0004a9698) /Users/yongze/go/src/github.com/oxequa/realize/realize/projects.go:581 +0x5c github.com/oxequa/realize/realize.(*Project).run(0xc0001e8000, 0xc00015d140, 0x11, 0xc000288540, 0xc00014a4e0, 0x166fa40, 0xc000496020) /Users/yongze/go/src/github.com/oxequa/realize/realize/projects.go:646 +0xc2d github.com/oxequa/realize/realize.(*Project).Reload.func3(0xc0001e8000, 0xc000288540, 0xc00014a4e0) /Users/yongze/go/src/github.com/oxequa/realize/realize/projects.go:262 +0x147 created by github.com/oxequa/realize/realize.(*Project).Reload /Users/yongze/go/src/github.com/oxequa/realize/realize/projects.go:260 +0x297

chenyongze avatar Jun 28 '20 23:06 chenyongze