Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Set VCPKG_FORCE_SYSTEM_BINARIES when using ARM64
  • Loading branch information
tarebyte committed Oct 17, 2023
commit 68045a5a39797151ff1b936ffe6ec7e792394d8a
19 changes: 15 additions & 4 deletions src/cpp/.devcontainer/base-scripts/install-vcpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ USERNAME=${1:-"vscode"}
# 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"

# Exit early if ARM64 OS does not have cmake version required to build Vcpkg
if [ "$(dpkg --print-architecture)" = "arm64" ] && [[ "${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
if [ "$(dpkg --print-architecture)" = "arm64" ]; then
# 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

export VCPKG_FORCE_SYSTEM_BINARIES=1
fi

# Add to bashrc/zshrc files for all users.
Expand Down Expand Up @@ -83,6 +87,13 @@ if [[ "\${PATH}" != *"\${VCPKG_ROOT}"* ]]; then export PATH="\${PATH}:\${VCPKG_R
EOF
)"

if [[ -n "$VCPKG_FORCE_SYSTEM_BINARIES" ]]; then
updaterc "$(cat << EOF
export VCPKG_FORCE_SYSTEM_BINARIES=1
EOF
)"
fi

# Give read/write permissions to the user group.
chown -R ":vcpkg" "${VCPKG_ROOT}" "${VCPKG_DOWNLOADS}"
chmod g+r+w+s "${VCPKG_ROOT}" "${VCPKG_DOWNLOADS}"
Expand Down