Modified libevent recipe
- supports "openssl/1.1.1-stable@conan/stable"
Use enable_asan or enable_ubsan, etc.
export CC=$(find ~/.conan/data/llvm_tools/master/conan/stable/package/ -path "*bin/clang" | head -n 1)
export CXX=$(find ~/.conan/data/llvm_tools/master/conan/stable/package/ -path "*bin/clang++" | head -n 1)
export CFLAGS="-fsanitize=thread -fuse-ld=lld -stdlib=libc++ -lc++ -lc++abi -lunwind"
export CXXFLAGS="-fsanitize=thread -fuse-ld=lld -stdlib=libc++ -lc++ -lc++abi -lunwind"
export LDFLAGS="-stdlib=libc++ -lc++ -lc++abi -lunwind"
# must exist
file $(dirname $CXX)/../lib/clang/10.0.1/lib/linux/libclang_rt.tsan_cxx-x86_64.a
# NOTE: NO `--profile` argument cause we use `CXX` env. var
# NOTE: change `build_type=Debug` to `build_type=Release` in production
CONAN_REVISIONS_ENABLED=1 \
CONAN_VERBOSE_TRACEBACK=1 \
CONAN_PRINT_RUN_COMMANDS=1 \
CONAN_LOGGING_LEVEL=10 \
GIT_SSL_NO_VERIFY=true \
conan create . \
conan/stable \
-s build_type=Debug \
-s llvm_tools:build_type=Release \
-o llvm_tools:enable_tsan=True \
-o llvm_tools:include_what_you_use=False \
-s llvm_tools:compiler=clang \
-s llvm_tools:compiler.version=6.0 \
-s llvm_tools:compiler.libcxx=libstdc++11 \
-o conan_libevent:enable_tsan=True \
-e conan_libevent:enable_llvm_tools=True \
-e conan_libevent:compile_with_llvm_tools=True \
-s compiler=clang \
-s compiler.version=10 \
-s compiler.libcxx=libc++ \
-o openssl:shared=True
# reset changed LDFLAGS
unset LDFLAGS
# reset changed CFLAGS
unset CFLAGS
# reset changed CXXFLAGS
unset CXXFLAGS
NOTE: during compilation conan will print `llvm_tools_ROOT =`. Make sure its path matches `$CC` and `$CXX`.
# clean build cache
conan remove "*" --build --forceexport MY_IP=$(ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}')
sudo -E docker build \
--build-arg PKG_NAME=libevent/2.1.11 \
--build-arg PKG_CHANNEL=dev/stable \
--build-arg PKG_UPLOAD_NAME=libevent/2.1.11@dev/stable \
--build-arg CONAN_EXTRA_REPOS="conan-local http://$MY_IP:8081/artifactory/api/conan/conan False" \
--build-arg CONAN_EXTRA_REPOS_USER="user -p password1 -r conan-local admin" \
--build-arg CONAN_INSTALL="conan install --profile clang --build missing" \
--build-arg CONAN_CREATE="conan create --profile clang --build missing" \
--build-arg CONAN_UPLOAD="conan upload --all -r=conan-local -c --retry 3 --retry-wait 10 --force" \
--build-arg BUILD_TYPE=Debug \
-f conan_libevent.Dockerfile --tag conan_libevent . --no-cacheexport PKG_NAME=libevent/2.1.11@dev/stable
conan remove --force $PKG_NAME
conan create . dev/stable -s build_type=Debug --profile clang --build missing -o openssl:shared=True
CONAN_REVISIONS_ENABLED=1 CONAN_VERBOSE_TRACEBACK=1 CONAN_PRINT_RUN_COMMANDS=1 CONAN_LOGGING_LEVEL=10 conan upload $PKG_NAME --all -r=conan-local -c --retry 3 --retry-wait 10 --force
# clean build cache
conan remove "*" --build --force# NOTE: about `--keep-source` see https://bincrafters.github.io/2018/02/27/Updated-Conan-Package-Flow-1.1/
CONAN_REVISIONS_ENABLED=1 CONAN_VERBOSE_TRACEBACK=1 CONAN_PRINT_RUN_COMMANDS=1 CONAN_LOGGING_LEVEL=10 conan create . conan/stable -s build_type=Debug --profile clang --build missing --keep-source
# clean build cache
conan remove "*" --build --force