Skip to content

Commit

Permalink
Revise draft
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Dominic Della Valle <[email protected]>
  • Loading branch information
djdv committed Feb 27, 2018
1 parent 078fb31 commit dd5484f
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions docs/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ https://golang.org/doc/code.html#GOPATH
`go-ipfs` utilizes `make` to automate builds and testing, but can be built without it using only `git` and `go`.
No matter which section you choose, if you encounter issues, please see the [Troubleshooting](#troubleshooting) section.

Using `make`:
These sections cover setting up the build environment, each option is equally valid and differ only in their setup process. If you have no preference or special requirements, MSYS2 is recommended as the first choice.
**Using `make`:**
MSYS2 and Cygwin provide the Unix tools we need to build `go-ipfs`. You may use either, but if you don't already have one installed, MSYS2 is recommended.
[MSYS2→](#msys2)
[Cygwin→](#cygwin)

Using build tools manually:
**Using build tools manually:**
This section assumes you have a working version of `go` and `git` already setup. You may want to build this way if your environment restricts installing additional software, or if you are intigrating IPFS into your own build system.
[Minimal→](#minimal)

Expand All @@ -33,6 +33,8 @@ make install
%GOPATH%\bin\ipfs.exe version --all
```

If there were no errors, the final command should output version information simillar to "`ipfs version 0.4.14-dev-XXXXXXX`" where "XXXXXXX" should match the current short-hash of the `go-ipfs` repo. You can retrieve said hash via this command: `git rev-parse --short HEAD`. If `ipfs` runs and the version string matches, building was successful.

| | |
| ---: | :--- |
|`SET PATH=%PATH%;\msys64\usr\bin` |Add msys2's bin to `PATH`; Defaults to: (\msys64\usr\bin)|
Expand All @@ -42,8 +44,6 @@ make install
|`make install` |Build and install to `%GOPATH%\bin\ipfs.exe`|
|`%GOPATH%\bin\ipfs.exe version --all` |Test the built binary|

You can check that the ipfs output versions match with `go version` and `git rev-parse --short HEAD`, if `ipfs.exe` executes and everything matches, then building was successful.

**Tip**: You can permenantly append the MSYS2 bin to your `PATH` so that on subsequent builds you can simply run
```
cd %GOPATH%\src\github.com\ipfs\go-ipfs
Expand All @@ -65,7 +65,7 @@ SETX PATH %PATH%;\msys64\usr\bin
- `unzip`
- net packages
- `curl`
3. Run the following inside a normal `cmd` prompt (Not the Cygwin prompt, we only need Cygwin's tools)
4. Run the following inside a normal `cmd` prompt (Not the Cygwin prompt, we only need Cygwin's tools)
An explanation of this block is below.
```
SET PATH=%PATH%;\cygwin64\bin
Expand All @@ -76,6 +76,8 @@ cd %GOPATH%\src\github.com\ipfs\go-ipfs
make install
%GOPATH%\bin\ipfs.exe version --all
```

If there were no errors, the final command should output version information simillar to "`ipfs version 0.4.14-dev-XXXXXXX`" where "XXXXXXX" should match the current short-hash of the `go-ipfs` repo. You can retrieve said hash via this command: `git rev-parse --short HEAD`. If `ipfs` runs and the version string matches, building was successful.
| | |
| ---: | :--- |
|`SET PATH=%PATH%;\cygwin64\bin` |Add Cygwin's bin to PATH; Defaults to: (\cygwin64\bin)|
Expand All @@ -84,8 +86,6 @@ make install
|`make install` |Build and install to `%GOPATH%\bin\ipfs.exe`|
|`%GOPATH%\bin\ipfs.exe version --all` |Test the built binary|

You can check that the ipfs output versions match with `go version` and `git rev-parse --short HEAD`, if `ipfs.exe` executes and everything matches, then building was successful.

**Tip**: You can permanently append the Cygwin bin to your `PATH` so that on subsequent builds you can simply run
```
cd %GOPATH%\src\github.com\ipfs\go-ipfs
Expand All @@ -101,8 +101,9 @@ While it's possible to build `go-ipfs` with `go` alone, we'll be using `git` and
You can use whichever version of `git` you wish but the Windows builds at <https://git-scm.com> are recommended. `git` must be in your `PATH` for `go get` to recognize and use it.

### `gx`
`gx` and its go-hook `gx-go` can be built by us.
Alternativley you may use prebuilt binaries ([gx](https://dist.ipfs.io/#gx), [gx-go](https://dist.ipfs.io/#gx-go)) by placing them in your `PATH` and skipping this section.
You may install prebuilt binaries for [`gx`](https://dist.ipfs.io/#gx) & [`gx-go`](https://dist.ipfs.io/#gx-go) if they're available for your platform.
Alternatively you can build them from source and install them to `%GOPATH%\bin` by running the following:

```
go get -u github.com/whyrusleeping/gx
go get -u github.com/whyrusleeping/gx-go
Expand Down

0 comments on commit dd5484f

Please sign in to comment.