Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DNS resolution issues on Mac OS X when connected to a VPN #5925

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"

# Fix for issue https://github.com/hashicorp/terraform/issues/3536 where dns only uses /etc/resolv.conf on Mac OS X
case $(uname) in
Darwin*)
CGO_ENABLED=1
;;
esac

# Change into that directory
cd "$DIR"

Expand All @@ -18,6 +25,12 @@ GIT_DIRTY=$(test -n "`git status --porcelain`" && echo "+CHANGES" || true)
XC_ARCH=${XC_ARCH:-"386 amd64 arm"}
XC_OS=${XC_OS:-linux darwin windows freebsd openbsd solaris}

# Check to see if you are building for Darwin and set CGO_ENABLED
if [[ "${XC_OS}" =~ 'darwin' ]]
then
CGO_ENABLED=1
fi

# Delete the old dir
echo "==> Removing old directory..."
rm -f bin/*
Expand Down