Skip to content

Commit

Permalink
golang: update to 1.10.3, add mirrors
Browse files Browse the repository at this point in the history
This also changes the bootstrap source URL to the official GitHub
mirror, to make building easier for places where Google sites aren't
accessible. Fixes #6326.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
  • Loading branch information
jefferyto authored and yousong committed Jun 27, 2018
1 parent fa30d47 commit 1929265
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lang/golang/golang-version.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ endif


GO_VERSION_MAJOR_MINOR:=1.10
GO_VERSION_PATCH:=
GO_VERSION_PATCH:=3
11 changes: 8 additions & 3 deletions lang/golang/golang/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ PKG_VERSION:=$(GO_VERSION_MAJOR_MINOR)$(if $(GO_VERSION_PATCH),.$(GO_VERSION_PAT
PKG_RELEASE:=1

PKG_SOURCE:=go$(PKG_VERSION).src.tar.gz
PKG_SOURCE_URL:=https://golang.org/dl/
PKG_HASH:=f3de49289405fda5fd1483a8fe6bd2fa5469e005fd567df64485c4fa000c7f24
PKG_SOURCE_URL:=https://golang.org/dl/ \
https://dl.google.com/go/ \
https://fossies.org/linux/misc/ \
http://distfiles.gentoo.org/distfiles/ \
https://ftp.netbsd.org/pub/pkgsrc/distfiles/ \
https://distfiles.macports.org/go/
PKG_HASH:=567b1cc66c9704d1c019c50bef946272e911ec6baf244310f87f4e678be155f2

PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
Expand Down Expand Up @@ -52,7 +57,7 @@ HOST_GO_VALID_OS_ARCH:= \
linux_ppc64 linux_ppc64le linux_mips linux_mipsle linux_mips64 linux_mips64le

BOOTSTRAP_SOURCE_PROTO:=git
BOOTSTRAP_SOURCE_URL:=https://go.googlesource.com/go
BOOTSTRAP_SOURCE_URL:=https://github.com/golang/go.git
BOOTSTRAP_SOURCE_VERSION:=4d5426a570c2820c5894a61b52e3dc147e4e7925
BOOTSTRAP_SOURCE_DATE:=20170926
BOOTSTRAP_MIRROR_HASH:=a3e26ee7c96486c841d29cbea3bf548ce2d999b9235275091cbe60ae6efa4cb1

This comment has been minimized.

Copy link
@yousong

yousong Jun 28, 2018

Member

Hi, @jefferyto , I just found out that the golang team actually provides updated tarballs for recent tagged go1.4 sources. It's official as written in [1] and it's go1.4-bootstrap-20171003.tar.gz at the moment.

As for the mirror urls, please consider adding [2] as a source, and move those go specific ones to the front. The gentoo link can be removed as it does not provide any go sources at all.

[1] https://golang.org/doc/install/source
[2] http://mirrors.ustc.edu.cn/golang/

This comment has been minimized.

Copy link
@jefferyto

jefferyto Jun 28, 2018

Author Member

Thanks @yousong - I'll update the makefile to use that tarball for bootstrap.

One question: if the bootstrap go is to be downloaded from dl.google.com, does that mean I should just change the main download URL to dl.google.com as well, removing all other mirrors (and maybe even golang.org)? If the user cannot download the bootstrap go (e.g. dl.google.com is blocked for some reason), then nothing else can happen.

(Regarding the Gentoo link, for me http://distfiles.gentoo.org/distfiles/ redirects to https://gentoo.osuosl.org/distfiles/, and there I can see go sources (after the index page loads completely). Also, I ordered the links in rough order of their intended audience size; in theory the larger their intended audience, the more bandwidth they would have invested in for downloads. I didn't do any actual measurement or research on their audience sizes though, just went with my gut feeling 😆)

This comment has been minimized.

Copy link
@yousong

yousong Jun 28, 2018

Member

Maybe add a variable GOLANG_MIRROR_URLS and use it for both current and bootstrap sources. The build system should be able to work with that.

I just tested https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz and it should be generally accessible in China (the host resolves to addresses of Google in Shanghai).

The gentoo link does not redirect here and it indeed has go1.10.3 source now... No idea what happened then in another network environment.

That put aside, I do not think it's good practice that we use other distributions' mirror sites (gentoo, macports, netbsd). Even though they have an open access model, they serve a project local specific purposes and I guess they are not meant to used in such a way. Sites like fossie.org if to be used should be handled by the build system. So I think it's better to keep only golang specific mirror urls here. My 2 cents

This comment has been minimized.

Copy link
@jefferyto

jefferyto Jun 28, 2018

Author Member

Oh, I see the USTC mirror even mirrors the bootstrap source. None of the other sites have it (including fossies.org).

I'll update the makefile to use golang specific mirrors as you suggest (including https://mirrors.nju.edu.cn/golang/).

Should I combine this with the changes in #6372 or submit separate PRs?

This comment has been minimized.

Copy link
@yousong

yousong Jun 29, 2018

Member

@jefferyto , I think it's more productive and convenient to make batch commits in this case. Make them separate commits though. Thank you.

This comment has been minimized.

Copy link
@jefferyto

jefferyto Jun 29, 2018

Author Member

I've updated #6372 (and #6373) - thanks for your help!

Expand Down

0 comments on commit 1929265

Please sign in to comment.