From 5fab94b5b97b29995f672d794855ce364cd1065a Mon Sep 17 00:00:00 2001 From: Alexander Bezzubov Date: Tue, 9 Apr 2019 19:17:55 +0200 Subject: [PATCH] ci: disable cgo by default With go1.11 `go test` in GOPATH mode somehow seems to depend on GCC. See https://github.com/golang/go/issues/28065 This change only enables cgo for CI profiles that need it. Those are the ones that seem to fail on TravisCI now, presumably due to some compiler version missmatch. That is a workaround and does not happen in GO11MODULE mode. Signed-off-by: Alexander Bezzubov --- .travis.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3ec112f..a6113fd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,8 @@ go: - '1.12.1' env: global: - - GO_VERSION_FOR_JVM='1.11.' + - GO_VERSION_FOR_JVM='1.11.1' + - CGO_ENABLED=0 matrix: - ONIGURUMA=0 - ONIGURUMA=1 @@ -30,7 +31,7 @@ stages: stage: test install: - - if [[ "${ONIGURUMA}" -gt 0 ]]; then export tags="${tags} oniguruma"; fi; go get -v -t -tags "${tags}" ./... + - if [[ "${ONIGURUMA}" -gt 0 ]]; then export tags="${tags} oniguruma"; CGO_ENABLED=1; fi; go get -v -t -tags "${tags}" ./... script: - make test-coverage after_success: @@ -43,6 +44,7 @@ jobs: language: scala jdk: oraclejdk8 before_install: + - CGO_ENABLED=1 # mimics exact behavior of 'go_import_path' for non-go build image - export GOPATH=${TRAVIS_HOME}/gopath - mkdir -p ${GOPATH}/src/gopkg.in/src-d/enry.v1 @@ -122,6 +124,7 @@ jobs: language: scala jdk: oraclejdk8 before_install: + - CGO_ENABLED=1 # mimics exact behavior of 'go_import_path' for non-go build image - export GOPATH=${TRAVIS_HOME}/gopath - mkdir -p ${GOPATH}/src/gopkg.in/src-d/enry.v1