Skip to content

Commit

Permalink
[Cpp] - Only exit vcpkg install early on Buster ARM64 (#810)
Browse files Browse the repository at this point in the history
* Exit early on buster ARM64 install

* Set VCPKG_FORCE_SYSTEM_BINARIES when using ARM64

* Remove VCPKG_FORCE_SYSTEM_BINARIES
  • Loading branch information
tarebyte authored May 1, 2024
1 parent c5a5f24 commit beb6f57
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
11 changes: 8 additions & 3 deletions src/cpp/.devcontainer/base-scripts/install-vcpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ USERNAME=${1:-"vscode"}

. /etc/os-release

# Exit early if ARM64 OS does not have cmake version required to build Vcpkg
# The buster pkg repo install cmake version < 3.15 which is required to run bootstrap-vcpkg.sh on ARM64
VCPKG_UNSUPPORTED_ARM64_VERSION_CODENAMES="buster"

if [ "$(dpkg --print-architecture)" = "arm64" ]; then
echo "OS ${VERSION_CODENAME} ARM64 pkg repo installs cmake version < 3.15, which is required to build Vcpkg."
exit 0
# Exit early if ARM64 OS does not have cmake version required to build Vcpkg
if [[ "${VCPKG_UNSUPPORTED_ARM64_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then
echo "OS ${VERSION_CODENAME} ARM64 pkg repo installs cmake version < 3.15, which is required to build Vcpkg."
exit 0
fi
fi

# Add to bashrc/zshrc files for all users.
Expand Down
7 changes: 4 additions & 3 deletions src/cpp/test-project/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ source test-utils.sh vscode
checkCommon

# Help determine distro
. /etc/os-release
. /etc/os-release

checkOSPackages "command-line-tools" build-essential cmake cppcheck valgrind clang lldb llvm gdb
checkOSPackages "tools-for-vcpkg" tar curl zip unzip pkg-config bash-completion ninja-build
if [ "$(dpkg --print-architecture)" = "amd64" ] ; then
VCPKG_UNSUPPORTED_ARM64_VERSION_CODENAMES="buster"
if [ "$(dpkg --print-architecture)" = "amd64" ] || [[ ! "${VCPKG_UNSUPPORTED_ARM64_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then
check "VCPKG_ROOT" [ -d "${VCPKG_ROOT}" ]
check "VCPKG_DOWNLOAD" [ -d "${VCPKG_DOWNLOADS}" ]
VCPKG_FORCE_SYSTEM_BINARIES=1 check "vcpkg-from-root" ${VCPKG_ROOT}/vcpkg --version
VCPKG_FORCE_SYSTEM_BINARIES=1 check "vcpkg-from-bin" vcpkg --version
fi
fi
check "g++" g++ -g main.cpp -o main.out
rm main.out
mkdir -p build
Expand Down

0 comments on commit beb6f57

Please sign in to comment.