Build it natively! No more emulators or even WSL, just build it from source using mingw64 on Windows 10 x64. Learn more by following this step-by-step tutorial:
Source code to synced in about 30 minutes! (depending on your build environment, use of Fast Catchup and network speed)
Please let us know how it’s going in the comments below…
@fabrice Thanks for pointing me in the right direction. It looks like during the install a separate ‘go’ folder was created in my windows Users directory and so there were some files in ‘C:\Users\peter\go’ and some in ‘C:\msys64\home\peter\go’. I manually copied the folder contents from Users into Home and then ‘make’ was able to locate the missing dependencies.
@mxmauro I cloned the repo and copied over the three files
makefile
scripts/build_package.sh
scripts/configure_dev-deps.sh
Went through without a hitch running ./scripts/configure_dev.sh with those changes. Everything correctly copied into C:\msys64\home\peter\go\bin rather than my %USERPROFILE% directory.
At the last step, it says goal or go isn’t a recognised command. What could be the reason for this? I added it to the system and user Path variable in windows.
also i’m having trouble with the linux go path.
I ran the echo command, and my .bashrc has
“export GOPATH=$HOME/go” at the end of the file.
However, go env still shows
“set GOPATH=C:/msys64/home/User/go”
I’ve tried it many times closing the terminal line ect, it still won’t do anything.
I’m having a few issues with getting this installed properly and I’d like to do the process so that it doesn’t require copy and pasting of files to repeat. I think some of the paths are wrong and perhaps inconsistent between runs. I’ve had issues where I would run the configure_dev script and not all libraries downloaded. Most of all I’ve had the issue that @Genma_Saotome mentioned above where there are missing dependencies.
I’ve cleaned my workspace and re-ran the installation from the beginning a few times and I’ve boiled down installation to:
**Install and Configure msys2**
* Update package database and base packages: pacman -Syu
* Update the rest of the packages: pacman -Su
* Install base dev packages: pacman -S --needed base-devel
* install gcc and make: pacman -S --needed mingw-w64-x86_64-toolchain
* install Git: pacman -S --disable-download-timeout --noconfirm git
* install go: pacman -S --disable-download-timeout --noconfirm mingw-w64-x86_64-go
* update .bashrc with path to local go install and remap gopath var to local install:
* export PATH=$PATH:/c/msys64/mingw64/lib/go/bin
* export GOPATH=$HOME/go
This is where my first questions is:
Are these paths correct? If I put just the “export GOPATH” line in the bashrc file (like the instructions say), when I run msys it cant find go. When I add the updated path to point to the local go installation, Go is recognized but I’m not sure if that throws off everything else.
My second question is:
In the check_deps.sh file, when creating the path to the go bin, I assume it’s supposed to point to the local msys installation. However when this is run: GO_BIN="$(echo “GOPATH" | cut -d: -f1)/bin" it results in GO_BIN being "C:\bin" which, obviously, doesn't point to where the local go/bin directory is. The current GOPATH variables points to a location that go is not actually installed. Should this be GO_BIN = "(go env GOROOT)”/bin instead? If not, am I doing something wrong in the installation phase of things that is putting the installations in the wrong place?
When you install Go with pacman, it should add the path automatically. Take into account MSYS2 installs three consoles, MSYS, MinGW 32-bit and MinGW 64-bit. In order to work, you must use MinGW 64-bit else bashrc scripts are different.
Manual addition of GOPATH is necessary because else Go dependencies are installed on the real user profile instead of the MSYS2 environment. And you must restart the console afterwards.
The second questions seems to be related to the different consoles MSYS2 has. First I recommend to follow steps here.