Skip to content

Commit

Permalink
Merge pull request #256 from andreasfertig/switchToLLVM9
Browse files Browse the repository at this point in the history
Switch to LLVM 9 and bump development version to 0.5.
  • Loading branch information
andreasfertig authored Oct 18, 2019
2 parents 7ec66b6 + c0a63e8 commit eb0b102
Show file tree
Hide file tree
Showing 69 changed files with 331 additions and 207 deletions.
61 changes: 37 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,22 @@ llvm_current_packages: &all_llvm_current_packages
jobs:
include:

# OSX clang 8 build
- env: COMPILER='clang++' LLVM_CONFIG='llvm-config' LLVM_VERSION='8.0.0' COVERAGE='No' STATIC='No' DEBUG='No' UPLOAD='Yes' SKIP_TESTS='No' TIDY='No' SHACMD='shasum -a 256'
# OSX clang 9 build
- env: COMPILER='clang++' LLVM_CONFIG='llvm-config' LLVM_VERSION='9.0.0' COVERAGE='No' STATIC='No' DEBUG='No' UPLOAD='Yes' SKIP_TESTS='No' TIDY='No' SHACMD='shasum -a 256'
os: osx
osx_image: xcode9.3
name: "Clang 9 @ macOS Release"
osx_image: xcode11.2
compiler: clang

- env: COMPILER='clang++' LLVM_CONFIG='llvm-config' LLVM_VERSION='8.0.0' COVERAGE='Yes' STATIC='No' DEBUG='Yes' UPLOAD='No' SKIP_TESTS='No' TIDY='No' SHACMD='shasum -a 256'
os: osx
osx_image: xcode9.3
compiler: clang
# - env: COMPILER='clang++' LLVM_CONFIG='llvm-config' LLVM_VERSION='9.0.0' COVERAGE='Yes' STATIC='No' DEBUG='Yes' UPLOAD='No' SKIP_TESTS='No' TIDY='No' SHACMD='shasum -a 256'
# os: osx
# name: "Clang 9 @ macOS Code Coverage & Debug"
# osx_image: xcode11.2
# compiler: clang

# Linux Clang Build
- os: linux
name: "Clang unstable @ Ubuntu"
compiler: clang
addons:
apt:
Expand All @@ -44,17 +47,19 @@ jobs:

# Clang stable deployment
- os: linux
name: "Clang stable @ Ubuntu Release"
sudo: required
services:
- docker
addons:
ssh_known_hosts: cppinsights.io
before_install:
- docker pull andreasfertig/cppinsights-builder
env: COMPILER='clang++-8' LLVM_CONFIG=/usr/bin/llvm-config-8 COVERAGE='No' DEPLOY='Yes' STATIC='Yes' DEBUG='No' UPLOAD='Yes' TIDY='No' SHACMD='sha256sum'
env: COMPILER='clang++-9' LLVM_CONFIG=/usr/bin/llvm-config-9 COVERAGE='No' DEPLOY='Yes' STATIC='Yes' DEBUG='No' UPLOAD='Yes' TIDY='No' SHACMD='sha256sum'

# Linux g++ Build
- os: linux
name: "GCC 8 / LLVM unstable @ Ubuntu"
compiler: gcc
addons:
apt:
Expand All @@ -64,38 +69,42 @@ jobs:
- *all_llvm_current_packages
env: COMPILER='g++-8' LLVM_CONFIG=${LLVM_CONFIG_CURRENT} COVERAGE='No' STATIC='No' DEBUG='No' TIDY='No'

# Linux g++ clang 8 build
# Linux g++ clang 9 build
- os: linux
name: "GCC 8 / LLVM 9 @ Ubuntu"
compiler: gcc
addons: &clang80
addons: &clang90
apt:
packages:
- g++-8
- llvm-8-dev
- libclang-8-dev
- clang-format-8
- clang-tidy-8
- llvm-9-dev
- libclang-9-dev
- clang-format-9
- clang-tidy-9
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-8
- sourceline: 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main'
- llvm-toolchain-xenial-9
- sourceline: 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
env: COMPILER='g++-8' LLVM_CONFIG='/usr/bin/llvm-config-8' COVERAGE='No' STATIC='No' DEBUG='No' TIDY='No'
env: COMPILER='g++-8' LLVM_CONFIG='/usr/bin/llvm-config-9' COVERAGE='No' STATIC='No' DEBUG='No' TIDY='No'

# Clang-tidy analysis
- os: linux
name: "GCC 8 / LLVM 9 @ Ubuntu clang-tidy check"
compiler: gcc
addons: *clang80
env: COMPILER='g++-8' LLVM_CONFIG='/usr/bin/llvm-config-8' COVERAGE='No' STATIC='No' DEBUG='No' TIDY='Yes'
addons: *clang90
env: COMPILER='g++-8' LLVM_CONFIG='/usr/bin/llvm-config-9' COVERAGE='No' STATIC='No' DEBUG='No' TIDY='Yes'

# Clang-format check
- os: linux
name: "GCC 8 / LLVM 9 @ Ubuntu clang-format check"
compiler: gcc
addons: *clang80
env: COMPILER='g++-8' LLVM_CONFIG='/usr/bin/llvm-config-8' COVERAGE='No' STATIC='No' DEBUG='No' TIDY='No' CFORMAT='Yes' CFORMAT_NAME='clang-format-8'
addons: *clang90
env: COMPILER='g++-8' LLVM_CONFIG='/usr/bin/llvm-config-9' COVERAGE='No' STATIC='No' DEBUG='No' TIDY='No' CFORMAT='Yes' CFORMAT_NAME='clang-format-9'

# Debug build with coverage
- os: linux
name: "GCC 8 / LLVM unstable @ Ubuntu Code Coverage & Debug"
compiler: gcc
addons: &covcurrent
apt:
Expand All @@ -107,8 +116,8 @@ jobs:
- lcov
env: COMPILER='g++-8' LLVM_CONFIG=${LLVM_CONFIG_CURRENT} COVERAGE='Yes' STATIC='No' DEBUG='Yes' TIDY='No'

# Linux Clang Coverage Build
- os: linux
name: "GCC 8 / LLVM unstable @ Ubuntu Code Coverage"
compiler: gcc
addons: *covcurrent
env: COMPILER='g++-8' LLVM_CONFIG=${LLVM_CONFIG_CURRENT} STATIC='No' COVERAGE='Yes' DEBUG='No' TIDY='No'
Expand All @@ -125,8 +134,9 @@ jobs:
fi
after_success: true
before_deploy: true
env: COMPILER='clang++-8' LLVM_CONFIG=/usr/bin/llvm-config-8 COVERAGE='No' DEPLOY='No' STATIC='No' DEBUG='No' UPLOAD='No' TIDY='No' SHACMD='sha256sum' DOCKER_UPLOAD='Yes'
env: COMPILER='clang++-9' LLVM_CONFIG=/usr/bin/llvm-config-9 COVERAGE='No' DEPLOY='No' STATIC='No' DEBUG='No' UPLOAD='No' TIDY='No' SHACMD='sha256sum' DOCKER_UPLOAD='Yes'
os: linux
name: "Final deploy to DockerHub"

install:
- |
Expand All @@ -145,7 +155,10 @@ install:
wget -q --continue --directory-prefix=$HOME/Library/Caches/Homebrew https://github.com/andreasfertig/cppinsights-compiler-binaries/releases/download/${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-apple-darwin.tar.xz
mkdir current
tar -xJf $HOME/Library/Caches/Homebrew/clang+llvm-${LLVM_VERSION}-x86_64-apple-darwin.tar.xz -C current --strip-components 1
tar -xJf $HOME/Library/Caches/Homebrew/clang+llvm-${LLVM_VERSION}-x86_64-apple-darwin.tar.xz -C current --strip-components 1
# Temporary fix for image: xcode11 to use GCC.
# Source: https://github.com/Farwaykorse/fwkSudoku/commit/9dff745e37390abcfacd6e4f8da650e7db54444e
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
fi
- |
if [[ "${UPLOAD}" = "Yes" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ endif()

set(INSIGHTS_LLVM_CONFIG "llvm-config" CACHE STRING "LLVM config executable to use")

set(INSIGHTS_MIN_LLVM_MAJOR_VERSION 8)
set(INSIGHTS_MIN_LLVM_MAJOR_VERSION 9)
set(INSIGHTS_MIN_LLVM_VERSION ${INSIGHTS_MIN_LLVM_MAJOR_VERSION}.0)

if(NOT DEFINED LLVM_VERSION_MAJOR) # used when build inside the clang tool/extra folder
Expand Down
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ install:
- cmd: if not exist C:\llvm-bin\downloaded (
mkdir C:\llvm-bin &&
cd C:\llvm-bin &&
(powershell Start-FileDownload "https://github.com/andreasfertig/cppinsights-compiler-binaries/releases/download/8.0.0/llvm+clang-8.0.0-win64-msvc-release.tar.xz" -FileName llvm.tar.xz) &&
(powershell Start-FileDownload "https://github.com/andreasfertig/cppinsights-compiler-binaries/releases/download/9.0.0/llvm+clang-9.0.0-win64-msvc-release.tar.xz" -FileName llvm.tar.xz) &&
7z x C:\llvm-bin\llvm.tar.xz &&
7z x C:\llvm-bin\llvm.tar &&
del llvm.tar &&
echo "downloaded" > downloaded )
- cmd: set PATH=%PATH%;C:\llvm-bin\llvm+clang-8.0.0-win64-msvc-release\bin
- cmd: set PATH=%PATH%;C:\llvm-bin\llvm+clang-9.0.0-win64-msvc-release\bin
- cmd: echo PATH %PATH%
- cmd: md c:\ciuploadtool
- cmd: cd c:\ciuploadtool
Expand All @@ -28,7 +28,7 @@ build_script:
- cmd: mkdir "%APPVEYOR_BUILD_FOLDER%/build"
- cmd: cd "%APPVEYOR_BUILD_FOLDER%/build"
- cmd: clang++ --version
- cmd: cmake -G "Visual Studio 15 2017 Win64" -T LLVM -DINSIGHTS_STATIC=Yes -DINSIGHTS_LLVM_CONFIG=C:\llvm-bin\llvm+clang-8.0.0-win64-msvc-release\bin\llvm-config ..
- cmd: cmake -G "Visual Studio 15 2017 Win64" -T LLVM -DINSIGHTS_STATIC=Yes -DINSIGHTS_LLVM_CONFIG=C:\llvm-bin\llvm+clang-9.0.0-win64-msvc-release\bin\llvm-config ..

- cmd: cmake --build . --config Release --target insights
- cmd: cd Release
Expand Down
100 changes: 100 additions & 0 deletions scripts/prepare-release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#! /usr/bin/env python3
#
#
# C++ Insights, copyright (C) by Andreas Fertig
# Distributed under an MIT license. See LICENSE for details
#
#------------------------------------------------------------------------------

import re
import os
import subprocess
#------------------------------------------------------------------------------

def main():
oldClangDevel = '9'
newClangDevel = '10'
oldClangStable = '8'
newClangStable = oldClangDevel
oldInsightsVersion = '0.4'
newInsightsVersion = '0.5'

print('Preparing a new release:')
print(' Current Clang development : %s' %(oldClangDevel))
print(' New Clang development : %s' %(newClangDevel))
print(' Current Clang stable : %s' %(oldClangStable))
print(' New Clang stable : %s' %(newClangStable))
print(' Current Insights version : %s' %(oldInsightsVersion))
print(' New Insights version : %s' %(newInsightsVersion))


print(' - Updating .travis.yml')
travis = open('.travis.yml', 'r').read()

regEx = re.compile('[clang|llvm]-([0-9]+)')
# regEx = re.compile('llvm-([0-9]+)', re.MULTILINE)

travis = re.sub('(clang|llvm|clang\+\+|llvm-config|llvm-toolchain-bionic|clang-format|clang-tidy|llvm-toolchain-trusty)(-%s)' %(oldClangDevel), '\\1-%s' %(newClangDevel) , travis)
travis = re.sub('(clang|llvm|clang\+\+|llvm-config|llvm-toolchain-bionic|clang-format|clang-tidy|llvm-toolchain-trusty)(-%s)' %(oldClangStable), '\\1-%s' %(newClangStable) , travis)
travis = re.sub('(clang|Clang|llvm|LLVM) (%s)' %(oldClangStable), '\\1 %s' %(newClangStable) , travis)
travis = re.sub(r"(LLVM_VERSION=)('%s)" %(oldClangStable), r"\1'%s" %(newClangStable) , travis)
travis = re.sub(r"clang(%s)0" %(oldClangStable), r"clang%s0" %(newClangStable) , travis)
travis = re.sub(r"(llvm-toolchain-xenial)-(%s)" %(oldClangStable), r"\1-%s" %(newClangStable) , travis)
# travis = re.sub('([clang|llvm])(-[0-9]+)', r'\1-%s' %(newClangDevel) , travis)
# print regEx.sub(travis, r'\1', newClangDevel)
# m = regEx.findall(travis)

# print(travis)
open('.travis.yml', 'w').write(travis)


print(' - Updating appveyor.yml')
appveyor = open('appveyor.yml', 'r').read()
appveyor = re.sub('(clang|llvm|clang\+\+|llvm-config|llvm-toolchain-bionic|clang-format|clang-tidy|llvm-toolchain-trusty)(-%s)' %(oldClangDevel), '\\1-%s' %(newClangDevel) , appveyor)
appveyor = re.sub('(clang|llvm|clang\+\+|llvm-config|llvm-toolchain-bionic|clang-format|clang-tidy|llvm-toolchain-trusty)(-%s)' %(oldClangStable), '\\1-%s' %(newClangStable) , appveyor)
appveyor = re.sub('(download)(/%s.)(0.0/llvm)' %(oldClangStable), '\\1/%s.\\3' %(newClangStable) , appveyor)
appveyor = re.sub(r"(LLVM_VERSION=)('%s)" %(oldClangStable), r"\1'%s" %(newClangStable) , appveyor)
open('appveyor.yml', 'w').write(appveyor)


print(' - Updating CMakeLists.txt')
cmake = open('CMakeLists.txt', 'r').read()
cmake = re.sub('(set\(INSIGHTS_MIN_LLVM_MAJOR_VERSION)( %s)\)' %(oldClangStable), '\\1 %s)' %(newClangStable) , cmake)
open('CMakeLists.txt', 'w').write(cmake)


print(' - Updating version.h %s -> %s' %(oldInsightsVersion, newInsightsVersion))
version = open('version.h.in', 'r').read()
version = re.sub('(INSIGHTS_VERSION )"(.*)"', '\\1"%s"' %(newInsightsVersion) , version)
open('version.h.in', 'w').write(version)


print(' - Generating CHANGELOG.md')
# os.system('gren changelog --override --username=andreasfertig --repo=cppinsights %s...continous' %(oldInsightsVersion))

cmd = ['gren', 'changelog', '--override', '--username=andreasfertig', '--repo=cppinsights', '%s...continous' %(oldInsightsVersion)]
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate()

if 0 != p.returncode:
print('FAILED')
return 1

changeLog = open('CHANGELOG.md', 'r').read()
changeLog = re.sub('(## Continuous build.*?---)\n', '', changeLog, flags=re.DOTALL)
open('CHANGELOG.md', 'w').write(changeLog)

print(' - Tagging v_%s' %(newInsightsVersion))

cppInsightsDockerBaseFile = '../cppinsights-docker-base/Dockerfile'

print(' - Updating cppinsights-docker-base (%s)' %(cppInsightsDockerBaseFile))

dockerFile = open(cppInsightsDockerBaseFile, 'r').read()
dockerFile = re.sub('(ENV\s+CLANG_VERSION=)([0-9]+)', r'\g<1>%s' %(newClangStable), dockerFile)
open(cppInsightsDockerBaseFile, 'w').write(dockerFile)
#------------------------------------------------------------------------------

main()
#------------------------------------------------------------------------------

2 changes: 1 addition & 1 deletion tests/CharLiteralTest.expect
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct Foo<char>

inline void operator=(char v) volatile;

// inline ~Foo() = default;
// inline ~Foo() noexcept = default;
};

#endif
Expand Down
1 change: 0 additions & 1 deletion tests/ClassOpInTemplateFunctionTest.expect
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class Foo

}

/* First instantiated from: ClassOpInTemplateFunctionTest.cpp:37 */
#ifdef INSIGHTS_USE_TEMPLATE
template<>
inline constexpr int get<1>() const noexcept
Expand Down
2 changes: 1 addition & 1 deletion tests/ClassOperatorHandler2Test.expect
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ int main()
}

using retType_60_5 = void (*)();
inline /*constexpr */ operator retType_60_5 () const
inline /*constexpr */ operator retType_60_5 () const noexcept
{
return __invoke;
};
Expand Down
5 changes: 2 additions & 3 deletions tests/ClassTemplateDeclTest.cerr
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.tmp.cpp:33:23: error: no template named 'Tmpl'; did you mean 'Test::Tmpl'?
.tmp.cpp:33:23: error: use of undeclared identifier 'Tmpl'; did you mean 'Test::Tmpl'?
Test::Tmpl<int> x = Tmpl<int>();
^~~~
Test::Tmpl
^
.tmp.cpp:9:9: note: 'Test::Tmpl' declared here
class Tmpl
^
Expand Down
2 changes: 1 addition & 1 deletion tests/CompilerGeneratedHandler2Test.expect
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class C2

public:
const int i{2};
inline constexpr C2() = default;
inline constexpr C2() noexcept = default;
};


Expand Down
2 changes: 1 addition & 1 deletion tests/EmptyLambda.expect
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ void foo()
}

using retType_2_1 = void (*)();
inline /*constexpr */ operator retType_2_1 () const
inline /*constexpr */ operator retType_2_1 () const noexcept
{
return __invoke;
};
Expand Down
Loading

0 comments on commit eb0b102

Please sign in to comment.