From 56e7b5d0fdbcce44287ba64958125ebda5d99a01 Mon Sep 17 00:00:00 2001 From: Danny Canter Date: Thu, 22 Dec 2022 05:00:08 -0500 Subject: [PATCH] runtime/Makefile: Get some bits happy on darwin Substitution in the yq install script doesn't like zsh, and additionally the version of yq we're using doesn't have a darwin/arm64 build so grab the amd64 version and let rosetta work its magic. Additionally swap to abspath from readlink -m for the printing of what binaries to install, as the -m flag doesn't exist on the BSD variant, and this should be the same behavior. Fixes: #5970 Signed-off-by: Danny Canter --- ci/install_yq.sh | 12 +++++++++++- src/runtime/Makefile | 10 +++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ci/install_yq.sh b/ci/install_yq.sh index 56ad7d6691..cc3e988b77 100755 --- a/ci/install_yq.sh +++ b/ci/install_yq.sh @@ -43,6 +43,16 @@ function install_yq() { "aarch64") goarch=arm64 ;; + "arm64") + # If we're on an apple silicon machine, just assign amd64. + # The version of yq we use doesn't have a darwin arm build, + # but Rosetta can come to the rescue here. + if [ $goos == "Darwin" ]; then + goarch=amd64 + else + goarch=arm64 + fi + ;; "ppc64le") goarch=ppc64le ;; @@ -64,7 +74,7 @@ function install_yq() { fi ## NOTE: ${var,,} => gives lowercase value of var - local yq_url="https://${yq_pkg}/releases/download/${yq_version}/yq_${goos,,}_${goarch}" + local yq_url="https://${yq_pkg}/releases/download/${yq_version}/yq_${goos}_${goarch}" curl -o "${yq_path}" -LSsf "${yq_url}" [ $? -ne 0 ] && die "Download ${yq_url} failed" chmod +x "${yq_path}" diff --git a/src/runtime/Makefile b/src/runtime/Makefile index 852b4d5795..6eaf8b335d 100644 --- a/src/runtime/Makefile +++ b/src/runtime/Makefile @@ -776,15 +776,15 @@ endif @printf "\tbinary installation path (BINDIR) : %s\n" $(abspath $(BINDIR)) @printf "\tbinaries to install :\n" @printf \ - "$(foreach b,$(sort $(BINLIST)),$(shell printf "\\t - $(shell readlink -m $(DESTDIR)/$(BINDIR)/$(b))\\\n"))" + "$(foreach b,$(sort $(BINLIST)),$(shell printf "\\t - $(abspath $(DESTDIR)/$(BINDIR)/$(b))\\\n"))" @printf \ - "$(foreach b,$(sort $(SHIMV2)),$(shell printf "\\t - $(shell readlink -m $(DESTDIR)/$(BINDIR)/$(b))\\\n"))" + "$(foreach b,$(sort $(SHIMV2)),$(shell printf "\\t - $(abspath $(DESTDIR)/$(BINDIR)/$(b))\\\n"))" @printf \ - "$(foreach b,$(sort $(MONITOR)),$(shell printf "\\t - $(shell readlink -m $(DESTDIR)/$(BINDIR)/$(b))\\\n"))" + "$(foreach b,$(sort $(MONITOR)),$(shell printf "\\t - $(abspath $(DESTDIR)/$(BINDIR)/$(b))\\\n"))" @printf \ - "$(foreach b,$(sort $(BINLIBEXECLIST)),$(shell printf "\\t - $(shell readlink -m $(DESTDIR)/$(PKGLIBEXECDIR)/$(b))\\\n"))" + "$(foreach b,$(sort $(BINLIBEXECLIST)),$(shell printf "\\t - $(abspath $(DESTDIR)/$(PKGLIBEXECDIR)/$(b))\\\n"))" @printf \ - "$(foreach s,$(sort $(SCRIPTS)),$(shell printf "\\t - $(shell readlink -m $(DESTDIR)/$(BINDIR)/$(s))\\\n"))" + "$(foreach s,$(sort $(SCRIPTS)),$(shell printf "\\t - $(abspath $(DESTDIR)/$(BINDIR)/$(s))\\\n"))" @printf "\tconfigs to install (CONFIGS) :\n" @printf \ "$(foreach c,$(sort $(CONFIGS)),$(shell printf "\\t - $(c)\\\n"))"