
* go.mod: update golang.org/x/tools to v0.1.8 Fixes TestGeneratedDoc on go1.18 * TeamCity: bump test matrix Add 1.18 to test matrix. Remove 1.15 from test matrix and from support range. * proc,tests: update for regabi on arm64 and 386 Make sure that stacktrace registers always contain the PC register of the current frame, even though the debug_frame rules might not specify it on architectures that use a link register. The PC register is needed to look up loclist entries for variable evaluation. * goversion: bump maximum supported Go version to 1.18 * proc: disable asyncpreempt on linux/arm64 Asyncpreempt on linux/arm64 can sometimes restart a sequence of instructions which will make breakpoint appear to be hit twice in some cases.
77 lines
2.7 KiB
PowerShell
77 lines
2.7 KiB
PowerShell
param (
|
|
[Parameter(Mandatory = $true)][string]$version,
|
|
[Parameter(Mandatory = $true)][string]$arch
|
|
)
|
|
|
|
Set-MpPreference -DisableRealtimeMonitoring $true
|
|
|
|
# Install Chocolatey
|
|
#Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
|
|
|
# Install MinGW.
|
|
choco install -y mingw --version 10.2.0
|
|
|
|
# Install Procdump
|
|
if (-Not(Test-Path "C:\procdump"))
|
|
{
|
|
mkdir C:\procdump
|
|
Invoke-WebRequest -UserAgent wget -Uri https://download.sysinternals.com/files/Procdump.zip -OutFile C:\procdump\procdump.zip
|
|
&7z x -oC:\procdump\ C:\procdump\procdump.zip > $null
|
|
}
|
|
|
|
$env:PATH += ";C:\procdump;C:\mingw64\bin"
|
|
|
|
function GetGo($version) {
|
|
$env:GOROOT = "C:\go\$version"
|
|
if (-Not(Test-Path $env:GOROOT))
|
|
{
|
|
$file = "$version.windows-$arch.zip"
|
|
$url = "https://dl.google.com/go/$file"
|
|
Invoke-WebRequest -UserAgent wget -Uri $url -OutFile $file
|
|
&7z x -oC:\go $file > $null
|
|
Move-Item -Path C:\go\go -Destination $env:GOROOT -force
|
|
}
|
|
}
|
|
|
|
if ($version -eq "gotip") {
|
|
#Exit 0
|
|
$latest = Invoke-WebRequest -Uri https://golang.org/VERSION?m=text -UseBasicParsing | Select-Object -ExpandProperty Content
|
|
GetGo $latest
|
|
$env:GOROOT_BOOTSTRAP = $env:GOROOT
|
|
$env:GOROOT = "C:\go\go-tip"
|
|
Write-Host "Building Go with GOROOT_BOOTSTRAP $env:GOROOT_BOOTSTRAP"
|
|
if (-Not(Test-Path $env:GOROOT)) {
|
|
git clone https://go.googlesource.com/go C:\go\go-tip
|
|
Push-Location -Path C:\go\go-tip\src
|
|
} else {
|
|
Push-Location -Path C:\go\go-tip\src
|
|
git pull
|
|
}
|
|
.\make.bat
|
|
Pop-Location
|
|
} else {
|
|
# Install Go
|
|
Write-Host "Finding latest patch version for $version"
|
|
$versions = Invoke-WebRequest -Uri 'https://golang.org/dl/?mode=json&include=all' -UseBasicParsing | foreach {$_.Content} | ConvertFrom-Json
|
|
$v = $versions | foreach {$_.version} | Select-String -Pattern "^$version($|\.)" | Sort-Object -Descending | Select-Object -First 1
|
|
if ($v -eq $null) {
|
|
$v = $versions | foreach {$_.version} | Select-String -Pattern "^$version(rc)" | Sort-Object -Descending | Select-Object -First 1
|
|
}
|
|
if ($v -eq $null) {
|
|
$v = $versions | foreach {$_.version} | Select-String -Pattern "^$version(beta)" | Sort-Object -Descending | Select-Object -First 1
|
|
}
|
|
Write-Host "Go $v on $arch"
|
|
GetGo $v
|
|
}
|
|
|
|
$env:GOPATH = "C:\gopath"
|
|
$env:PATH += ";$env:GOROOT\bin;$env:GOPATH\bin"
|
|
Write-Host $env:PATH
|
|
Write-Host $env:GOROOT
|
|
Write-Host $env:GOPATH
|
|
|
|
go version
|
|
go env
|
|
go run _scripts/make.go test
|
|
Exit $LastExitCode
|