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 "gvm cross" for Go 1.4 #116

Merged
merged 2 commits into from
Feb 4, 2015
Merged
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
18 changes: 12 additions & 6 deletions scripts/cross
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ if [ ! -f "$GOROOT/pkg/tool/cross" ]; then
display_message "Installing x86, x86-64, and ARM commands"
set -e
for arch in 8 6 5; do
for cmd in a c g l; do
go tool dist install -v cmd/$arch$cmd ||
display_fatal "Couldn't compile tool: $arch$cmd"
done
for cmd in a c g l; do
go tool dist install -v cmd/$arch$cmd ||
display_fatal "Couldn't compile tool: $arch$cmd"
done
done
touch "$GOROOT/pkg/tool/cross"
fi
Expand All @@ -44,11 +44,17 @@ export GOARCH=$1
if [ ! -d "$GOROOT/pkg/${GOOS}_${GOARCH}" ]; then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't help but think that it might be more accurate here to look for "$GOROOT/pkg/${GOOS}_${GOARCH}/runtime.a" or similar, but I haven't done the necessary testing to verify that this would work across a reasonable number of Go versions (but it would catch attempted installs better, and make them easier to repeat).

It'd obviously need to come with the same logic above in display_list, so that's a project for a separate PR, IMO. :)

display_message "Installing $GOOS $GOARCH runtime library"
if [ "$GOOS" = "windows" ]; then
export CGO_ENABLED=0
export CGO_ENABLED=0
fi

cd "$GOROOT/src"
go tool dist install -v pkg/runtime ||
if [ -d pkg/runtime ]; then
runtime='pkg/runtime'
else
# Go 1.4 moved pkg/ up a level
runtime='runtime'
fi
go tool dist install -v "$runtime" ||
display_fatal "Couldn't compile runtime library for $GOOS $GOARCH"
go install -v -a std ||
display_fatal "Install runtime library for $GOOS $GOARCH"
Expand Down