Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: switch to go mod compatible fork of forego #1603

Merged
merged 1 commit into from Jun 8, 2021
Merged

Chore: switch to go mod compatible fork of forego #1603

merged 1 commit into from Jun 8, 2021

Conversation

buchdag
Copy link
Member

@buchdag buchdag commented Apr 26, 2021

As discussed in #1579, forego isn't maintained anymore and lacks go module support. This project was already using a fork of forego by jwilder, so I decided to fork it again under the nginx-proxy org and merge in go mod support (thanks to @tkw1536) so that it can be used in this project and unblock building the image with golang >= 1.16.

@buchdag buchdag added type/build PR that affect the build system or external dependencies scope/dockerfile labels Apr 26, 2021
@buchdag buchdag force-pushed the forego branch 2 times, most recently from 94b8f87 to d068fd6 Compare April 26, 2021 23:44
@buchdag
Copy link
Member Author

buchdag commented Apr 26, 2021

@tkw1536 well that's back to the drawing board on this one, the forego version built by alpine fails.

@tkw1536
Copy link
Collaborator

tkw1536 commented Apr 27, 2021

I have no idea why the tests fail on alpine. The logs seem to imply that the container just crashes, but I can not reproduce this locally.

I have a strong suspicion that the changes could be caused by any of the commits introduced since v0.16.1. I will see when I have the time to investigate in more detail.

@buchdag
Copy link
Member Author

buchdag commented Apr 27, 2021

I will see when I have the time to investigate in more detail.

That's appreciated 👍

No pressure / hurry though, I think we should be fine staying on Go < 1.16 for a while.

@tkw1536
Copy link
Collaborator

tkw1536 commented Jun 7, 2021

It's been a while, but I finally got around to tracking why this happens.
I'm locally getting the following stacktrace:

fatal error: concurrent map writes
fatal error: concurrent map writes

goroutine 801 [running]:
runtime.throw(0x59c4c6, 0x15)
        /usr/local/go/src/runtime/panic.go:1116 +0x72 fp=0xc000284c40 sp=0xc000284c10 pc=0x4347d2
runtime.mapassign_faststr(0x574400, 0xc00018e570, 0x598c72, 0x4, 0x7)
        /usr/local/go/src/runtime/map_faststr.go:291 +0x3d8 fp=0xc000284ca8 sp=0xc000284c40 pc=0x413538
main.(*Forego).startProcess(0xc0001a6540, 0x1, 0x0, 0xc00019c120, 0x5, 0xc00019c127, 0x5, 0xc00018e570, 0xc00019c130)
        /go/forego/start.go:195 +0x235 fp=0xc000284e40 sp=0xc000284ca8 pc=0x5514b5
main.(*Forego).startProcess.func2(0xc0001a6540, 0xc000057260, 0x1, 0x0, 0xc00019c120, 0x5, 0xc00019c127, 0x5, 0xc00018e570, 0xc00019c130, ...)
        /go/forego/start.go:239 +0x1a5 fp=0xc000284f78 sp=0xc000284e40 pc=0x552a85
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1374 +0x1 fp=0xc000284f80 sp=0xc000284f78 pc=0x468aa1
created by main.(*Forego).startProcess
        /go/forego/start.go:233 +0x885

goroutine 1 [chan receive]:
main.runStart(0x6a81c0, 0xc0000101a0, 0x0, 0x0)
        /go/forego/start.go:329 +0x518
main.main()
        /go/forego/main.go:33 +0x26b

goroutine 17 [chan receive]:
main.(*Forego).monitorInterrupt(0xc0001a6540)
        /go/forego/start.go:157 +0x125
created by main.runStart
        /go/forego/start.go:284 +0x1a7

goroutine 7 [syscall]:
os/signal.signal_recv(0x0)
        /usr/local/go/src/runtime/sigqueue.go:147 +0x9d
os/signal.loop()
        /usr/local/go/src/os/signal/signal_unix.go:23 +0x25
created by os/signal.Notify.func1.1
        /usr/local/go/src/os/signal/signal.go:150 +0x45

goroutine 783 [running]:
        goroutine running on other thread; stack unavailable
created by main.(*Forego).startProcess
        /go/forego/start.go:233 +0x885

goroutine 783 [running]:
runtime.throw(0x59c4c6, 0x15)
        /usr/local/go/src/runtime/panic.go:1116 +0x72 fp=0xc000060c40 sp=0xc000060c10 pc=0x4347d2
runtime.mapassign_faststr(0x574400, 0xc00018e570, 0x598c72, 0x4, 0xb)
        /usr/local/go/src/runtime/map_faststr.go:291 +0x3d8 fp=0xc000060ca8 sp=0xc000060c40 pc=0x413538
main.(*Forego).startProcess(0xc0001a6540, 0x0, 0x0, 0xc0001b8000, 0x9, 0xc0001b800b, 0x5a, 0xc00018e570, 0xc00019c130)
        /go/forego/start.go:195 +0x235 fp=0xc000060e40 sp=0xc000060ca8 pc=0x5514b5
main.(*Forego).startProcess.func2(0xc0001a6540, 0xc0001cd500, 0x0, 0x0, 0xc0001b8000, 0x9, 0xc0001b800b, 0x5a, 0xc00018e570, 0xc00019c130, ...)
        /go/forego/start.go:239 +0x1a5 fp=0xc000060f78 sp=0xc000060e40 pc=0x552a85
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1374 +0x1 fp=0xc000060f80 sp=0xc000060f78 pc=0x468aa1
created by main.(*Forego).startProcess
        /go/forego/start.go:233 +0x885

But I don't know why this happens only on Alpine and not on Debian.

@tkw1536
Copy link
Collaborator

tkw1536 commented Jun 7, 2021

Ok, I've figured out what the problem is, the default shell under alpine does not seem to support all the features introduced in ddollar/forego@51d9f6d.

@tkw1536
Copy link
Collaborator

tkw1536 commented Jun 7, 2021

Going to do some minor cleanup on forego, and then make a PR.

@buchdag
Copy link
Member Author

buchdag commented Jun 8, 2021

Excellent news, thanks @tkw1536 ! 👍

@tkw1536
Copy link
Collaborator

tkw1536 commented Jun 8, 2021

See nginx-proxy/forego#2, we'll need to update this PR as well.

@buchdag
Copy link
Member Author

buchdag commented Jun 8, 2021

Do you recommend using -ldflags "-X main.osShell=sh" or -ldflags "-X main.osShell=ash" for Alpine ?

@buchdag
Copy link
Member Author

buchdag commented Jun 8, 2021

Well, both main.osShell=sh and main.osShell=ash stall the tests 😐

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope/dockerfile type/build PR that affect the build system or external dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants