From 0aa28dbadecdc4dcedc45a513c2fc1a6ee763687 Mon Sep 17 00:00:00 2001 From: Aaron Xiao Date: Fri, 31 Jan 2020 19:37:53 -0800 Subject: [PATCH] Revert "Bazel: Rename WORKSPACE.in to WORKSPACE as MACHINE_ARCH is removed." This reverts commit d234366d42ffd75dadbafd8dec89674b8c04b51a. --- .gitignore | 1 + WORKSPACE => WORKSPACE.in | 0 apollo.sh | 8 +++++++- 3 files changed, 8 insertions(+), 1 deletion(-) rename WORKSPACE => WORKSPACE.in (100%) diff --git a/.gitignore b/.gitignore index cb150b79e4..12fe985116 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Bazel bazel-* +WORKSPACE # Temporary files *.pyc diff --git a/WORKSPACE b/WORKSPACE.in similarity index 100% rename from WORKSPACE rename to WORKSPACE.in diff --git a/apollo.sh b/apollo.sh index 561dd985aa..490a955668 100755 --- a/apollo.sh +++ b/apollo.sh @@ -63,7 +63,13 @@ function apollo_check_system_config() { function check_machine_arch() { # the machine type, currently support x86_64, aarch64 MACHINE_ARCH=$(uname -m) - if [ "${MACHINE_ARCH}" != "x86_64" ] && [ "${MACHINE_ARCH}" != "aarch64" ]; then + + # Generate WORKSPACE file based on marchine architecture + if [ "$MACHINE_ARCH" == 'x86_64' ]; then + sed "s/MACHINE_ARCH/x86_64/g" WORKSPACE.in > WORKSPACE + elif [ "$MACHINE_ARCH" == 'aarch64' ]; then + sed "s/MACHINE_ARCH/aarch64/g" WORKSPACE.in > WORKSPACE + else fail "Unknown machine architecture $MACHINE_ARCH" exit 1 fi -- GitLab