diff --git a/.circleci/release_s3.sh b/.circleci/release_s3.sh index 75267ecadf..325e2dd688 100755 --- a/.circleci/release_s3.sh +++ b/.circleci/release_s3.sh @@ -4,10 +4,6 @@ set -eu VERSION=$(cat VERSION) -echo "Releasing docs website" -tar -xzf /tmp/workspace/deep-docs.tar.gz -C /tmp/workspace && aws s3 sync /tmp/workspace/docs s3://please-docs - - if aws s3 ls s3://please-releases/linux_arm64/$VERSION/; then echo "Please $VERSION has already been released, nothing to do." exit 0 @@ -35,9 +31,8 @@ aws s3 cp get_plz.sh.asc s3://please-releases/get_plz.sh.asc --content-type text aws s3 cp get_plz.sh.sig s3://please-releases/get_plz.sh.sig --content-type application/octet-stream if [[ "$VERSION" == *"beta"* ]] || [[ "$VERSION" == *"alpha"* ]] || [[ "$VERSION" == *"prerelease"* ]]; then - echo "$VERSION is a prerelease, only setting latest_prerelease_version" else - echo "$VERSION is not a prerelease, setting latest_version and latest_prerelease_version" + echo "$VERSION is not a prerelease, setting latest_version" aws s3 cp VERSION s3://please-releases/latest_version --content-type text/plain fi -aws s3 cp VERSION s3://please-releases/latest_prerelease_version --content-type text/plain + diff --git a/ChangeLog b/ChangeLog index 48b92b8012..741bf55303 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Version 16.28.0 +--------------- + * Support for Go 1.20 (#2735) + + Version 16.27.5 --------------- * Exclude targets in subrepos from `plz query changes` (#2725) diff --git a/VERSION b/VERSION index 6ccbdf0ff9..885090dccc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -16.27.5 +16.28.0 diff --git a/rules/go_rules.build_defs b/rules/go_rules.build_defs index 039212c135..e0a3f3b4e3 100644 --- a/rules/go_rules.build_defs +++ b/rules/go_rules.build_defs @@ -4,7 +4,7 @@ Go has a strong built-in concept of packages so it's probably a good idea to mat rules to Go packages. """ def go_toolchain(name:str, url:str|dict = '', version:str = '', hashes:list = [], visibility:list = ["PUBLIC"], - architectures:list=[], strip_srcs:bool=False, tags:list=None): + architectures:list=[], strip_srcs:bool=False, tags:list=None, install_std=None): """ Downloads Go and exposes :|go and :|gofmt as entry points. To use this rule add the following to your .plzconfig: @@ -28,6 +28,8 @@ def go_toolchain(name:str, url:str|dict = '', version:str = '', hashes:list = [] improve performance, especially for remote execution. This doesn't work with go_get() however it is recommended to set this to True if you're using go_module() exclusively. tags (bool): Build tags to pass when installing the standard library. + install_std (bool): Whether we should install the standard library. This is required for go 1.20+. If not set, + Please will do whatever is appropriate based on the Go version. """ if url and version: fail("Either version or url should be provided but not both") @@ -44,7 +46,7 @@ def go_toolchain(name:str, url:str|dict = '', version:str = '', hashes:list = [] hashes = hashes, ) - cmd = 'tar -xf $SRCS && mv go $OUT && chmod +x $OUT/bin/*; rm -rf $OUT/test' + cmd = 'export GODEBUG="installgoroot=all" && tar -xf $SRCS && mv go $OUT && chmod +x $OUT/bin/*; rm -rf $OUT/test' # If we're targeting another platform, build the std lib for that. We can't use CONFIG.OS as this is always set to # the host OS for tools. if CONFIG.TARGET_OS != CONFIG.HOSTOS or CONFIG.TARGET_ARCH != CONFIG.HOSTARCH: @@ -57,6 +59,13 @@ def go_toolchain(name:str, url:str|dict = '', version:str = '', hashes:list = [] for arch in architectures: goos, _, goarch = arch.partition("_") cmd += f' && (export GOOS={goos} && export GOARCH={goarch} && $OUT/bin/go install{tag_flag} --trimpath std)' + + if semver_check(version, ">= 1.20.0") and install_std is None: + install_std = True + + if install_std: + cmd += f" && $OUT/bin/go install{tag_flag} --trimpath std" + if strip_srcs: trim_toolchain = "mv $OUT/src src && mkdir $OUT/src && mv src/unsafe $OUT/src/unsafe" cmd = f"{cmd} && {trim_toolchain}"