cespare / reflex

Run a command when files change
MIT License
3.35k stars 135 forks source link

Not working with Go 1.15.0 #77

Closed feketegy closed 4 years ago

feketegy commented 4 years ago

Upgraded Go to 1.15.0 in alpine linux 3.12 and I'm getting this error: "Setctty set but Ctty not valid in child" for a http application.

The command used: reflex -r '.\.go' -R '._test\.go' -d 'none' -s my-binary start

If I downgrade to Go 1.14.7 it works as expected.

As far as I can tell there were some modifications made in the syscall package in Go 1.15.0, specifically from the docs:

On Unix systems, functions that use SysProcAttr will now reject attempts to set both the Setctty and Foreground fields, as they both use the Ctty field but do so in incompatible ways. We expect that few existing programs set both fields.

Setting the Setctty field now requires that the Ctty field be set to a file descriptor number in the child process, as determined by the ProcAttr.Files field. Using a child descriptor always worked, but there were certain cases where using a parent file descriptor also happened to work. Some programs that set Setctty will need to change the value of Ctty to use a child descriptor number.

Source: https://golang.org/doc/go1.15

cespare commented 4 years ago

@feketegy thanks for the report. I think that 456b3718abbf1922cfbd498521c27851250f5496 should fix it. Would you mind updating to latest master and trying it out?

Unfortunately I didn't seem to be able to reproduce the problem myself with Go 1.15.

feketegy commented 4 years ago

@cespare it's working, thanks!

cespare commented 4 years ago

Glad to hear it. I tagged v0.3.0.