Skip to content

Commit

Permalink
Remove GOROOT_FINAL usage (https://go.dev/issue/62047)
Browse files Browse the repository at this point in the history
  • Loading branch information
iwdgo committed Aug 19, 2024
1 parent 03e19f3 commit a6b89b3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 10 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down
2 changes: 2 additions & 0 deletions architecture/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit a6b89b3

Please sign in to comment.