From 8f6f87902a8c178e5af192cbd28f39c8cb322e3e Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Sat, 14 Jan 2023 13:50:19 +0200 Subject: [PATCH] updated README with the supported noncgo platforms --- README.md | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2afef03f..3633f220 100644 --- a/README.md +++ b/README.md @@ -90,11 +90,33 @@ Running/building the application is the same as for any other Go program, aka. j **PocketBase embeds SQLite, but doesn't require CGO.** -If CGO is enabled, it will use [mattn/go-sqlite3](https://pkg.go.dev/github.com/mattn/go-sqlite3) driver, otherwise - [modernc.org/sqlite](https://pkg.go.dev/modernc.org/sqlite). You can enable and disable CGO by setting the `CGO_ENABLED` environment variable to `1` or `0` respectively. - +If CGO is enabled (aka. `CGO_ENABLED=1`), it will use [mattn/go-sqlite3](https://pkg.go.dev/github.com/mattn/go-sqlite3) driver, otherwise - [modernc.org/sqlite](https://pkg.go.dev/modernc.org/sqlite). Enable CGO only if you really need to squeeze the read/write query performance at the expense of complicating cross compilation. -To build the minimal standalone executable, like the prebuilt ones in the releases page, you can simply run `go build` inside the `examples/base` directory. +To build the minimal standalone executable, like the prebuilt ones in the releases page, you can simply run `go build` inside the `examples/base` directory: + +0. [Install Go 1.18+](https://go.dev/doc/install) (_if you haven't already_) +1. Clone/download the repo +2. Navigate to `examples/base` +3. Run `GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build` + (_https://go.dev/doc/install/source#environment_) +4. Start the generated executable by running `./base serve`. + +The supported build targets by the non-cgo driver at the moment are: +``` +darwin amd64 +darwin arm64 +freebsd amd64 +freebsd arm64 +linux 386 +linux amd64 +linux arm +linux arm64 +linux ppc64le +linux riscv64 +windows amd64 +windows arm64 +``` ### Testing