Skip to content

Commit d7ec276

Browse files
deboost (#112)
* deboost * update ci * formatting * install clang-11 * update clang tidy * clang tidy fixes * fixes for win32 * fix clang-tidy linter errors * clang tidy allowed types * clang-tidy fixes * install ninja * ubuntu-20.04 for clang-format check * ninja for mac os * update conf
1 parent 2104fee commit d7ec276

File tree

127 files changed

+456
-2292
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+456
-2292
lines changed

.clang-tidy.in

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
Checks: "*,\
2+
-llvmlibc-*,\
3+
-abseil-*,\
4+
-llvm-else-after-return,\
5+
-hicpp-named-parameter,\
26
-cert-err60-cpp,\
37
-clang-analyzer-core.NonNullParamChecker,\
48
-misc-unused-parameters,\
@@ -40,7 +44,7 @@ Checks: "*,\
4044
-cppcoreguidelines-pro-bounds-constant-array-index,\
4145
-*-avoid-c-arrays,\
4246
-*-narrowing-conversions,\
43-
-*-avoid-goto,\
47+
-*-avoid-goto,
4448
-hicpp-multiway-paths-covered,\
4549
-clang-analyzer-cplusplus.NewDeleteLeaks,\
4650
-clang-analyzer-cplusplus.NewDelete,\
@@ -53,11 +57,12 @@ Checks: "*,\
5357
-modernize-use-trailing-return-type,\
5458
-fuchsia-default-arguments-calls,\
5559
-fuchsia-default-arguments-declarations,\
56-
-google-readability-braces-around-statements,\
57-
-hicpp-braces-around-statements,\
58-
-readability-braces-around-statements,\
59-
-google-readability-avoid-underscore-in-googletest-name,\
60-
-readability-misleading-indentation"
60+
-misc-no-recursion,\
61+
-llvmlibc-callee-namespace,\
62+
-llvm-else-after-return,\
63+
-llvm-qualified-auto,\
64+
-readability-qualified-auto,\
65+
-google-readability-avoid-underscore-in-googletest-name"
6166
WarningsAsErrors: '*'
6267
HeaderFilterRegex: '^${RELATIVE_SOURCE_DIR}(base|modules|test)/'
6368
AnalyzeTemporaryDtors: false

.github/workflows/unix.yml

Lines changed: 58 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -11,94 +11,110 @@ on:
1111

1212
jobs:
1313
formatting:
14-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-20.04
1515
steps:
1616
- uses: actions/checkout@v2
1717

18+
- name: Install clang-format
19+
env:
20+
DEBIAN_FRONTEND: noninteractive
21+
run: |
22+
wget https://apt.llvm.org/llvm.sh
23+
chmod +x llvm.sh
24+
sudo ./llvm.sh 11
25+
rm llvm.sh
26+
sudo apt-get install -y --no-install-recommends clang-format-11
27+
1828
- name: Format files
19-
run: find base libs modules test -type f -a \( -name "*.cc" -o -name "*.h" \) -print0 | xargs -0 clang-format-9 -i
29+
run: find base libs modules test -type f -a \( -name "*.cc" -o -name "*.h" \) -print0 | xargs -0 clang-format-11 -i
2030

2131
- name: Check for differences
2232
run: |
2333
git status --porcelain
2434
git status --porcelain | xargs -I {} -0 test -z \"{}\"
35+
2536
build:
2637
runs-on: ${{ matrix.config.os }}
2738
strategy:
2839
fail-fast: false
2940
matrix:
3041
config:
31-
- name: Mac OS X
42+
- name: MacOS Release
3243
cxx: clang++
3344
cc: clang
3445
mode: Release
3546
cxxflags: -stdlib=libc++
3647
os: macos-latest
3748
artifact: macos
38-
- name: GCC 9 Release
39-
cxx: g++-9
40-
cc: gcc-9
49+
- name: GCC 10 Release
50+
cxx: g++-10
51+
cc: gcc-10
4152
mode: Release
42-
os: ubuntu-latest
53+
os: ubuntu-20.04
4354
artifact: linux
44-
- name: GCC 9 Debug
45-
cxx: g++-9
46-
cc: gcc-9
55+
- name: GCC 10 Debug
56+
cxx: g++-10
57+
cc: gcc-10
4758
mode: Debug
48-
os: ubuntu-latest
49-
- name: Clang 9 Release
50-
cxx: clang++-9
51-
cc: clang-9
59+
os: ubuntu-20.04
60+
- name: Clang 11 Release
61+
cxx: clang++-11
62+
cc: clang-11
5263
mode: Release
5364
cxxflags: -stdlib=libc++
5465
ldflags: -lc++abi
55-
os: ubuntu-latest
66+
os: ubuntu-20.04
5667
- name: Clang Tidy
57-
cxx: clang++-9
58-
cc: clang-9
68+
cxx: clang++-11
69+
cc: clang-11
5970
mode: Debug
6071
cxxflags: -stdlib=libc++
6172
ldflags: -lc++abi
6273
lint: true
63-
os: ubuntu-latest
64-
- key: Clang 9 Sanitizer
65-
cxx: clang++-9
66-
cc: clang-9
74+
os: ubuntu-20.04
75+
- key: Clang 11 Sanitizer
76+
cxx: clang++-11
77+
cc: clang-11
6778
mode: Release
6879
cflags: -fsanitize=address,undefined -fno-omit-frame-pointer
6980
cxxflags: -fsanitize=address,undefined -fno-omit-frame-pointer -stdlib=libc++
7081
ldflags: -lc++abi
71-
os: ubuntu-latest
82+
os: ubuntu-20.04
7283
env:
73-
BOOST_ROOT: /usr/local/share/boost/1.72.0
84+
DEBIAN_FRONTEND: noninteractive
7485
BUILDCACHE_COMPRESS: true
7586
BUILDCACHE_ACCURACY: SLOPPY
7687
BUILDCACHE_LUA_PATH: ${{ github.workspace }}/tools
7788
BUILDCACHE_DIR: ${{ github.workspace }}/.buildcache
7889
UBSAN_OPTIONS: halt_on_error=1:abort_on_error=1
7990
steps:
8091
- uses: actions/checkout@v2
92+
8193
- uses: seanmiddleditch/gha-setup-ninja@master
94+
if: matrix.config.os == 'macos-latest'
8295

8396
# ==== INSTALL ====
8497
- name: Update APT
8598
if: matrix.config.os != 'macos-latest'
86-
env:
87-
DEBIAN_FRONTEND: noninteractive
8899
run: sudo apt-get update
89-
100+
90101
- name: Install LLVM
91-
if: matrix.config.os != 'macos-latest' && matrix.config.cc == 'clang-9'
92-
env:
93-
DEBIAN_FRONTEND: noninteractive
94-
run: sudo apt-get install -y --no-install-recommends libc++-9-dev libc++abi-9-dev clang-tidy-9
102+
if: matrix.config.os != 'macos-latest' && matrix.config.cc == 'clang-11'
103+
run: |
104+
wget https://apt.llvm.org/llvm.sh
105+
chmod +x llvm.sh
106+
sudo ./llvm.sh 11
107+
rm llvm.sh
108+
sudo apt-get install -y --no-install-recommends libc++-11-dev libc++abi-11-dev clang-tidy-11
95109
96110
- name: Install Valgrind
97-
if: matrix.config.mode == 'Debug' && matrix.config.cc == 'gcc-9'
98-
env:
99-
DEBIAN_FRONTEND: noninteractive
111+
if: matrix.config.mode == 'Debug' && matrix.config.cc == 'gcc-10'
100112
run: sudo apt-get install -y --no-install-recommends valgrind
101113

114+
- name: Install Ninja
115+
if: matrix.config.os != 'macos-latest'
116+
run: sudo apt-get install -y --no-install-recommends ninja-build
117+
102118
# ==== CACHING ====
103119
- name: buildcache Cache
104120
uses: actions/[email protected]
@@ -117,78 +133,6 @@ jobs:
117133
key: deps-${{ hashFiles('.pkg') }}
118134
restore-keys: deps-
119135

120-
- name: libc++ Boost Cache
121-
uses: actions/cache@v1
122-
id: libcxxboostcache
123-
if: contains(matrix.config.cxxflags, 'libc++') && !contains(matrix.config.cxxflags, '-fsanitize=address')
124-
with:
125-
path: boost_1_72_0
126-
key: boost_1_72_0-${{ matrix.config.os }}
127-
128-
- name: libc++ Boost asan Cache
129-
uses: actions/cache@v1
130-
id: libcxxboostasancache
131-
if: contains(matrix.config.cxxflags, 'libc++') && contains(matrix.config.cxxflags, '-fsanitize=address')
132-
with:
133-
path: boost_1_72_0_asan
134-
key: boost_1_72_0_asan-${{ matrix.config.os }}
135-
136-
# ==== BOOST FOR LIBCXX ====
137-
- name: Boost for libc++
138-
if: contains(matrix.config.cxxflags, 'libc++') && !contains(matrix.config.cxxflags, '-fsanitize=address') && steps.libcxxboostcache.outputs.cache-hit != 'true'
139-
run: |
140-
echo "using clang : 9 : ${{ matrix.config.cxx }} ;" > $HOME/user-config.jam
141-
wget https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.bz2
142-
tar xf boost_1_72_0.tar.bz2
143-
cd boost_1_72_0
144-
./bootstrap.sh
145-
./b2 -j6 \
146-
link=static threading=multi variant=release \
147-
toolset=clang-9 cxxflags="-stdlib=libc++" \
148-
--with-system \
149-
--with-filesystem \
150-
--with-iostreams \
151-
--with-program_options \
152-
--with-thread \
153-
--with-date_time \
154-
--with-regex \
155-
--with-serialization \
156-
-s NO_BZIP2=1
157-
158-
- name: Boost for libc++ asan
159-
if: contains(matrix.config.cxxflags, 'libc++') && contains(matrix.config.cxxflags, '-fsanitize=address') && steps.libcxxboostasancache.outputs.cache-hit != 'true'
160-
run: |
161-
echo "using clang : 9 : /usr/bin/${{ matrix.config.cxx }} ;" > $HOME/user-config.jam
162-
wget https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.bz2
163-
tar xf boost_1_72_0.tar.bz2
164-
mv boost_1_72_0 boost_1_72_0_asan
165-
cd boost_1_72_0_asan
166-
./bootstrap.sh
167-
./b2 -j6 \
168-
link=static threading=multi variant=release \
169-
toolset=clang-9 cxxflags="-fsanitize=address,undefined -fno-omit-frame-pointer -stdlib=libc++" \
170-
--with-system \
171-
--with-filesystem \
172-
--with-iostreams \
173-
--with-program_options \
174-
--with-thread \
175-
--with-date_time \
176-
--with-regex \
177-
--with-serialization \
178-
-s NO_BZIP2=1
179-
180-
- name: Set BOOST_ROOT for GCC 9
181-
if: matrix.config.cxx == 'g++-9'
182-
run: echo "BOOST_ROOT=$BOOST_ROOT_1_72_0" >> $GITHUB_ENV
183-
184-
- name: Set BOOST_ROOT
185-
if: contains(matrix.config.cxxflags, 'libc++') && !contains(matrix.config.cxxflags, '-fsanitize=address')
186-
run: echo "BOOST_ROOT=`pwd`/boost_1_72_0" >> $GITHUB_ENV
187-
188-
- name: Set BOOST_ROOT asan
189-
if: contains(matrix.config.cxxflags, 'libc++') && contains(matrix.config.cxxflags, '-fsanitize=address')
190-
run: echo "BOOST_ROOT=`pwd`/boost_1_72_0_asan" >> $GITHUB_ENV
191-
192136
# ==== BUILD ====
193137
- name: CMake
194138
run: |
@@ -204,7 +148,7 @@ jobs:
204148
-DCMAKE_BUILD_TYPE=${{ matrix.config.mode }} \
205149
-DMOTIS_LINT=${{ matrix.config.lint }} \
206150
-DCTX_ASAN=${{ contains(matrix.config.cxxflags, '-fsanitize=address') }} \
207-
-DCTX_VALGRIND=${{ matrix.config.cc == 'gcc-9' && matrix.config.mode == 'Debug' }}
151+
-DCTX_VALGRIND=${{ matrix.config.cc == 'gcc-10' && matrix.config.mode == 'Debug' }}
208152
209153
- name: Build
210154
run: |
@@ -229,7 +173,7 @@ jobs:
229173

230174
# ==== VALGRIND ====
231175
- name: Run Test Mode Valgrind
232-
if: matrix.mode == 'Debug' && matrix.config.cc == 'gcc-9'
176+
if: matrix.mode == 'Debug' && matrix.config.cc == 'gcc-10'
233177
run: >
234178
valgrind --error-exitcode=1 --show-reachable=yes --leak-check=full \
235179
./build/motis --mode test \
@@ -240,28 +184,28 @@ jobs:
240184
--bikesharing.db_max_size 1048576
241185
242186
- name: Run Tests Valgrind
243-
if: matrix.config.mode == 'Debug' && matrix.config.cc == 'gcc-9'
187+
if: matrix.config.mode == 'Debug' && matrix.config.cc == 'gcc-10'
244188
run: valgrind --error-exitcode=1 --show-reachable=yes --leak-check=full ./build/motis-test
245189

246190
- name: Run Integration Tests Valgrind
247-
if: matrix.config.mode == 'Debug' && matrix.config.cc == 'gcc-9'
191+
if: matrix.config.mode == 'Debug' && matrix.config.cc == 'gcc-10'
248192
run: valgrind --error-exitcode=1 --show-reachable=yes --leak-check=full ./build/motis-itest
249193

250194
# ==== DISTRIBUTION ====
251195
- name: Strip Executable
252-
if: matrix.config.mode == 'Release' && (matrix.config.cc == 'gcc-9' || matrix.config.os == 'macos-latest')
196+
if: matrix.config.mode == 'Release' && (matrix.config.cc == 'gcc-10' || matrix.config.os == 'macos-latest')
253197
run: strip build/motis
254198

255199
- name: Compile Web Interface
256-
if: matrix.config.mode == 'Release' && (matrix.config.cc == 'gcc-9' || matrix.config.os == 'macos-latest')
200+
if: matrix.config.mode == 'Release' && (matrix.config.cc == 'gcc-10' || matrix.config.os == 'macos-latest')
257201
run: |
258202
cd ./ui/web
259203
npm install
260204
./node_modules/elm/binwrappers/elm-make --yes src/Main.elm --output elm.js
261205
rm -rf node_modules
262206
263207
- name: Create Distribution
264-
if: matrix.config.mode == 'Release' && (matrix.config.cc == 'gcc-9' || matrix.config.os == 'macos-latest')
208+
if: matrix.config.mode == 'Release' && (matrix.config.cc == 'gcc-10' || matrix.config.os == 'macos-latest')
265209
run: |
266210
mkdir motis
267211
mv ui/web motis
@@ -272,15 +216,15 @@ jobs:
272216
tar cjf motis-${{ matrix.config.artifact }}.tar.bz2 motis
273217
274218
- name: Upload Distribution
275-
if: matrix.config.mode == 'Release' && (matrix.config.cc == 'gcc-9' || matrix.config.os == 'macos-latest')
219+
if: matrix.config.mode == 'Release' && (matrix.config.cc == 'gcc-10' || matrix.config.os == 'macos-latest')
276220
uses: actions/upload-artifact@v1
277221
with:
278222
name: motis-${{ matrix.config.artifact }}
279223
path: motis-${{ matrix.config.artifact }}.tar.bz2
280224

281225
# ==== RELEASE ====
282226
- name: Upload Release
283-
if: github.event.action == 'published' && matrix.config.mode == 'Release' && (matrix.config.cc == 'gcc-9' || matrix.config.os == 'macos-latest')
227+
if: github.event.action == 'published' && matrix.config.mode == 'Release' && (matrix.config.cc == 'gcc-10' || matrix.config.os == 'macos-latest')
284228
uses: actions/[email protected]
285229
env:
286230
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/windows.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ jobs:
4949

5050
- name: Build
5151
run: |
52-
$env:BOOST_ROOT = $env:BOOST_ROOT_1_72_0
5352
$devShell = &"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find **\Microsoft.VisualStudio.DevShell.dll
5453
$installPath = &"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationpath
5554
Import-Module $devShell

0 commit comments

Comments
 (0)