apex / apex/up

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

Abierto
#356 4 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Go
Estrellas
8.8k
Forks
383
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

## 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?

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.