Skip to content

Commit

Permalink
Minor tweaks to "bashbrew-arch-to-goenv.sh" comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tianon committed Aug 1, 2023
1 parent 2ff9004 commit ca308fd
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/bashbrew-arch-to-goenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
set -eu

# usage: (from within another script)
# eval "$(./.bashbrew-arch-to-goenv.sh)"
# since we need those new environment variables in our other script
# shell="$(./bashbrew-arch-to-goenv.sh arm32v6)"
# eval "$shell"
# since we need those new environment variables set in our other script

bashbrewArch="$1"; shift # "amd64", "arm32v5", "windows-amd64", etc.

Expand All @@ -20,8 +21,10 @@ case "$arch" in

arm64v*)
printf 'export GOARCH="%s"\n' 'arm64'
# no GOARM for arm64 (yet?) -- https://github.com/golang/go/blob/1e72bf62183ea21b9affffd4450d44d994393899/src/cmd/internal/objabi/util.go#L40
#printf 'export GOARM="%s"\n' "${arch#arm64v}"
# no GOARM(64) for arm64 (yet?):
# https://github.com/golang/go/blob/be0e0b06ac53d3d02ea83b479790404057b6f19b/src/internal/buildcfg/cfg.go#L86
# https://github.com/golang/go/issues/60905
#printf 'export GOARM64="v%s"\n' "${arch#arm64v}"
printf 'unset GOARM\n'
;;

Expand All @@ -30,6 +33,8 @@ case "$arch" in
printf 'unset GOARM\n'
;;

# TODO GOAMD64: https://github.com/golang/go/blob/be0e0b06ac53d3d02ea83b479790404057b6f19b/src/internal/buildcfg/cfg.go#L57-L70 (v1 implied)

*)
printf 'export GOARCH="%s"\n' "$arch"
printf 'unset GOARM\n'
Expand Down

0 comments on commit ca308fd

Please sign in to comment.