github.com/cnboonhan/delve@v0.0.0-20230908061759-363f2388c2fb/Documentation/installation/README.md (about)

     1  # Installation
     2  The following instructions are known to work on Linux, macOS, Windows and FreeBSD.
     3  
     4  Clone the git repository and build:
     5  
     6  ```
     7  $ git clone https://github.com/go-delve/delve
     8  $ cd delve
     9  $ go install github.com/go-delve/delve/cmd/dlv
    10  ```
    11  
    12  Alternatively, on Go version 1.16 or later:
    13  
    14  ```
    15  # Install the latest release:
    16  $ go install github.com/go-delve/delve/cmd/dlv@latest
    17  
    18  # Install at tree head:
    19  $ go install github.com/go-delve/delve/cmd/dlv@master
    20  
    21  # Install at a specific version or pseudo-version:
    22  $ go install github.com/go-delve/delve/cmd/dlv@v1.7.3
    23  $ go install github.com/go-delve/delve/cmd/dlv@v1.7.4-0.20211208103735-2f13672765fe
    24  ```
    25  See [Versions](https://go.dev/ref/mod#versions) and [Pseudo-versions](https://go.dev/ref/mod#pseudo-versions) for how to format the version suffixes.
    26  
    27  See `go help install` for details on where the `dlv` executable is saved.
    28  
    29  If during the install step you receive an error similar to this:
    30  
    31  ```
    32  found packages native (proc.go) and your_operating_system_and_architecture_combination_is_not_supported_by_delve (support_sentinel.go) in /home/pi/go/src/github.com/go-delve/delve/pkg/proc/native
    33  ```
    34  
    35  It means that your combination of operating system and CPU architecture is not supported, check the output of `go version`.
    36  
    37  ## macOS considerations
    38  
    39  On macOS make sure you also install the command line developer tools:
    40  
    41  ```
    42  $ xcode-select --install
    43  ```
    44  
    45  If you didn't enable Developer Mode using Xcode you will be asked to authorize the debugger every time you use it. To enable Developer Mode and only have to authorize once per session use:
    46  
    47  ```
    48  sudo /usr/sbin/DevToolsSecurity -enable
    49  ```
    50  
    51  You might also need to add your user to the developer group:
    52  
    53  ```
    54  sudo dscl . append /Groups/_developer GroupMembership $(whoami)
    55  ```
    56  
    57  ## Compiling macOS native backend
    58  
    59  You do not need the macOS native backend and it [has known problems](https://github.com/go-delve/delve/issues/1112). If you still want to build it:
    60  
    61  1. Run `xcode-select --install`
    62  2. On macOS 10.14 manually install the legacy include headers by running `/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg`
    63  3. Clone the repo into `$GOPATH/src/github.com/go-delve/delve`
    64  4. Run `make install` in that directory (on some versions of macOS this requires being root, the first time you run it, to install a new certificate)
    65  
    66  The makefile will take care of creating and installing a self-signed certificate automatically.