build: Deprecate requirement of GOROOT (#2803)

master
Harshavardhana 8 years ago committed by GitHub
parent 428629f577
commit f72163f856
  1. 2
      .travis.yml
  2. 28
      buildscripts/checkdeps.sh

@ -1,5 +1,7 @@
sudo: required sudo: required
dist: trusty dist: trusty
language: go language: go
os: os:

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# Minio Cloud Storage, (C) 2015 Minio, Inc. # Minio Cloud Storage, (C) 2014-2016 Minio, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -98,14 +98,6 @@ check_version() {
} }
check_golang_env() { check_golang_env() {
echo ${GOROOT:?} 2>&1 >/dev/null
if [ $? -eq 1 ]; then
echo "ERROR"
echo "GOROOT environment variable missing, please refer to Go installation document"
echo "https://github.com/minio/minio/blob/master/INSTALLGO.md#install-go-13"
exit 1
fi
echo ${GOPATH:?} 2>&1 >/dev/null echo ${GOPATH:?} 2>&1 >/dev/null
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
echo "ERROR" echo "ERROR"
@ -115,24 +107,11 @@ check_golang_env() {
fi fi
local go_binary_path=$(which go) local go_binary_path=$(which go)
if [ -z "${go_binary_path}" ] ; then if [ -z "${go_binary_path}" ] ; then
echo "Cannot find go binary in your PATH configuration, please refer to Go installation document" echo "Cannot find go binary in your PATH configuration, please refer to Go installation document"
echo "https://github.com/minio/minio/blob/master/INSTALLGO.md#install-go-13" echo "https://github.com/minio/minio/blob/master/INSTALLGO.md#install-go-13"
exit -1 exit -1
fi fi
local new_go_binary_path=${go_binary_path}
if [ -h "${go_binary_path}" ]; then
new_go_binary_path=$(readlink ${go_binary_path})
fi
if [[ !"$(dirname ${new_go_binary_path})" =~ *"${GOROOT%%*(/)}"* ]] ; then
echo "The go binary found in your PATH configuration does not belong to the Go installation pointed by your GOROOT environment," \
"please refer to Go installation document"
echo "https://github.com/minio/minio/blob/master/INSTALLGO.md#install-go-13"
exit -1
fi
} }
is_supported_os() { is_supported_os() {
@ -174,7 +153,8 @@ is_supported_arch() {
} }
check_deps() { check_deps() {
check_version "$(env go version 2>/dev/null | sed 's/^.* go\([0-9.]*\).*$/\1/')" "${GO_VERSION}" go_version=$(env go version 2>/dev/null)
check_version "$(echo ${go_version} | sed 's/^.* go\([0-9.]*\).*$/\1/')" "${GO_VERSION}"
if [ $? -ge 2 ]; then if [ $? -ge 2 ]; then
MISSING="${MISSING} golang(${GO_VERSION})" MISSING="${MISSING} golang(${GO_VERSION})"
fi fi
@ -196,7 +176,7 @@ main() {
check_golang_env check_golang_env
echo "Done" echo "Done"
echo "Using GOPATH=${GOPATH} and GOROOT=${GOROOT}" echo "Using GOPATH=${GOPATH}"
echo -n "Checking dependencies for Minio.. " echo -n "Checking dependencies for Minio.. "
check_deps check_deps

Loading…
Cancel
Save