Skip to content

Commit f72da39

Browse files
authored
Clang v17 (#20)
1 parent cee196f commit f72da39

File tree

3 files changed

+64
-34
lines changed

3 files changed

+64
-34
lines changed

.circleci/config.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ commands:
1818
command: |
1919
apt-get -qq update
2020
apt-get -q install -y git openssh-client curl ca-certificates make tar gzip
21-
bash <(curl -fsSL https://get.docker.com)
21+
bash <(curl -fsSL https://raw.githubusercontent.com/docker/docker-install/master/install.sh)
2222
- setup_remote_docker:
23+
version: 20.10.14
2324
docker_layer_caching: true
2425

2526
checkout-all:
@@ -55,7 +56,7 @@ jobs:
5556
- run:
5657
name: Skip?
5758
command: |
58-
if [[ "<<parameters.force>>" != 1 && $CIRCLE_BRANCH != *rmbuilder ]]; then circleci step halt; fi
59+
if [[ "<<parameters.force>>" != 1 && $CIRCLE_BRANCH != *rmbuilder* ]]; then circleci step halt; fi
5960
- checkout-all
6061
- run:
6162
name: Setup automation
@@ -92,7 +93,7 @@ jobs:
9293
- run:
9394
name: Skip?
9495
command: |
95-
if [[ "<<parameters.force>>" != 1 && $CIRCLE_BRANCH != *rmbuilder ]]; then circleci step halt; fi
96+
if [[ "<<parameters.force>>" != 1 && $CIRCLE_BRANCH != *rmbuilder* ]]; then circleci step halt; fi
9697
- setup-executor
9798
- checkout-all
9899
- setup-automation
@@ -112,6 +113,9 @@ jobs:
112113
image: ubuntu-2004:202010-01
113114
resource_class: large
114115
parameters:
116+
osnick:
117+
type: string
118+
default: "bullseye"
115119
force:
116120
type: string
117121
default: ""
@@ -120,7 +124,7 @@ jobs:
120124
- run:
121125
name: Skip?
122126
command: |
123-
if [[ "<<parameters.force>>" != 1 && $CIRCLE_BRANCH != *clang ]]; then circleci step halt; fi
127+
if [[ "<<parameters.force>>" != 1 && $CIRCLE_BRANCH != *clang* ]]; then circleci step halt; fi
124128
- checkout-all
125129
- run:
126130
name: Setup automation
@@ -130,17 +134,19 @@ jobs:
130134
docker version
131135
- run:
132136
name: Build
137+
shell: /bin/bash -l -eo pipefail
133138
command: |
134139
cd clang
135-
bash -l -c "make build"
140+
make build OSNICK=<<parameters.osnick>>
136141
no_output_timeout: 30m
137142
- run:
138143
name: Publish
144+
shell: /bin/bash -l -eo pipefail
139145
command: |
140146
cd clang
141147
if [[ $CIRCLE_BRANCH == master ]]; then
142148
docker login --username redisfab --password "$DOCKER_REDISFAB_PWD"
143-
bash -l -c "make publish"
149+
make publish OSNICK=<<parameters.osnick>>
144150
fi
145151
no_output_timeout: 30m
146152

@@ -215,7 +221,7 @@ workflows:
215221
<<: *not-on-integ-branch
216222
platforms: "bullseye"
217223
context: common
218-
force: "1"
224+
force: ""
219225
- platform-vm-builder:
220226
name: integ-vm-builder
221227
<<: *on-integ-branch
@@ -231,11 +237,18 @@ workflows:
231237
context: common
232238
force: "1"
233239
- clang-builder:
240+
name: clang-builder-<< matrix.osnick >>
234241
<<: *not-on-integ-branch
242+
matrix:
243+
parameters:
244+
osnick: [bullseye, focal]
235245
context: common
236246
- clang-builder:
237-
name: integ-clang-builder
247+
name: integ-clang-builder-<< matrix.osnick >>
238248
<<: *on-integ-branch
249+
matrix:
250+
parameters:
251+
osnick: [bullseye, focal]
239252
context: common
240253
force: "1"
241254
weekly:
@@ -260,6 +273,9 @@ workflows:
260273
force: "1"
261274
context: common
262275
- clang-builder:
263-
name: weekly-clang-builder
264-
context: common
276+
name: weekly-clang-builder-<< matrix.osnick >>
277+
matrix:
278+
parameters:
279+
osnick: [bullseye, focal]
265280
force: "1"
281+
context: common

clang/Dockerfile

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# BUILD redisfab/clang:${CLANG_VER}-${ARCH}-${OSNICK}
22

33
ARG OSNICK=bullseye
4-
ARG CLANG_VER=13
4+
ARG OS=debian:bullseye
5+
ARG CLANG_VER=17
56
ARG NINJA_VER=1.10.1
67

78
#----------------------------------------------------------------------------------------------
8-
FROM debian:$OSNICK
9+
FROM ${OS}
910

1011
ARG OSNICK
12+
ARG OS
1113
ARG CLANG_VER
1214
ARG CMAKE_VER
1315
ARG NINJA_VER
@@ -19,9 +21,9 @@ SHELL ["/bin/bash", "-c"]
1921
# Install prerequisites
2022

2123
RUN apt-get -qq update
22-
RUN apt-get install -y ca-certificates curl wget
23-
RUN apt-get install -y software-properties-common apt-transport-https
24-
RUN apt-get install -y git unzip lsb-release gnupg2 wget
24+
RUN apt-get install -qy ca-certificates curl wget
25+
RUN apt-get install -qy software-properties-common apt-transport-https
26+
RUN apt-get install -qy git unzip lsb-release gnupg2 wget
2527

2628
RUN git clone https://github.com/RedisLabsModules/readies.git
2729

@@ -38,25 +40,25 @@ RUN set -e ;\
3840
#----------------------------------------------------------------------------------------------
3941
# Install Clang
4042

41-
RUN ./readies/bin/getclang --modern
43+
RUN ./readies/bin/getclang -v ${CLANG_VER}
4244

4345
#----------------------------------------------------------------------------------------------
4446
# Build C++ runtime libs with msan instrumentation
4547

4648
# build llvm for msan into /opt/llvm-project/build-msan
47-
RUN set -e ;\
48-
cd /opt ;\
49-
git clone --depth=1 https://github.com/llvm/llvm-project ;\
50-
cd llvm-project ;\
51-
mkdir build-msan ;\
52-
cd build-msan ;\
53-
cmake -GNinja ../llvm \
54-
-DCMAKE_BUILD_TYPE=Release \
55-
-DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" \
56-
-DCMAKE_C_COMPILER=clang \
57-
-DCMAKE_CXX_COMPILER=clang++ \
58-
-DLLVM_USE_SANITIZER=MemoryWithOrigins ;\
59-
cmake --build . -- cxx cxxabi
49+
# RUN set -e ;\
50+
# cd /opt ;\
51+
# git clone --depth=1 https://github.com/llvm/llvm-project ;\
52+
# cd llvm-project ;\
53+
# mkdir build-msan ;\
54+
# cd build-msan ;\
55+
# cmake -GNinja ../llvm \
56+
# -DCMAKE_BUILD_TYPE=Release \
57+
# -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" \
58+
# -DCMAKE_C_COMPILER=clang \
59+
# -DCMAKE_CXX_COMPILER=clang++ \
60+
# -DLLVM_USE_SANITIZER=MemoryWithOrigins ;\
61+
# cmake --build . -- cxx cxxabi
6062

6163
#----------------------------------------------------------------------------------------------
6264
# Build Redis with asan/msan instrumentation
@@ -66,7 +68,12 @@ ADD redis.blacklist /build/
6668
# build sanitizer-enabled redis-server(s)
6769
# `--no-run` because Clang sanitizer requires SYS_PTRACE docker capability, which is not available in docker build
6870
RUN set -e ;\
69-
for redis_ver in 6.0 6.2; do \
71+
for redis_ver in 6.0 6.2 7.0 7.2-rc1; do \
7072
./readies/bin/getredis --no-run -v $redis_ver --suffix asan-${redis_ver} --own-openssl --clang-asan --clang-san-blacklist /build/redis.blacklist ;\
71-
./readies/bin/getredis --no-run -v $redis_ver --suffix msan-${redis_ver} --own-openssl --clang-msan --llvm-dir /opt/llvm-project/build-msan --clang-san-blacklist /build/redis.blacklist ;\
7273
done
74+
75+
# RUN set -e ;\
76+
# for redis_ver in 6.0 6.2 7.0; do \
77+
# ./readies/bin/getredis --no-run -v $redis_ver --suffix asan-${redis_ver} --own-openssl --clang-asan --clang-san-blacklist /build/redis.blacklist ;\
78+
# ./readies/bin/getredis --no-run -v $redis_ver --suffix msan-${redis_ver} --own-openssl --clang-msan --llvm-dir /opt/llvm-project/build-msan --clang-san-blacklist /build/redis.blacklist ;\
79+
# done

clang/Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1+
CLANG_VER ?= 17
2+
override OSNICK ?= bullseye
13

2-
CLANG_VER ?= 13
3-
OSNICK ?= bullseye
4+
ROOT=..
5+
6+
include $(ROOT)/deps/readies/mk/main
7+
8+
include $(MK)/osnick.defs
9+
10+
# OS ?= debian:bullseye
411
ARCH=x64
512

613
IMAGE=redisfab/clang:$(CLANG_VER)-$(ARCH)-$(OSNICK)
714
VIEW=/w
815

916
build:
10-
docker build -t $(IMAGE) --build-arg CLANG_VER=$(CLANG_VER) --build-arg OSNICK=$(OSNICK) .
17+
docker build -t $(IMAGE) --build-arg CLANG_VER=$(CLANG_VER) --build-arg OSNICK=$(OSNICK) --build-arg OS=$(OS) .
1118

1219
publish:
1320
docker push $(IMAGE)

0 commit comments

Comments
 (0)