diff --git a/docker/ci/README.md b/docker/ci/README.md index edf25b6dc..cfc256f61 100644 --- a/docker/ci/README.md +++ b/docker/ci/README.md @@ -4,12 +4,13 @@ This image contains an environment to build [Clio](https://github.com/XRPLF/clio It is used in [Clio Github Actions](https://github.com/XRPLF/clio/actions) but can also be used to compile Clio locally. The image is based on Ubuntu 20.04 and contains: -- clang 16 +- clang 16.0.6 - gcc 12.3 -- doxygen 1.10 +- doxygen 1.12 - gh 2.40 -- ccache 4.8.3 -- conan +- ccache 4.10.2 +- conan 1.62 - and some other useful tools -Conan is set up to build Clio without any additional steps. There are two preset conan profiles: `clang` and `gcc` to use corresponding compiler. +Conan is set up to build Clio without any additional steps. There are two preset conan profiles: `clang` and `gcc` to use corresponding compiler. By default conan is setup to use `gcc`. +Sanitizer builds for `ASAN`, `TSAN` and `UBSAN` are enabled via conan profiles for each of the supported compilers. These can be selected using the following pattern (all lowercase): `[compiler].[sanitizer]` (e.g. `--profile gcc.tsan`). diff --git a/docker/ci/conan/clang.asan b/docker/ci/conan/clang.asan new file mode 100644 index 000000000..0ec726451 --- /dev/null +++ b/docker/ci/conan/clang.asan @@ -0,0 +1,9 @@ +include(clang) + +[options] +boost:extra_b2_flags="cxxflags=\"-fsanitize=address\" linkflags=\"-fsanitize=address\"" +boost:without_stacktrace=True +[env] +CFLAGS="-fsanitize=address" +CXXFLAGS="-fsanitize=address" +LDFLAGS="-fsanitize=address" diff --git a/docker/ci/conan/clang.tsan b/docker/ci/conan/clang.tsan new file mode 100644 index 000000000..8f314ca44 --- /dev/null +++ b/docker/ci/conan/clang.tsan @@ -0,0 +1,9 @@ +include(clang) + +[options] +boost:extra_b2_flags="cxxflags=\"-fsanitize=thread\" linkflags=\"-fsanitize=thread\"" +boost:without_stacktrace=True +[env] +CFLAGS="-fsanitize=thread" +CXXFLAGS="-fsanitize=thread" +LDFLAGS="-fsanitize=thread" diff --git a/docker/ci/conan/clang.ubsan b/docker/ci/conan/clang.ubsan new file mode 100644 index 000000000..8f6f17d06 --- /dev/null +++ b/docker/ci/conan/clang.ubsan @@ -0,0 +1,9 @@ +include(clang) + +[options] +boost:extra_b2_flags="cxxflags=\"-fsanitize=undefined\" linkflags=\"-fsanitize=undefined\"" +boost:without_stacktrace=True +[env] +CFLAGS="-fsanitize=undefined" +CXXFLAGS="-fsanitize=undefined" +LDFLAGS="-fsanitize=undefined" diff --git a/docker/ci/conan/gcc.asan b/docker/ci/conan/gcc.asan new file mode 100644 index 000000000..65d85da46 --- /dev/null +++ b/docker/ci/conan/gcc.asan @@ -0,0 +1,9 @@ +include(gcc) + +[options] +boost:extra_b2_flags="cxxflags=\"-fsanitize=address\" linkflags=\"-fsanitize=address\"" +boost:without_stacktrace=True +[env] +CFLAGS="-fsanitize=address" +CXXFLAGS="-fsanitize=address" +LDFLAGS="-fsanitize=address" diff --git a/docker/ci/conan/gcc.tsan b/docker/ci/conan/gcc.tsan new file mode 100644 index 000000000..1f13a0715 --- /dev/null +++ b/docker/ci/conan/gcc.tsan @@ -0,0 +1,9 @@ +include(gcc) + +[options] +boost:extra_b2_flags="cxxflags=\"-fsanitize=thread\" linkflags=\"-fsanitize=thread\"" +boost:without_stacktrace=True +[env] +CFLAGS="-fsanitize=thread" +CXXFLAGS="-fsanitize=thread" +LDFLAGS="-fsanitize=thread" diff --git a/docker/ci/conan/gcc.ubsan b/docker/ci/conan/gcc.ubsan new file mode 100644 index 000000000..ddbb0257d --- /dev/null +++ b/docker/ci/conan/gcc.ubsan @@ -0,0 +1,9 @@ +include(gcc) + +[options] +boost:extra_b2_flags="cxxflags=\"-fsanitize=undefined\" linkflags=\"-fsanitize=undefined\"" +boost:without_stacktrace=True +[env] +CFLAGS="-fsanitize=undefined" +CXXFLAGS="-fsanitize=undefined" +LDFLAGS="-fsanitize=undefined" diff --git a/docker/ci/dockerfile b/docker/ci/dockerfile index 197e96c62..85d661bc2 100644 --- a/docker/ci/dockerfile +++ b/docker/ci/dockerfile @@ -98,3 +98,10 @@ RUN conan profile new clang --detect \ && conan profile update "conf.tools.build:compiler_executables={\"c\": \"/usr/bin/clang-16\", \"cpp\": \"/usr/bin/clang++-16\"}" clang RUN echo "include(gcc)" >> .conan/profiles/default + +COPY conan/gcc.asan /root/.conan/profiles +COPY conan/gcc.tsan /root/.conan/profiles +COPY conan/gcc.ubsan /root/.conan/profiles +COPY conan/clang.asan /root/.conan/profiles +COPY conan/clang.tsan /root/.conan/profiles +COPY conan/clang.ubsan /root/.conan/profiles