The Automatic (but unsupported) Way: winstrap
The winstrap tool is used by the Go project to turn a fresh Windows VM image into a Windows builder. It installs all necessary dependencies. It's sometimes out of date, though, as it's only updated when we need to update the Windows base image for the Go continuous build.
To use winstrap, download the latest version of winstrap.exe from the winstrap page and run it.
It will download some installers to your desktop, which you should run. Just click through; all the defaults are fine.
Then it will check out Go and place it in c:\Users\%USER%\goroot and build it.
That's it.
Note however that winstrap is not supported. It's considered an internal tool used for occasional setup of new Windows builder images and is not actively maintained until we need it ourselves.
The Manual Way
Install MinGW/MSYS
Download and save the latest version of the automated MinGW installer executable (exe) file from SourceForge.
http://sourceforge.net/projects/mingw/files/OldFiles/mingw-get-inst/
Open and run the saved automated MinGW installer executable file, which is named mingw-get-inst-yyyymmdd.exe, where yyyymmdd is the version date stamp. For example, mingw-get-inst-20110530.exe.
The MinGW Setup Wizard window will open with the title "Setup - MinGW-Get". Except for the following, accept the setup defaults, unless it's necessary to change them.
For Repository Catalogues, check the Download latest repository catalogues button.
For Select Components, the MinGW Compiler Suite, the C Compiler box is automatically checked. Scroll down to the bottom of the list and check the MinGW Developer Toolkit box, which includes the MSYS Basic System.
For Ready to Install, review and verify the installation settings, which should look similar this:
Installing:
mingw-get
pkginfo
C Compiler
MSYS Basic System
MinGW Developer Toolkit
Downloading latest repository catalogues
Destination location:
C:\MinGW
When the installation settings are correct, Install.
The installation loads the package installation catalogues and downloads and installs the files. The installation may take some time, largely depending on the download speed.
The MSYS terminal window may be opened by opening and running the C:\MinGW\msys\1.0\msys.bat batch file.
Build
git clone https://go.googlesource.com/go
cd go\src
all.bat
64-bit Notes
- Ensure you are able to compile a working 32-bit Go first.
- Grab the latest zip from http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/ and extract it over the MinGW directory, so that for example the .exe files end up in the same location as the 32-bit ones.
- Replace
gcc.exeandar.exewith their 64-bit counterparts. - Set
GOARCH=amd64and away you go!
AVX512 Articles AssemblyPolicy Benchmarks Blogs Books BoundingResourceUse CSSStyleGuide ChromeOS CodeReview CodeReviewComments CodeReviewConcurrency CodeTools Comments CommitMessage CommonMistakes CompilerOptimizations Conferences Configuring GoLand for WebAssembly Contributing to gopls CoreDumpDebugging Courses CreatingSubRepository CustomPprofProfiles Darwin DashboardBuilders Deprecated DesignDocuments Diagnostics Download build farm failed logs and debugging DragonFly BSD ErrorValueFAQ Errors ExperienceReports FileTreeDocumentation FreeBSD FromXToGo Frozen Fuzzing trophy case GOPATH Gardening GcToolchainTricks GccgoCrossCompilation GerritAccess GerritBot GithubAccess Go 1.10 Release Party Go 1.6 release party Go 1.8 Release Party Go Community Slides Go Release Cycle Go2 Go2ErrorHandlingFeedback Go2ErrorValuesFeedback Go2GenericsFeedback GoArm GoForCPPProgrammers GoGenerateTools GoGetProxyConfig GoGetTools GoMips GoStrings GoTalks GoUserGroups GoUsers Gomote Gopher HandlingIssues Home HostedContinuousIntegration How to ask for help HowToAsk IDEsAndTextEditorPlugins InstallFromSource InstallTroubleshooting InterfaceSlice InvalidFlag Iota Learn LearnConcurrency LearnErrorHandling LearnServerProgramming LearnTesting Linux LinuxKernelSignalVectorBug Livestreams LockOSThread MacOS12BSDThreadRegisterIssue MethodSets MinimumRequirements MinorReleases Mobile Modules MutexOrChannel NativeClient NetBSD NewSpeakers NoMeToo NoPlusOne NonEnglish OpenBSD PackagePublishing PanicAndRecover PerfDashboard Performance Plan9 Podcasts PortingPolicy PriorDiscussion Projects Proposals ProviderIntegration Questions Quiet Weeks Range RateLimiting ResearchPapers Resolving Problems From Modified Module Path Resources for slog SQLDrivers SQLInterface Screencasts SettingGOPATH SignalHandling SimultaneousAssignment SliceTricks SlowBots Solaris Spectre Spelling Style SuccessStories Switch TableDrivenTests TargetSpecific TestComments TestFailures Timeouts Training Ubuntu Watchflakes WebAccessibilityResourcesAndTips Well known struct tags WhyGo Windows WindowsBuild WindowsCrossCompiling WindowsDLLs X Repositories _Footer cgo golang tools gopherbot gopls integrator FAQ gopls heapdump13 heapdump14 heapdump15 through heapdump17 heapdump15