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

Add cross compilation target/release for MIPS #60

Closed
ijustlovemath opened this issue Aug 17, 2021 · 2 comments
Closed

Add cross compilation target/release for MIPS #60

ijustlovemath opened this issue Aug 17, 2021 · 2 comments

Comments

@ijustlovemath
Copy link

Hi, I'm trying to use this tool from my dd-wrt box, which runs MIPS. I'm going to try and cross compile it and will submit a PR if I get it to work successfully, but it would be nice to have a MIPS release!

@ijustlovemath
Copy link
Author

I was able to compile this for my system (an Archer-C7) with the following cpuinfo:

system type             : Qualcomm Atheros QCA9558 ver 1 rev 1.0 (0x1130)
processor               : 0
cpu model               : MIPS 74Kc V5.0

using the following build command:

GOOS=linux GOARCH=mips GOMIPS=softfloat go build

I then transferred it from the host by running:

on host: python3 -m http.server

on dd-wrt: curl 192.168.x,y:8000/speedtest-go --output speedtest && chmod +x ./speedtest && ./speedtest

This resulted in the following error:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 8279k  100 8279k    0     0  25.7M      0 --:--:-- --:--:-- --:--:-- 25.8M
Warning: Cannot fetch user information. http://www.speedtest.net/speedtest-config.php is temporarily unavailable.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x4 pc=0x346720]

goroutine 1 [running]:
main.showUser(0x0)
        /home/jer/go/src/github.com/showwin/speedtest-go/speedtest.go:138 +0x30
main.main()
        /home/jer/go/src/github.com/showwin/speedtest-go/speedtest.go:36 +0x438

Presumably this is because FetchUserInfo() returns nil and the program continues executing. On this system, the result of

curl http://www.speedtest.net/speedtest-config.php is empty, so it may be something having to do with the user agent settings that's making this fail.

As a fun side note, I realised that this system came already equipped with speedtest_cli, so I'm going to just use that instead! But hopefully this issue will help improve your software.

Happy to test any fixes on this system for you, if you decide to try making a fix.

@showwin
Copy link
Owner

showwin commented Feb 20, 2022

@ijustlovemath
Thank you for your proposal!

About this error

Warning: Cannot fetch user information. http://www.speedtest.net/speedtest-config.php is temporarily unavailable.

#63 change will solve the problem.

and of course I welcome to have a MIPS release. Currently, we use goreleaser-action plugin here, so I'm glad if we can pass some option to get MIPS release.

@showwin showwin closed this as completed Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants