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
Support delve on Windows #1922
Comments
Does delve support mingw? |
Not sure. Apparently the delve group is working on a windows port. |
Ok, then when delve will support Windows the plugin will support Windows as well. :) |
Congratulations! Branches was merged today! |
Also see. |
fix! |
@kolkov Thank you very much. |
I'll be very appreciated if someone can provide a command line (or power shell script) for building Delve on Windows with Go distro downloading/unzipping, setting up GOPATH, etc. |
@ignatov if there's no script for this I'll try and provide it tomorrow. |
I've ran this against Windows Server 2012 r2 and Powershell. To run it open a powershell session and simply point the command to the file. It doesn't cleanup the installers but that's easy to add if needed. Please let me know if there are any issues with this. Thank you. # Install Go
if (-Not (Test-Path "C:\Go")) {
echo "Installing Go"
$file = "go1.5.3.windows-amd64.msi"
$url = "https://storage.googleapis.com/golang/"
$url += $file
Invoke-WebRequest -UserAgent wget -Uri $url -OutFile $file
msiexec /package $file /quiet | Out-Null
} else {
echo "Go already installed"
}
# Install 7Zip
if (-Not (Test-Path "C:\Program Files\7-Zip")) {
echo "Installing 7Zip"
$file = "7z1514-x64.msi"
$url = "http://7-zip.org/a/"
$url += $file
Invoke-WebRequest -UserAgent wget -Uri $url -OutFile $file
msiexec /package $file /quiet | Out-Null
} else {
echo "7Zip already installed"
}
# Install MinGW
if (-Not (Test-Path "C:\mingw64")) {
echo "Installing MinGW"
$file = "x86_64-4.9.2-release-win32-seh-rt_v4-rev3.7z"
$url = "https://bintray.com/artifact/download/drewwells/generic/"
$url += $file
Invoke-WebRequest -UserAgent wget -Uri $url -OutFile $file
&"C:\Program Files\7-Zip\7z.exe" x -oC:\ $file > $null
} else {
echo "MinGW is already installed"
}
# Install git
if (-Not (Test-Path "C:\Program Files\Git")) {
$file = "Git-2.7.0-64-bit.exe"
$url = "https://github.com/git-for-windows/git/releases/download/v2.7.0.windows.1/"
$url += $file
Invoke-WebRequest -UserAgent wget -Uri $url -OutFile $file
./Git-2.7.0-64-bit.exe /SILENT /COMPONENTS="icons,ext\reg\shellhere,assoc,assoc_sh" | Out-Null
} else {
echo "git is already installed"
}
if (-Not (Test-Path "C:\golang")) {
mkdir "c:\golang"
}
$env:GOPATH="c:\golang"
$env:PATH="c:\Go\bin;c:\mingw64\bin;"+$env:GOPATH+"\bin;C:\Program Files\Git\bin;"+$env:PATH
echo $env:PATH
echo $env:GOPATH
go version
go env
go get github.com/tools/godep
go get -d github.com/derekparker/delve
cd $env:GOPATH\src\github.com\derekparker\delve
godep restore
mingw32-make install |
I've forgot to mention, this produces the |
@dlsniper your script tries to install Git twice, but it installs Git during the MinGW step without checking for any existence first. |
I think you need to test GOPATH, not c:/Go only. |
@dlsniper I think he means it should check if the GOPATH environment variable exists and to (Test-Path $env:GOPATH), before just making a new one. Maybe before trying to install Go as well. |
@dlsniper If I understood correctly, you want to know is Golang installed already?
But path of the Golang may be different! Not only c:/go |
I see. Until I have some information from @ignatov about the environment where this will run I won't make any changes to it. The script is meant to be used on a blank, CI(?), server. If someone wants to improve it to make it an universal solution for installing Go, MinGW and then other tools, then please please feel free to do so. |
Hi, thanks for your script!
|
Ok, I'll make the changes tonight. go install -ldflags="-X main.Build=$(cd $GOPATH/src/github.com/derekparker/delve && git rev-parse HEAD)" github.com/derekparker/delve/cmd/dlv Thank you. |
Here's an updated version: https://gist.github.com/dlsniper/6027dba0291f1287f3f4 |
Hi all, please try the latest nightly build (0.10.1119 or higher) on Windows and tell how it is. |
The debugger in not enabled on Windows even though I have MinGW-w64 and GDB.
The text was updated successfully, but these errors were encountered: