Skip to content

Commit

Permalink
Attempt to enforce the correct architecture on macOS
Browse files Browse the repository at this point in the history
CI build types: macos-x86_64
  • Loading branch information
mbautin committed Sep 24, 2024
1 parent 224279f commit 92fe602
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,14 @@ jobs:
- name: macos-x86_64
os: macos-12
docker_image:
build_thirdparty_args:
build_thirdparty_args: --enforce_arch=x86_64
architecture: x86_64

- name: macos-arm64
os: macos-12
docker_image:
build_thirdparty_args:
architecture: arm64
architecture: arm64 --enforce_arch=arm64

# ---------------------------------------------------------------------------------------
# aarch64 builds (Amazon Linux 2)
Expand Down
18 changes: 17 additions & 1 deletion build_and_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,23 @@ log "YB_BUILD_THIRDPARTY_ARGS: ${YB_BUILD_THIRDPARTY_ARGS:-undefined}"
YB_BUILD_THIRDPARTY_EXTRA_ARGS=${YB_BUILD_THIRDPARTY_EXTRA_ARGS:-}
log "YB_BUILD_THIRDPARTY_EXTRA_ARGS: ${YB_BUILD_THIRDPARTY_EXTRA_ARGS:-undefined}"

log "CPU architecture as reported by uname -m : $( uname -m )"
log "CPU architecture as reported by arch : $( arch )"

if [[ $OSTYPE == darwin* ]]; then
# Check if the Mac is using an Apple Silicon chip
if /usr/sbin/sysctl -n machdep.cpu.brand_string | grep -q "Apple"; then
# Check if Rosetta 2 is installed
if /usr/bin/pgrep oahd &>/dev/null; then
echo "Rosetta 2 is installed."
else
echo "Rosetta 2 is not installed."
fi
else
echo "This appears to be a non-Apple Silicon Mac, not checking for Rosetta 2."
fi
fi

# -------------------------------------------------------------------------------------------------
# Installed tools
# -------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -135,7 +152,6 @@ if [[ $OSTYPE == darwin* && $cmake_version == "$unsupported_cmake_version" ]]; t
( set -x; cmake --version )
fi


# -------------------------------------------------------------------------------------------------
# Check for errors in Python code of this repository
# -------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 92fe602

Please sign in to comment.