Skip to content

Commit beb6f57

Browse files
authored
[Cpp] - Only exit vcpkg install early on Buster ARM64 (devcontainers#810)
* Exit early on buster ARM64 install * Set VCPKG_FORCE_SYSTEM_BINARIES when using ARM64 * Remove VCPKG_FORCE_SYSTEM_BINARIES
1 parent c5a5f24 commit beb6f57

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/cpp/.devcontainer/base-scripts/install-vcpkg.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@ USERNAME=${1:-"vscode"}
1010

1111
. /etc/os-release
1212

13-
# Exit early if ARM64 OS does not have cmake version required to build Vcpkg
13+
# The buster pkg repo install cmake version < 3.15 which is required to run bootstrap-vcpkg.sh on ARM64
14+
VCPKG_UNSUPPORTED_ARM64_VERSION_CODENAMES="buster"
15+
1416
if [ "$(dpkg --print-architecture)" = "arm64" ]; then
15-
echo "OS ${VERSION_CODENAME} ARM64 pkg repo installs cmake version < 3.15, which is required to build Vcpkg."
16-
exit 0
17+
# Exit early if ARM64 OS does not have cmake version required to build Vcpkg
18+
if [[ "${VCPKG_UNSUPPORTED_ARM64_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then
19+
echo "OS ${VERSION_CODENAME} ARM64 pkg repo installs cmake version < 3.15, which is required to build Vcpkg."
20+
exit 0
21+
fi
1722
fi
1823

1924
# Add to bashrc/zshrc files for all users.

src/cpp/test-project/test.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ source test-utils.sh vscode
77
checkCommon
88

99
# Help determine distro
10-
. /etc/os-release
10+
. /etc/os-release
1111

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

0 commit comments

Comments
 (0)