Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

galasabld now builds with linux arm64 architecture #57

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion modules/buildutils/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ all: clean test \
bin/galasabld-windows-amd64 \
bin/galasabld-darwin-amd64 \
bin/galasabld-linux-s390x \
bin/galasabld-darwin-arm64
bin/galasabld-darwin-arm64 \
bin/galasabld-linux-arm64

src : ./Makefile \
./cmd/galasabld/main.go \
Expand All @@ -18,6 +19,9 @@ test: src
bin/galasabld-linux-amd64 : src
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/galasabld-linux-amd64 ./cmd/galasabld

bin/galasabld-linux-arm64 : src
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o bin/galasabld-linux-arm64 ./cmd/galasabld

bin/galasabld-windows-amd64 : src
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o bin/galasabld-windows-amd64 ./cmd/galasabld

Expand Down
35 changes: 20 additions & 15 deletions modules/buildutils/test-locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,31 +162,36 @@ function test_versions_manipulation() {
success "Tested the galasabld versioning commands as best we can"
}

function calculate_galasabld_executable {
h2 "Calculate the name of the galasabld executable for this machine/os"

raw_os=$(uname -s) # eg: "Darwin"
function get_architecture() {
h2 "Retrieving system architecture."
raw_os=$(uname -s) # eg: "Darwin"
os=""
case $raw_os in
Darwin*)
os="darwin"
;;
Windows*)
os="windows"
Darwin*)
os="darwin"
;;
Linux*)
os="linux"
;;
*)
error "Failed to recognise which operating system is in use. $raw_os"
*)
error "Unsupported operating system is in use. $raw_os"
exit 1
esac

architecture=$(uname -m)
printf "${architecture}"
if [ $architecture == "x86_64" ]; then
architecture="amd64"
fi
case $architecture in
aarch64)
architecture="arm64"
;;
amd64)
architecture="x86_64"
esac
}

function calculate_galasabld_executable {
h2 "Calculate the name of the galasabld executable for this machine/os"

get_architecture

export GALASABLD=${BASEDIR}/bin/galasabld-${os}-${architecture}
info "galasabld binary is ${GALASABLD}"
Expand Down
33 changes: 20 additions & 13 deletions modules/obr/build-locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,30 +167,37 @@ log_file=${LOGS_DIR}/${project}.txt
info "Log will be placed at ${log_file}"
date > ${log_file}

#------------------------------------------------------------------------------------
function get_galasabld_binary_location {
# What's the architecture-variable name of the build tool we want for this local build ?
export ARCHITECTURE=$(uname -m) # arm64 or amd64
if [ $ARCHITECTURE == "x86_64" ]; then
export ARCHITECTURE="amd64"
fi

raw_os=$(uname -s) # eg: "Darwin"
function get_architecture() {
h2 "Retrieving system architecture."
raw_os=$(uname -s) # eg: "Darwin"
os=""
case $raw_os in
Darwin*)
os="darwin"
;;
Windows*)
os="windows"
;;
Linux*)
os="linux"
;;
*)
error "Failed to recognise which operating system is in use. $raw_os"
error "Unsupported operating system is in use. $raw_os"
exit 1
esac

architecture=$(uname -m)
case $architecture in
aarch64)
architecture="arm64"
;;
amd64)
architecture="x86_64"
esac
}

#------------------------------------------------------------------------------------
function get_galasabld_binary_location {
# What's the architecture-variable name of the build tool we want for this local build ?
get_architecture
export ARCHITECTURE=${architecture}
export GALASA_BUILD_TOOL_NAME=galasabld-${os}-${ARCHITECTURE}

# Favour the galasabld tool if it's on the path, else use a locally-built version or fail if not available.
Expand Down
Loading