Files
go-legacy-win7/README.md

124 lines
7.4 KiB
Markdown
Raw Normal View History

2024-09-21 23:49:08 +10:00
# The Go Programming Language
2024-09-22 03:37:16 +10:00
**go-legacy-win7** is a fork of the Go programming language that maintains support for Windows 7 and Windows Server 2008 R2, and allows for deprecated `go get` behaviour. This project aims to provide a stable Go environment for users who need to support legacy Windows systems or prefer the traditional Go workflow.
2024-09-21 23:49:08 +10:00
![Gopher image](https://golang.org/doc/gopher/fiveyears.jpg)
2024-09-22 02:21:11 +10:00
_Gopher image by [Renee French][rf], licensed under [Creative Commons 4.0 Attribution licence][cc4-by]._
2024-09-21 23:49:08 +10:00
2024-09-22 02:21:11 +10:00
## Differences from Upstream Go
2024-09-21 23:49:08 +10:00
2024-09-22 03:37:16 +10:00
1. **Windows 7 and Windows Server 2008 R2 Support**
While the official Go project has dropped support for Windows 7 and Windows Server 2008 R2, this fork maintains compatibility with these legacy Windows systems.
2024-09-21 23:49:08 +10:00
2025-08-13 23:15:35 +07:00
Tested on Windows7 RTM (build7600) — no updates required — through Windows1124H2
2025-08-13 23:18:18 +07:00
2. **Classic `go get` Behaviour**
2024-09-22 02:21:11 +10:00
This fork allows for the deprecated `go get` behaviour when `GO111MODULE` is set to "off" or "auto". This means:
2024-09-21 23:49:08 +10:00
2024-09-22 02:21:11 +10:00
- In `GOPATH/src`, `go get` and `go install` can operate in `GOPATH` mode.
- Outside of `GOPATH/src`, these commands can use module-aware mode when appropriate.
2024-09-21 23:49:08 +10:00
2025-08-13 23:18:18 +07:00
3. **Compatibility Notes**
2024-09-22 03:37:16 +10:00
Please be aware that some newer Go features may not be fully compatible with Windows 7 or Windows Server 2008 R2. We try to maintain as much functionality as possible, but some limitations may exist.
2024-09-21 23:49:08 +10:00
2024-09-22 02:21:11 +10:00
## Changes in Each Release
2024-09-21 23:49:08 +10:00
2025-09-18 13:19:08 +08:00
Current release includes the following modifications:
2024-09-21 23:49:08 +10:00
2024-10-05 15:18:36 +10:00
- Switched back to RtlGenRandom from ProcessPrng, which breaks Win7/2008R2 (reverted [693def1](https://github.com/golang/go/commit/693def151adff1af707d82d28f55dba81ceb08e1))
2024-09-27 05:18:42 +10:00
- Added back LoadLibraryA fallback to load system libraries (reverted [a17d959](https://github.com/golang/go/commit/a17d959debdb04cd550016a3501dd09d50cd62e7))
2024-10-05 15:18:36 +10:00
- Added back sysSocket fallback for socket syscalls (reverted [7c1157f](https://github.com/golang/go/commit/7c1157f9544922e96945196b47b95664b1e39108))
- Added back Windows 7 console handle workaround (reverted [48042aa](https://github.com/golang/go/commit/48042aa09c2f878c4faa576948b07fe625c4707a))
2024-12-25 14:39:15 +07:00
- Added back 5ms sleep on Windows 7/8 in (\*Process).Wait (reverted [f0894a0](https://github.com/golang/go/commit/f0894a00f4b756d4b9b4078af2e686b359493583))
2024-09-27 05:18:42 +10:00
- Restored deprecated `go get` behavior for use outside modules (reverted [de4d503](https://github.com/golang/go/commit/de4d50316fb5c6d1529aa5377dc93b26021ee843))
2025-08-26 16:03:58 +07:00
- Reverted to the previous `removeall_noat` variant for Windows (fixed [issue #2](https://github.com/thongtech/go-legacy-win7/issues/2))
2025-09-18 13:19:08 +08:00
- Rolled back `race_windows.syso` to the previous compatible version (fixed [issue #3](https://github.com/thongtech/go-legacy-win7/issues/3))
2024-09-27 06:25:14 +10:00
- Includes all improvements and bug fixes from the corresponding upstream Go release
2024-09-27 05:18:42 +10:00
The Windows binary provided here also supports Windows 7 and Windows Server 2008 R2
2024-09-21 23:49:08 +10:00
2024-09-22 02:21:11 +10:00
## Download and Install
2024-09-21 23:49:08 +10:00
2024-09-22 02:21:11 +10:00
### Binary Distributions
2024-09-21 23:49:08 +10:00
2025-08-13 23:18:18 +07:00
| OS | Architecture | Filename | SHA256 Hash |
|----|--------------|----------|--------------|
| **macOS** | Intel (amd64) | [go-legacy-win7-1.25.4-1.darwin_amd64.tar.gz](https://github.com/thongtech/go-legacy-win7/releases/download/v1.25.4-1/go-legacy-win7-1.25.4-1.darwin_amd64.tar.gz) | `5b986a094fa2fd9ccf1b8fcad0dfe562eac717c0bcbb5a39fe67851b451d7350` |
| macOS | Apple (ARM64) | [go-legacy-win7-1.25.4-1.darwin_arm64.tar.gz](https://github.com/thongtech/go-legacy-win7/releases/download/v1.25.4-1/go-legacy-win7-1.25.4-1.darwin_arm64.tar.gz) | `68d73204059f87690421f1cdfb1e7f084c9dc02bf61ded3d513b3720cb07293b` |
| **Linux** | x86 (386) | [go-legacy-win7-1.25.4-1.linux_386.tar.gz](https://github.com/thongtech/go-legacy-win7/releases/download/v1.25.4-1/go-legacy-win7-1.25.4-1.linux_386.tar.gz) | `d953801804985b4c4f51eaae3aa275a36844710ed32d3a97492b0b409cdd2e49` |
| Linux | x64 (amd64) | [go-legacy-win7-1.25.4-1.linux_amd64.tar.gz](https://github.com/thongtech/go-legacy-win7/releases/download/v1.25.4-1/go-legacy-win7-1.25.4-1.linux_amd64.tar.gz) | `a8b4a8476264be4ca4bedd7937248e6202f0903b4bf62593d30239022710bed9` |
| Linux | ARM (32bit) | [go-legacy-win7-1.25.4-1.linux_arm.tar.gz](https://github.com/thongtech/go-legacy-win7/releases/download/v1.25.4-1/go-legacy-win7-1.25.4-1.linux_arm.tar.gz) | `a4f56f7af73ae6ac53730cb59c60c5cd8a538a3174e50cdde85e201a2716ed9f` |
| Linux | ARM64 | [go-legacy-win7-1.25.4-1.linux_arm64.tar.gz](https://github.com/thongtech/go-legacy-win7/releases/download/v1.25.4-1/go-legacy-win7-1.25.4-1.linux_arm64.tar.gz) | `bcb523e9feea546394b153102e03c6fef903b41ad61f2e995bd58fcc0bdc5701` |
| **Windows** | x86 (386) | [go-legacy-win7-1.25.4-1.windows_386.zip](https://github.com/thongtech/go-legacy-win7/releases/download/v1.25.4-1/go-legacy-win7-1.25.4-1.windows_386.zip) | `e71659dfea7e3c14b773f81d62804210a7eb1b97ffce1317daae745ea5cfe7d2` |
| Windows | x64 (amd64) | [go-legacy-win7-1.25.4-1.windows_amd64.zip](https://github.com/thongtech/go-legacy-win7/releases/download/v1.25.4-1/go-legacy-win7-1.25.4-1.windows_amd64.zip) | `ad88eea574495424cbbc461ee24cd7f1977dded1786bf28fba72d6d908f03a3a` |
| Windows | ARM64 | [go-legacy-win7-1.25.4-1.windows_arm64.zip](https://github.com/thongtech/go-legacy-win7/releases/download/v1.25.4-1/go-legacy-win7-1.25.4-1.windows_arm64.zip) | `803829126819b3983b7b07ff7873fb80cbb579fb4785677c942f309053fe4a5f` |
2024-09-22 02:21:11 +10:00
2025-08-13 23:15:35 +07:00
### Before you begin
To avoid PATH/GOROOT conflicts and mixed toolchains, uninstall any existing Go installation first.
2024-09-22 02:21:11 +10:00
#### Windows Installation
2024-09-27 06:25:14 +10:00
1. Download the `go-legacy-win7-<version>.windows_<arch>.zip` file.
2024-09-22 02:49:08 +10:00
2. Extract the ZIP to `C:\` (or any preferred location). This will create a `go-legacy-win7` folder.
2024-09-22 03:23:16 +10:00
3. Add the following to your system environment variables:
- Add `C:\go-legacy-win7\bin` (or your chosen path) to the system `PATH`.
- Set `GOROOT` to `C:\go-legacy-win7` (or your chosen path).
4. Add the following to your user environment variables:
- Add `%USERPROFILE%\go\bin` to the user `PATH`.
- Set `GOPATH` to `%USERPROFILE%\go`.
2024-09-22 02:21:11 +10:00
2024-09-22 02:28:39 +10:00
#### macOS and Linux Installation
2024-09-27 06:25:14 +10:00
1. Download the appropriate `go-legacy-win7-<version>.<os>_<arch>.tar.gz` file.
2024-09-22 02:28:39 +10:00
2024-09-27 06:25:14 +10:00
- For macOS: `go-legacy-win7-<version>.darwin_<arch>.tar.gz`
- For Linux: `go-legacy-win7-<version>.linux_<arch>.tar.gz`
2024-09-22 02:21:11 +10:00
2. Extract the archive to `/usr/local`:
2024-09-22 02:28:39 +10:00
2024-09-22 02:21:11 +10:00
```
2024-09-27 06:25:14 +10:00
sudo tar -C /usr/local -xzf go-legacy-win7-<version>.<os>_<arch>.tar.gz
2024-09-22 02:21:11 +10:00
```
2024-09-22 02:28:39 +10:00
2024-09-22 03:23:16 +10:00
3. Add the following to your shell configuration file:
2024-09-22 02:28:39 +10:00
2024-12-25 14:39:15 +07:00
- For bash, add to `~/.bash_profile` or `~/.bashrc`
- For zsh, add to `~/.zshrc`
2024-09-22 03:23:16 +10:00
2024-12-25 14:39:15 +07:00
```bash
export GOROOT=/usr/local/go-legacy-win7
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
```
2024-09-22 02:21:11 +10:00
2024-09-22 03:23:16 +10:00
4. Apply the changes:
- For bash: `source ~/.bash_profile` or `source ~/.bashrc`
- For zsh: `source ~/.zshrc`
2024-09-22 02:28:39 +10:00
Note:
2024-09-22 02:21:11 +10:00
2024-09-22 02:28:39 +10:00
- On macOS Catalina and later, zsh is the default shell.
- On most Linux distributions, bash is the default shell.
2024-09-22 02:21:11 +10:00
After installation, verify the installation by opening a **new terminal** and running:
```
go version
```
### Install From Source
To install from source, please follow the steps on the [official website](https://go.dev/doc/install/source).
## Contributing
Feedback and issue reports are welcome, and we encourage you to open pull requests to contribute to the project. We appreciate your help!
2024-09-21 23:49:08 +10:00
Note that the Go project uses the issue tracker for bug reports and
proposals only. See https://go.dev/wiki/Questions for a list of
places to ask questions about the Go language.
[rf]: https://reneefrench.blogspot.com/
[cc4-by]: https://creativecommons.org/licenses/by/4.0/