apex / apex/up

If CGO is enabled, cross compilation fails with unhelpful error message.

Ouverte
#356 4 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Go
Étoiles
8.8k
Forks
383
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

## Prerequisites

* [x] I searched to see if the issue already exists.
* [x] I am running the latest version. (`up upgrade`)

```0.2.6```

* [x] I inspected the verbose debug output with the `-v, --verbose` flag.

```
Error: building: build hook: "GOOS=linux GOARCH=amd64 go build -o server *.go": # runtime/cgo
ld: unknown option: --build-id=none
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

## Description

If environment variable ```export CGO_ENABLED=1``` is set, Up will fail with a unhelpful error message. The reason is that Go tries to compile net/http using the CGO resolver.

"By default the pure Go resolver is used, because a blocked DNS request consumes only a goroutine, while a blocked C call consumes an operating system thread. When cgo is available, the cgo-based resolver is used instead under a variety of conditions"

https://golang.org/pkg/net/

## Steps to Reproduce

[0] Using a Macbook Pro & OSX

[1] ```$ export CGO_ENABLED=1```

[2] clone the golang Up api example

[3] run ```$ up``` in project directory

## Love Up?

❤️

## Solution

Check if CGO is enabled at compile time and warn? Fail?

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.