From 1b8c1d196a72068ac9cfda506a72df40f9580e3f Mon Sep 17 00:00:00 2001 From: srz_zumix Date: Sun, 12 Apr 2020 14:47:54 +0900 Subject: [PATCH 01/11] update install script --- .ci/linux/install-clang.sh | 25 +++++++++++++++++++++++++ .ci/linux/install-gcc.sh | 15 +++++++++++++++ .circleci/config.yml | 12 ++++-------- .semaphore/semaphore.yml | 18 ++++++------------ 4 files changed, 50 insertions(+), 20 deletions(-) create mode 100644 .ci/linux/install-clang.sh create mode 100644 .ci/linux/install-gcc.sh diff --git a/.ci/linux/install-clang.sh b/.ci/linux/install-clang.sh new file mode 100644 index 0000000000..6a67d8c505 --- /dev/null +++ b/.ci/linux/install-clang.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +set -e + +if [ -z ${CLANG_VERSION+x} ]; then + echo "CLANG_VERSOIN is empty. skip install clang..." + return +fi + +. /etc/os-release +wget -qO - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - +add-apt-repository -y 'deb http://apt.llvm.org/${VERSION_CODENAME}/ llvm-toolchain-${VERSION_CODENAME}-${CLANG_VERSION} main' +apt-get -y --allow-unauthenticated update +apt-get -qq install clang-${CLANG_VERSION} + + +if $INSATLL_CLANG_TOOLS; then + apt-get -y --force-yes -qq install clang-$CLANG_VERSION clang-tools-$CLANG_VERSION + CLANG_SLAVES="--slave /usr/bin/scan-build scan-build /usr/bin/scan-build-$CLANG_VERSION" +fi + +update-alternatives --install /usr/bin/clang clang \ + /usr/bin/clang-${CLANG_VERSION} 360 \ + --slave /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_VERSION} \ + ${CLANG_SLAVES} diff --git a/.ci/linux/install-gcc.sh b/.ci/linux/install-gcc.sh new file mode 100644 index 0000000000..496371cfa0 --- /dev/null +++ b/.ci/linux/install-gcc.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +set -e + +if [ -z ${GCC_VERSION+x} ]; then + echo "GCC_VERSION is empty. skip install gcc..." + return +fi + +add-apt-repository -y ppa:ubuntu-toolchain-r/test +apt-get -y --allow-unauthenticated update +apt-get -qq install g++-${GCC_VERSION} +update-alternatives --install /usr/bin/gcc gcc \ + /usr/bin/gcc-${GCC_VERSION} 90 \ + --slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_VERSION} diff --git a/.circleci/config.yml b/.circleci/config.yml index db74901f86..161ecac7bf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,14 +34,8 @@ aliases: command: | sudo apt-get -y --allow-unauthenticated update sudo apt-get install software-properties-common - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - wget -qO - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - sudo add-apt-repository -y 'deb http://apt.llvm.org/disco/ llvm-toolchain-disco-9 main' - sudo apt-get -y --allow-unauthenticated update - sudo apt-get -qq install clang-9 - sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 60 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-9 - sudo apt-get -qq install g++-8 - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 90 --slave /usr/bin/g++ g++ /usr/bin/g++-8 + sudo ./.ci/linux/install-clnag.sh + sudo ./.ci/linux/install-gcc.sh - &save_cache key: v2-dep-{{ .Branch }}-{{ epoch }} paths: @@ -117,6 +111,7 @@ jobs: <<: *default environment: CXX: g++ + GCC_VERSION: "8" FAST_OPTIMIZE: -Og # FAST_OPTIMIZE: -Ofast # https://github.com/srz-zumix/iutest/issues/396 steps: *build-test-steps @@ -125,6 +120,7 @@ jobs: <<: *default environment: CXX: clang++ + CLANG_VERSION: "9" FAST_OPTIMIZE: -Ot MAKE_ADD_OPTION: CXXFLAGS=-ftime-trace steps: *build-test-steps diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index a04355d7ca..ac0fbee0b9 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -13,8 +13,10 @@ global_job_config: value: -j8 - name: CLANG_VERSION value: "9" - - name: UBNAME - value: bionic + - name: INSATLL_CLANG_TOOLS + value: true + - name: GCC_VERSION + value: "7" prologue: commands: # - checkout --use-cache @@ -38,16 +40,8 @@ blocks: prologue: commands: # - cache restore - - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - - sudo apt-key update && sudo apt-get -qq update - - sudo add-apt-repository -y "deb http://apt.llvm.org/$UBNAME/ llvm-toolchain-$UBNAME-$CLANG_VERSION main" - - sudo add-apt-repository -y "deb http://apt.llvm.org/$UBNAME/ llvm-toolchain-$UBNAME main" - - sudo apt-key update && sudo apt-get -qq update - - sudo apt-cache search clang - - sudo apt-get -y --force-yes -qq install clang-$CLANG_VERSION clang-tools-$CLANG_VERSION - - sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-$CLANG_VERSION 360 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-$CLANG_VERSION --slave /usr/bin/scan-build scan-build /usr/bin/scan-build-$CLANG_VERSION - - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - - sudo apt-get update && sudo apt-get -qq install g++-7 + - sudo ./.ci/linux/install-clang.sh + - sudo ./.ci/linux/install-gcc.sh jobs: - name: minimum_tests commands: From 3b6e2b6e966ffb4070d2b011a58124f07f9fd985 Mon Sep 17 00:00:00 2001 From: srz_zumix Date: Sun, 12 Apr 2020 14:50:57 +0900 Subject: [PATCH 02/11] fix --- .ci/linux/install-clang.sh | 0 .ci/linux/install-gcc.sh | 0 .semaphore/semaphore.yml | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 .ci/linux/install-clang.sh mode change 100644 => 100755 .ci/linux/install-gcc.sh diff --git a/.ci/linux/install-clang.sh b/.ci/linux/install-clang.sh old mode 100644 new mode 100755 diff --git a/.ci/linux/install-gcc.sh b/.ci/linux/install-gcc.sh old mode 100644 new mode 100755 diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index ac0fbee0b9..40aa6e9f16 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -14,7 +14,7 @@ global_job_config: - name: CLANG_VERSION value: "9" - name: INSATLL_CLANG_TOOLS - value: true + value: "true" - name: GCC_VERSION value: "7" prologue: From 1cbf03524958212dfe7d12a7619e0ed6ce7942f2 Mon Sep 17 00:00:00 2001 From: srz_zumix Date: Sun, 12 Apr 2020 15:22:31 +0900 Subject: [PATCH 03/11] fix typo --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 161ecac7bf..8c4748dd80 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,7 +34,7 @@ aliases: command: | sudo apt-get -y --allow-unauthenticated update sudo apt-get install software-properties-common - sudo ./.ci/linux/install-clnag.sh + sudo ./.ci/linux/install-clang.sh sudo ./.ci/linux/install-gcc.sh - &save_cache key: v2-dep-{{ .Branch }}-{{ epoch }} From 5556899f406911dd139c53da0f4e21ab0233618e Mon Sep 17 00:00:00 2001 From: srz_zumix Date: Sun, 12 Apr 2020 15:34:51 +0900 Subject: [PATCH 04/11] sudo --- .ci/linux/install-clang.sh | 12 ++++++------ .ci/linux/install-gcc.sh | 8 ++++---- .circleci/config.yml | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.ci/linux/install-clang.sh b/.ci/linux/install-clang.sh index 6a67d8c505..299d63d9b5 100755 --- a/.ci/linux/install-clang.sh +++ b/.ci/linux/install-clang.sh @@ -3,23 +3,23 @@ set -e if [ -z ${CLANG_VERSION+x} ]; then - echo "CLANG_VERSOIN is empty. skip install clang..." + echo "CLANG_VERSION is empty. skip install clang..." return fi . /etc/os-release wget -qO - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - -add-apt-repository -y 'deb http://apt.llvm.org/${VERSION_CODENAME}/ llvm-toolchain-${VERSION_CODENAME}-${CLANG_VERSION} main' -apt-get -y --allow-unauthenticated update -apt-get -qq install clang-${CLANG_VERSION} +sudo add-apt-repository -y "deb http://apt.llvm.org/${VERSION_CODENAME}/ llvm-toolchain-${VERSION_CODENAME}-${CLANG_VERSION} main" +sudo apt-get -y --allow-unauthenticated update +sudo apt-get -qq install clang-${CLANG_VERSION} if $INSATLL_CLANG_TOOLS; then - apt-get -y --force-yes -qq install clang-$CLANG_VERSION clang-tools-$CLANG_VERSION + sudo apt-get -y --force-yes -qq install clang-$CLANG_VERSION clang-tools-$CLANG_VERSION CLANG_SLAVES="--slave /usr/bin/scan-build scan-build /usr/bin/scan-build-$CLANG_VERSION" fi -update-alternatives --install /usr/bin/clang clang \ +sudo update-alternatives --install /usr/bin/clang clang \ /usr/bin/clang-${CLANG_VERSION} 360 \ --slave /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_VERSION} \ ${CLANG_SLAVES} diff --git a/.ci/linux/install-gcc.sh b/.ci/linux/install-gcc.sh index 496371cfa0..d4e7bf4334 100755 --- a/.ci/linux/install-gcc.sh +++ b/.ci/linux/install-gcc.sh @@ -7,9 +7,9 @@ if [ -z ${GCC_VERSION+x} ]; then return fi -add-apt-repository -y ppa:ubuntu-toolchain-r/test -apt-get -y --allow-unauthenticated update -apt-get -qq install g++-${GCC_VERSION} -update-alternatives --install /usr/bin/gcc gcc \ +sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test +sudo apt-get -y --allow-unauthenticated update +sudo apt-get -qq install g++-${GCC_VERSION} +sudo update-alternatives --install /usr/bin/gcc gcc \ /usr/bin/gcc-${GCC_VERSION} 90 \ --slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_VERSION} diff --git a/.circleci/config.yml b/.circleci/config.yml index 8c4748dd80..d0a71e5550 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,8 +34,8 @@ aliases: command: | sudo apt-get -y --allow-unauthenticated update sudo apt-get install software-properties-common - sudo ./.ci/linux/install-clang.sh - sudo ./.ci/linux/install-gcc.sh + ./.ci/linux/install-clang.sh + ./.ci/linux/install-gcc.sh - &save_cache key: v2-dep-{{ .Branch }}-{{ epoch }} paths: From 70c3641c5b2364eb47902cf61f0bb055b228ed17 Mon Sep 17 00:00:00 2001 From: srz_zumix Date: Sun, 12 Apr 2020 15:53:36 +0900 Subject: [PATCH 05/11] debug --- .ci/linux/install-gcc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/linux/install-gcc.sh b/.ci/linux/install-gcc.sh index d4e7bf4334..1a97fdc850 100755 --- a/.ci/linux/install-gcc.sh +++ b/.ci/linux/install-gcc.sh @@ -1,6 +1,6 @@ #!/bin/sh -set -e +set -ex if [ -z ${GCC_VERSION+x} ]; then echo "GCC_VERSION is empty. skip install gcc..." @@ -8,7 +8,7 @@ if [ -z ${GCC_VERSION+x} ]; then fi sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test -sudo apt-get -y --allow-unauthenticated update +sudo apt-get -y update sudo apt-get -qq install g++-${GCC_VERSION} sudo update-alternatives --install /usr/bin/gcc gcc \ /usr/bin/gcc-${GCC_VERSION} 90 \ From 25cd287b4cf2a588bcb0e13cba6a6352e16187c2 Mon Sep 17 00:00:00 2001 From: srz_zumix Date: Sun, 12 Apr 2020 17:46:22 +0900 Subject: [PATCH 06/11] fix --- .ci/linux/install-gcc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/linux/install-gcc.sh b/.ci/linux/install-gcc.sh index 1a97fdc850..375eee592a 100755 --- a/.ci/linux/install-gcc.sh +++ b/.ci/linux/install-gcc.sh @@ -1,13 +1,13 @@ #!/bin/sh -set -ex +set -e if [ -z ${GCC_VERSION+x} ]; then echo "GCC_VERSION is empty. skip install gcc..." return fi -sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test +sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test || true sudo apt-get -y update sudo apt-get -qq install g++-${GCC_VERSION} sudo update-alternatives --install /usr/bin/gcc gcc \ From 435a4c969c0f080c89b0aa96f35dc64e0d3f76f7 Mon Sep 17 00:00:00 2001 From: srz_zumix Date: Sun, 12 Apr 2020 20:35:05 +0900 Subject: [PATCH 07/11] add key --- .ci/linux/install-clang.sh | 6 +++--- .ci/linux/install-gcc.sh | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.ci/linux/install-clang.sh b/.ci/linux/install-clang.sh index 299d63d9b5..4d7a07fcab 100755 --- a/.ci/linux/install-clang.sh +++ b/.ci/linux/install-clang.sh @@ -11,12 +11,12 @@ fi wget -qO - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - sudo add-apt-repository -y "deb http://apt.llvm.org/${VERSION_CODENAME}/ llvm-toolchain-${VERSION_CODENAME}-${CLANG_VERSION} main" sudo apt-get -y --allow-unauthenticated update -sudo apt-get -qq install clang-${CLANG_VERSION} +sudo apt-get -qq install "clang-${CLANG_VERSION}" if $INSATLL_CLANG_TOOLS; then - sudo apt-get -y --force-yes -qq install clang-$CLANG_VERSION clang-tools-$CLANG_VERSION - CLANG_SLAVES="--slave /usr/bin/scan-build scan-build /usr/bin/scan-build-$CLANG_VERSION" + sudo apt-get -y --force-yes -qq install "clang-tools-${CLANG_VERSION}" + CLANG_SLAVES="--slave /usr/bin/scan-build scan-build /usr/bin/scan-build-${CLANG_VERSION}" fi sudo update-alternatives --install /usr/bin/clang clang \ diff --git a/.ci/linux/install-gcc.sh b/.ci/linux/install-gcc.sh index 375eee592a..6e20b05c84 100755 --- a/.ci/linux/install-gcc.sh +++ b/.ci/linux/install-gcc.sh @@ -7,9 +7,10 @@ if [ -z ${GCC_VERSION+x} ]; then return fi -sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test || true -sudo apt-get -y update -sudo apt-get -qq install g++-${GCC_VERSION} +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - +sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test +sudo apt-get -y --allow-unauthenticated update +sudo apt-get -qq install "g++-${GCC_VERSION}" sudo update-alternatives --install /usr/bin/gcc gcc \ /usr/bin/gcc-${GCC_VERSION} 90 \ --slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_VERSION} From ce4e0cb8ba3edd78f69693c1c2d01b014c5b8eca Mon Sep 17 00:00:00 2001 From: srz_zumix Date: Sun, 12 Apr 2020 20:59:24 +0900 Subject: [PATCH 08/11] fix sudo semaphore --- .semaphore/semaphore.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 40aa6e9f16..677ef10ccc 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -40,8 +40,8 @@ blocks: prologue: commands: # - cache restore - - sudo ./.ci/linux/install-clang.sh - - sudo ./.ci/linux/install-gcc.sh + - ./.ci/linux/install-clang.sh + - ./.ci/linux/install-gcc.sh jobs: - name: minimum_tests commands: From 310bd34b2da616851d0467013bfda457d4ebbd54 Mon Sep 17 00:00:00 2001 From: srz_zumix Date: Sun, 12 Apr 2020 21:54:53 +0900 Subject: [PATCH 09/11] update --- .ci/linux/install-gcc.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.ci/linux/install-gcc.sh b/.ci/linux/install-gcc.sh index 6e20b05c84..421423f69b 100755 --- a/.ci/linux/install-gcc.sh +++ b/.ci/linux/install-gcc.sh @@ -7,8 +7,15 @@ if [ -z ${GCC_VERSION+x} ]; then return fi -curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - -sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test +. /etc/os-release +MAJOR_VERSION=$(echo ${VERSION_ID} | cut -d '.' -f1) + +if [[ ${MAJOR_VERSION} -lt 19 ]]; then + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test +else + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/ppa +fi + sudo apt-get -y --allow-unauthenticated update sudo apt-get -qq install "g++-${GCC_VERSION}" sudo update-alternatives --install /usr/bin/gcc gcc \ From 9f635c20ed9100ecdedbcde09ada39526f72c895 Mon Sep 17 00:00:00 2001 From: srz_zumix Date: Sun, 12 Apr 2020 22:26:23 +0900 Subject: [PATCH 10/11] fix shellcheck --- .ci/linux/install-gcc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/linux/install-gcc.sh b/.ci/linux/install-gcc.sh index 421423f69b..abcfed1fa7 100755 --- a/.ci/linux/install-gcc.sh +++ b/.ci/linux/install-gcc.sh @@ -10,7 +10,7 @@ fi . /etc/os-release MAJOR_VERSION=$(echo ${VERSION_ID} | cut -d '.' -f1) -if [[ ${MAJOR_VERSION} -lt 19 ]]; then +if [ ${MAJOR_VERSION} -lt 19 ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test else sudo add-apt-repository -y ppa:ubuntu-toolchain-r/ppa From 701b24cabdeecd7ed414613520a51c58e5609583 Mon Sep 17 00:00:00 2001 From: srz_zumix Date: Sun, 12 Apr 2020 22:33:24 +0900 Subject: [PATCH 11/11] fix shellcheck --- .ci/linux/install-gcc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/linux/install-gcc.sh b/.ci/linux/install-gcc.sh index abcfed1fa7..34f592a475 100755 --- a/.ci/linux/install-gcc.sh +++ b/.ci/linux/install-gcc.sh @@ -10,7 +10,7 @@ fi . /etc/os-release MAJOR_VERSION=$(echo ${VERSION_ID} | cut -d '.' -f1) -if [ ${MAJOR_VERSION} -lt 19 ]; then +if [ "${MAJOR_VERSION}" -lt 19 ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test else sudo add-apt-repository -y ppa:ubuntu-toolchain-r/ppa