From b692d6923a5cb11e546e727d5f6bac45191ce4de Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev Date: Thu, 16 Apr 2020 10:44:05 +0300 Subject: [PATCH 1/5] remove workaround --- images/linux/scripts/installers/vcpkg.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/images/linux/scripts/installers/vcpkg.sh b/images/linux/scripts/installers/vcpkg.sh index d9672348e7..9f6e60aa73 100644 --- a/images/linux/scripts/installers/vcpkg.sh +++ b/images/linux/scripts/installers/vcpkg.sh @@ -12,11 +12,7 @@ VCPKG_INSTALLATION_ROOT=/usr/local/share/vcpkg echo "VCPKG_INSTALLATION_ROOT=${VCPKG_INSTALLATION_ROOT}" | tee -a /etc/environment # Install vcpkg -git clone https://github.com/Microsoft/vcpkg $VCPKG_INSTALLATION_ROOT -# Workaround to avoid issues caused by this PR https://github.com/microsoft/vcpkg/pull/10834 -cd $VCPKG_INSTALLATION_ROOT -git checkout 1e19af09e53e5f306ed89c2033817a21e5ee0bcf - +git clone --depth=1 https://github.com/Microsoft/vcpkg $VCPKG_INSTALLATION_ROOT $VCPKG_INSTALLATION_ROOT/bootstrap-vcpkg.sh $VCPKG_INSTALLATION_ROOT/vcpkg integrate install chmod 0777 -R $VCPKG_INSTALLATION_ROOT From 6f4a608cb04119000bbe73485fc84b138644d805 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev Date: Thu, 16 Apr 2020 19:10:19 +0300 Subject: [PATCH 2/5] add workaround for ubuntu 16 --- images/linux/scripts/installers/vcpkg.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/images/linux/scripts/installers/vcpkg.sh b/images/linux/scripts/installers/vcpkg.sh index 9f6e60aa73..abaa6c9ab1 100644 --- a/images/linux/scripts/installers/vcpkg.sh +++ b/images/linux/scripts/installers/vcpkg.sh @@ -6,6 +6,7 @@ # Source the helpers for use with the script source $HELPER_SCRIPTS/document.sh +source $HELPER_SCRIPTS/os.sh # Set env variable for vcpkg VCPKG_INSTALLATION_ROOT=/usr/local/share/vcpkg @@ -13,11 +14,22 @@ echo "VCPKG_INSTALLATION_ROOT=${VCPKG_INSTALLATION_ROOT}" | tee -a /etc/environm # Install vcpkg git clone --depth=1 https://github.com/Microsoft/vcpkg $VCPKG_INSTALLATION_ROOT + +# vcpkg requires g++ version 7+, yet Ubuntu 16 default is 5.4. Set version 7 as default temporarily +if isUbuntu16; then + sudo ln -sf g++-7 /usr/bin/g++ +fi + $VCPKG_INSTALLATION_ROOT/bootstrap-vcpkg.sh $VCPKG_INSTALLATION_ROOT/vcpkg integrate install chmod 0777 -R $VCPKG_INSTALLATION_ROOT ln -sf $VCPKG_INSTALLATION_ROOT/vcpkg /usr/local/bin +# set back g++ 5.4 as default +if isUbuntu16; then + sudo ln -sf g++-5 /usr/bin/g++ +fi + # Run tests to determine that the software installed as expected echo "Testing to make sure that script performed as expected, and basic scenarios work" if ! command -v vcpkg; then @@ -28,3 +40,7 @@ fi # Document what was added to the image echo "Lastly, documenting what we added to the metadata file" DocumentInstalledItem "Vcpkg $(vcpkg version | head -n 1 | cut -d ' ' -f 6)" + + + + From 235d2cef95f2de0dedbad8d2f227ecbd186c1d37 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev Date: Thu, 16 Apr 2020 19:10:34 +0300 Subject: [PATCH 3/5] remove sudo --- images/linux/scripts/installers/vcpkg.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images/linux/scripts/installers/vcpkg.sh b/images/linux/scripts/installers/vcpkg.sh index abaa6c9ab1..4e9224ed0b 100644 --- a/images/linux/scripts/installers/vcpkg.sh +++ b/images/linux/scripts/installers/vcpkg.sh @@ -17,7 +17,7 @@ git clone --depth=1 https://github.com/Microsoft/vcpkg $VCPKG_INSTALLATION_ROOT # vcpkg requires g++ version 7+, yet Ubuntu 16 default is 5.4. Set version 7 as default temporarily if isUbuntu16; then - sudo ln -sf g++-7 /usr/bin/g++ + ln -sf g++-7 /usr/bin/g++ fi $VCPKG_INSTALLATION_ROOT/bootstrap-vcpkg.sh @@ -27,7 +27,7 @@ ln -sf $VCPKG_INSTALLATION_ROOT/vcpkg /usr/local/bin # set back g++ 5.4 as default if isUbuntu16; then - sudo ln -sf g++-5 /usr/bin/g++ + ln -sf g++-5 /usr/bin/g++ fi # Run tests to determine that the software installed as expected From 65b3569cb55b4db93375250334c903d9ee3fc2c1 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev Date: Thu, 16 Apr 2020 19:10:54 +0300 Subject: [PATCH 4/5] Spelling --- images/linux/scripts/installers/vcpkg.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/linux/scripts/installers/vcpkg.sh b/images/linux/scripts/installers/vcpkg.sh index 4e9224ed0b..4bcac4c20c 100644 --- a/images/linux/scripts/installers/vcpkg.sh +++ b/images/linux/scripts/installers/vcpkg.sh @@ -25,7 +25,7 @@ $VCPKG_INSTALLATION_ROOT/vcpkg integrate install chmod 0777 -R $VCPKG_INSTALLATION_ROOT ln -sf $VCPKG_INSTALLATION_ROOT/vcpkg /usr/local/bin -# set back g++ 5.4 as default +# Set back g++ 5.4 as default if isUbuntu16; then ln -sf g++-5 /usr/bin/g++ fi From cfa321e13646a3ca83f51e80343aa86ae4173a2d Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev Date: Thu, 16 Apr 2020 19:15:16 +0300 Subject: [PATCH 5/5] remove extra lines --- images/linux/scripts/installers/vcpkg.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/images/linux/scripts/installers/vcpkg.sh b/images/linux/scripts/installers/vcpkg.sh index 4bcac4c20c..69f50c5e7d 100644 --- a/images/linux/scripts/installers/vcpkg.sh +++ b/images/linux/scripts/installers/vcpkg.sh @@ -40,7 +40,3 @@ fi # Document what was added to the image echo "Lastly, documenting what we added to the metadata file" DocumentInstalledItem "Vcpkg $(vcpkg version | head -n 1 | cut -d ' ' -f 6)" - - - -