mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-06 10:21:05 +02:00
dev build support for darwin-arm64 from envoy tip (#2815)
This commit is contained in:
parent
5a858f5d48
commit
993da5704b
5 changed files with 25 additions and 11 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -89,4 +89,6 @@ docs/.vuepress/dist/
|
||||||
.service-accounts
|
.service-accounts
|
||||||
|
|
||||||
/bazel-*
|
/bazel-*
|
||||||
internal/envoy/files/
|
internal/envoy/files/envoy-*-?????
|
||||||
|
internal/envoy/files/envoy-*-?????.sha256
|
||||||
|
internal/envoy/files/envoy-*-?????.version
|
|
@ -5,7 +5,6 @@ package envoy
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"runtime"
|
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/pomerium/pomerium/internal/log"
|
"github.com/pomerium/pomerium/internal/log"
|
||||||
|
@ -26,10 +25,5 @@ func (srv *Server) prepareRunEnvoyCommand(ctx context.Context, sharedArgs []stri
|
||||||
args = make([]string, len(sharedArgs))
|
args = make([]string, len(sharedArgs))
|
||||||
copy(args, sharedArgs)
|
copy(args, sharedArgs)
|
||||||
|
|
||||||
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
|
|
||||||
// until m1 macs are supported by envoy, fallback to x86 and use rosetta
|
|
||||||
return "arch", append([]string{"-x86_64", srv.envoyPath}, args...)
|
|
||||||
}
|
|
||||||
|
|
||||||
return srv.envoyPath, args
|
return srv.envoyPath, args
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
//go:build darwin
|
//go:build darwin && amd64
|
||||||
// +build darwin
|
// +build darwin,amd64
|
||||||
|
|
||||||
package files
|
package files
|
||||||
|
|
15
internal/envoy/files/files_darwin_arm64.go
Normal file
15
internal/envoy/files/files_darwin_arm64.go
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
//go:build darwin && arm64
|
||||||
|
// +build darwin,arm64
|
||||||
|
|
||||||
|
package files
|
||||||
|
|
||||||
|
import _ "embed" // embed
|
||||||
|
|
||||||
|
//go:embed envoy-darwin-arm64
|
||||||
|
var rawBinary []byte
|
||||||
|
|
||||||
|
//go:embed envoy-darwin-arm64.sha256
|
||||||
|
var rawChecksum string
|
||||||
|
|
||||||
|
//go:embed envoy-darwin-arm64.version
|
||||||
|
var rawVersion string
|
|
@ -9,9 +9,12 @@ _envoy_version=1.19.1
|
||||||
_dir="$_project_root/internal/envoy/files"
|
_dir="$_project_root/internal/envoy/files"
|
||||||
_target="${TARGET:-"$(go env GOOS)-$(go env GOARCH)"}"
|
_target="${TARGET:-"$(go env GOOS)-$(go env GOARCH)"}"
|
||||||
|
|
||||||
# until m1 macs are supported, fallback to x86 and use rosetta
|
|
||||||
if [ "$_target" == "darwin-arm64" ]; then
|
if [ "$_target" == "darwin-arm64" ]; then
|
||||||
_target="darwin-amd64"
|
echo "Using local envoy distribution for Apple M1"
|
||||||
|
cp `which envoy` "$_dir/envoy-$_target"
|
||||||
|
(cd internal/envoy/files && sha256sum "$_dir/envoy-$_target" > "$_dir/envoy-$_target.sha256")
|
||||||
|
echo "1.21.0-dev" >"$_dir/envoy-$_target.version"
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_url="https://github.com/pomerium/envoy-binaries/releases/download/v${_envoy_version}/envoy-${_target}"
|
_url="https://github.com/pomerium/envoy-binaries/releases/download/v${_envoy_version}/envoy-${_target}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue