From a6b89b3172386ff06e3f58c9ca55b571b1e34a2d Mon Sep 17 00:00:00 2001 From: Constantin Konstantinidis Date: Mon, 19 Aug 2024 10:56:59 +0200 Subject: [PATCH] Remove GOROOT_FINAL usage (https://go.dev/issue/62047) --- action.yml | 16 ++++++++++------ architecture/main.go | 2 ++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 7f7a6b7..5901ddb 100644 --- a/action.yml +++ b/action.yml @@ -48,19 +48,23 @@ runs: if [ -z "$GOROOT_BOOTSTRAP" ]; then export GOROOT_BOOTSTRAP=$(go env GOROOT); fi export crosscompile=true if [ "$(go env GOOS)" == "$(go env GOHOSTOS)" -a "$(go env GOARCH)" == "$(go env GOHOSTARCH)" ]; then crosscompile=false; fi - if [ "$crosscompile" == "true" -a -z "$GOROOT_FINAL" ]; then export GOROOT_FINAL="/tmp/go"; fi - if [ "$crosscompile" == "false" -a -z "$GOROOT_FINAL" ]; then export GOROOT_FINAL="$(pwd)/go"; fi + if [ "$crosscompile" == "true" -a -z "$GOROOT" ]; then export GOROOT="/tmp/go"; fi + if [ "$crosscompile" == "false" -a -z "$GOROOT" ]; then export GOROOT="$(pwd)/go"; fi echo "crosscompile=$crosscompile" >> $GITHUB_ENV - echo "gorootfinal=$GOROOT_FINAL" >> $GITHUB_ENV + echo "gorootfinal=$GOROOT" >> $GITHUB_ENV cd go/src ./make.bash --no-banner - ../bin/go version + # TODO Fails as GOROOT is altered + # ../bin/go version - name: Test locally shell: bash if: ${{ inputs.test_build == 'true' && env.crosscompile == 'false' }} run: | export ${{ inputs.go_variables }} + echo $GOROOT + go version + go env GOROOT if [ -z "$GOTOOLCHAIN" ]; then export GOTOOLCHAIN="auto"; fi cd go/src ./run.bash --no-rebuild @@ -105,8 +109,8 @@ runs: docker cp ./go/src/. xalpine:/tmp/go/src/ docker cp ./go/test/. xalpine:/tmp/go/test/ # Smoke tests - docker exec xalpine go version - docker exec xalpine go env + docker exec -w /tmp/go/bin xalpine go version + docker exec -w /tmp/go/bin xalpine go env # Bash is the default shell when available export $(cat $GITHUB_ENV | grep usebash) runbash='./run.bash' diff --git a/architecture/main.go b/architecture/main.go index 3b0def7..1311347 100644 --- a/architecture/main.go +++ b/architecture/main.go @@ -149,6 +149,8 @@ func main() { image := exec.Command("docker", "run", "-d", "-t", "--platform", goarch, + // TODO Recover actual target GOROOT + "-e", setParam("GOROOT", "/tmp/go"), "-e", setParam("GO_TEST_TIMEOUT_SCALE", "4"), "-e", setParam("GOPROXY", "https://proxy.golang.org,direct"), "-e", setParam("GOSUMDB", "sum.golang.org"),