mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-29 10:26:29 +02:00
darwin: use x86 envoy build for arm64 (#2246)
* darwin: use x86 envoy build for arm64 * allow arm64 build for darwin
This commit is contained in:
parent
db00821001
commit
1eea197859
3 changed files with 13 additions and 4 deletions
3
.github/goreleaser.yaml
vendored
3
.github/goreleaser.yaml
vendored
|
@ -26,9 +26,6 @@ builds:
|
|||
goos:
|
||||
- linux
|
||||
- darwin
|
||||
ignore:
|
||||
- goos: darwin
|
||||
goarch: arm64
|
||||
|
||||
ldflags:
|
||||
- -s -w
|
||||
|
|
|
@ -15,6 +15,7 @@ import (
|
|||
"os/exec"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
|
@ -196,7 +197,13 @@ func (srv *Server) run(ctx context.Context, cfg *config.Config) error {
|
|||
}
|
||||
srv.restartEpoch++
|
||||
|
||||
cmd := exec.Command(srv.envoyPath, args...) // #nosec
|
||||
var cmd *exec.Cmd
|
||||
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
|
||||
// until m1 macs are supported by envoy, fallback to x86 and use rosetta
|
||||
cmd = exec.Command("arch", append([]string{"-x86_64", srv.envoyPath}, args...)...) // #nosec
|
||||
} else {
|
||||
cmd = exec.Command(srv.envoyPath, args...) // #nosec
|
||||
}
|
||||
cmd.Dir = srv.wd
|
||||
|
||||
stderr, err := cmd.StderrPipe()
|
||||
|
|
|
@ -8,6 +8,11 @@ _envoy_version=1.17.3
|
|||
_dir="${DIR:-"$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)/../bin"}"
|
||||
_target="${TARGET:-"$(go env GOOS)-$(go env GOARCH)"}"
|
||||
|
||||
# until m1 macs are supported, fallback to x86 and use rosetta
|
||||
if [ "$_target" == "darwin-arm64" ]; then
|
||||
_target="darwin-amd64"
|
||||
fi
|
||||
|
||||
is_command() {
|
||||
command -v "$1" >/dev/null
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue