Skip to content

Commit

Permalink
docs: errors/build
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
caarlos0 committed Dec 4, 2022
1 parent b06f217 commit 5c15e5a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions www/docs/errors/build.md
@@ -0,0 +1,25 @@
# Build Errors

## Undefined methods

If you see an error that looks like this:

```shell
⨯ release failed after 14s error=failed to build for darwin_amd64_v1: exit status 2: # github.com/rjeczalik/notify
../../../../go/pkg/mod/github.com/rjeczalik/notify@v0.9.2/watcher_fsevents.go:49:11: undefined: stream
../../../../go/pkg/mod/github.com/rjeczalik/notify@v0.9.2/watcher_fsevents.go:200:13: undefined: newStream
```

It usually means that some dependency you are using needs CGO, or does not have
an implementation for the given OS.

You can check that locally with:

```bash
GOOS=darwin GOARCH=amd64 go build ./...
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build ./...
```

If the first fails, but the seconds succeeds, you need to set up
[CGO](/limitations/cgo). If both fail, your dependency don't have an
implementation for some methods for Darwin amd64 (in this example).
1 change: 1 addition & 0 deletions www/mkdocs.yml
Expand Up @@ -151,6 +151,7 @@ nav:
- errors/release-upload.md
- errors/docker-build.md
- errors/no-main.md
- errors/build.md
- errors/resource-not-accessible-by-integration.md
- errors/no-history.md
- errors/multiple-binaries-archive.md
Expand Down

0 comments on commit 5c15e5a

Please sign in to comment.