Skip to content

Commit

Permalink
doc(Readme.md): mention ./script/go.bash
Browse files Browse the repository at this point in the history
While there, zap the ./MONOREPO/tools/setupgo script, which has now
been superseded by using ./script/go.bash as  development tool.

Part of ooni/probe#2664.
  • Loading branch information
bassosimone committed Feb 2, 2024
1 parent 64c4394 commit 734ae79
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 40 deletions.
37 changes: 0 additions & 37 deletions MONOREPO/tools/setupgo

This file was deleted.

38 changes: 35 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ mingw-w64 cross-compiler.

The following commands show how to setup a development
environment using Debian 12 ("bookworm"). The same instructions
should also work for Debian-based distribution (e.g., Ubuntu).
should also work for Debian-based distribution (e.g., Ubuntu)
as long as you're using Go >= 1.19.

```bash
# install the compilers, git, and the root CA
Expand All @@ -97,10 +98,13 @@ go install -v golang.org/dl/go1.20.12@latest
$HOME/go/bin/go1.20.12 download
```

You can automate the last two steps by using `./script/go.bash` as your
Go compiler, as explained below.

### Fedora developer setup

The following commands show how to setup a development
environment using Fedora.
environment using Fedora, as long as your Fedora uses Go >= 1.19.

```bash
# install the compilers and git
Expand All @@ -116,6 +120,9 @@ go install -v golang.org/dl/go1.20.12@latest
$HOME/go/bin/go1.20.12 download
```

You can automate the last two steps by using `./script/go.bash` as your
Go compiler, as explained below.

### macOS developer setup

The following commands show how to setup a development
Expand All @@ -136,7 +143,15 @@ go install -v golang.org/dl/go1.20.12@latest
$HOME/go/bin/go1.20.12 download
```

### Build instructions
You can automate the last two steps by using `./script/go.bash` as your
Go compiler, as explained below.

### Build instructions without using `./script/go.bash`

This section describe how to manually use the correct version of Go you have
installed. You can alternatively use the `./script/go.bash` wrapper to automatically
use the correct Go version (provided you have Go >= 1.19 installed), as described
in a subsequent section of this file.

Once you have installed the correct Go version and a C compiler,
you can compile `ooniprobe` using:
Expand Down Expand Up @@ -166,6 +181,23 @@ $HOME/go/bin/go1.20.12 build -v -ldflags '-s -w' ./internal/cmd/oohelperd
This command will generate a stripped binary called `oohelperd`
in the toplevel directory.

### Alternative: using the `./script/go.bash` script

The `./script/go.bash` script requires Go >= 1.19 and automates installing and
using the correct version of Go. Running this script as follows:

```bash
./script/go.bash build -v -ldflags '-s -w' ./internal/cmd/miniooni
```

Is equivalent to running these commands:

```bash
go install -v golang.org/dl/go1.20.12@latest
$HOME/go/bin/go1.20.12 download
$HOME/sdk/go1.20.12/bin/go build -v -ldflags '-s -w' ./internal/cmd/miniooni
```

## Contributing

Please, see [CONTRIBUTING.md](CONTRIBUTING.md).
Expand Down

0 comments on commit 734ae79

Please sign in to comment.