Gorilla Mux not working on RaspberryPi with Go 1.15.x

Hello.
I recently updated my Go library from v1.14.x to v1.15.3 in my Raspberry Pi 4.
All my projects using Gorilla Mux have stopped from working!
I always used Linux/ARMv6 versions of Go (not officially ported for Raspberry, I think) and until v1.14.x they worked.
You can test my issue with this simple piece of code:

package main

import (
	"net/http"
	"log"
	"github.com/gorilla/mux"
)

func main() {
	router := mux.NewRouter()
	log.Fatal(http.ListenAndServe(":12111", router))
}

Running go run main.go you obtain this error message:

# vendor/golang.org/x/crypto/poly1305
/home/pi/go/src/vendor/golang.org/x/crypto/poly1305/sum_noasm.go:10:7: undefined: newMAC

What’s happening?

Thank you, regards.

Cross checking with you:

  1. Is the Go compiler directly from golang.org or provided by OS?
  2. Since you’re using linux/armv6l, I’m assuming your Raspberry Pi is 3 and above, right?

If 1 is not, can you do an alignment with the go compiler setup according to the golang.org please? Experience from Ubuntu OS native package indicated that sometimes, OS maintainer tends to mess around with the compiler’s contents (e.g. shift out documents to match OS documentation place).

I do not have any issue with x86_64 with your source code.

u0:test$ go mod init test
go: creating new go.mod: module test
u0:test$ go get github.com/gorilla/mux                                                              
go: downloading github.com/gorilla/mux v1.8.0                                                       
go: github.com/gorilla/mux upgrade => v1.8.0                                                        
u0:test$ go run main.go 
^Csignal: interrupt 

Go version:

go version go1.15.2 linux/amd64
1 Like

The likely trigger for your issue:

poly1305/mac_noasm.go:

- func newMAC(key *[32]byte) mac { return mac{newMACGeneric(key)} }

poly1305/sum_noasm.go:

- h := newMAC(key)
+ h := New(key)

1 Like

Thanks @petrus. I think he did the right thing raising the issue to Gorilla https://github.com/gorilla/mux/issues/606 team. In that case, my concerns are invalid.

1 Like

Issue seems to have been fixed in Go 1.15.4.
Thank you all!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.