Mari Murotani
Mari Murotani

Reputation: 763

Installing delve for GO in Mac OSX

I have been trying to install delve in my environment. However , delve fails to start and I can't solve this problem.

OS: OSX Yosemite 10.10.4

Darwin Kernel Version 14.4.0

 $GOPATH/bin/dlv debug main.go
 could not launch process: could not fork/exec

https://github.com/derekparker/delve/wiki/Building

I installed delve following steps mentioned above URL. Install was succeeded and delve starts appropriately with root user. Delve returns error except root user.

1) I have created certification and signed application

2) I kill taskgated just before make command but it starts again after make.

3) If I rename these files, this command makes failure. /System/Library/LaunchDaemons/com.apple.taskgated-helper.plist /System/Library/LaunchDaemons/com.apple.taskgated.plist

codesign -s "dlv-cert" /Users/murotanimari/work/bin/dlv
error: One or more parameters passed to a function were not valid.

Upvotes: 8

Views: 10310

Answers (4)

zangw
zangw

Reputation: 48566

For Go version 1.16+:

  • Install the latest release:

$ go install github.com/go-delve/delve/cmd/dlv@latest

  • Install at tree head:

$ go install github.com/go-delve/delve/cmd/dlv@master

  • Install a specific version:

$ go install github.com/go-delve/delve/cmd/[email protected]

Upvotes: 0

MartianMartian
MartianMartian

Reputation: 1859

brew install delve

this one worked for me. but it seems you need to use homebrew from right beginning.

Upvotes: 2

Muhammad Soliman
Muhammad Soliman

Reputation: 23876

Building devl with a certificate and signing it is an easy task, check this article that shows how to create cert, sign it and build from source

  • Install xcode build tools xcode-select --install
  • Create Certificate and sign it from Key Chain details in the article above.
  • Clone repo git clone https://github.com/go-delve/delve.git && cd delve
  • Build with cert: CERT=dlv-cert make install
  • Enable Developer mode: sudo /usr/sbin/DevToolsSecurity -enable

  • For troubleshooting, check this link

For Installing delv in OSX, Linux FreeBSD, or Windows, here's their github's wiki page that would help you how to install it.

https://github.com/go-delve/delve/tree/master/Documentation/installation

For more information on how to use it, its APIs and command line interface, visit official documentation wiki

Upvotes: 1

Alex Goja
Alex Goja

Reputation: 548

  1. brew install steeve/delve/delve -> this installs delve and creates the certificate
  2. Go to the delve folder, GOPATH/src/derek…/delve
  3. Install cert for delve with command CERT=dlv-cert make install

Upvotes: 3

Related Questions