diff --git a/.github/workflows/plgd-device-test-with-cfg.yml b/.github/workflows/plgd-device-test-with-cfg.yml index 7207bcefc3..a3a2c2b596 100644 --- a/.github/workflows/plgd-device-test-with-cfg.yml +++ b/.github/workflows/plgd-device-test-with-cfg.yml @@ -47,7 +47,7 @@ env: CERT_TOOL_IMAGE: ghcr.io/plgd-dev/hub/cert-tool:vnext CERT_PATH: .tmp/pki_certs CLOUD_SERVER_DOCKER_FILE: docker/apps/Dockerfile.cloud-server-debug - CLOUD_SERVER_CLANG_DOCKER_FILE: docker/apps/Dockerfile.cloud-server-clang-debug + CLOUD_SERVER_CLANG_DOCKER_FILE: docker/apps/Dockerfile.cloud-server-debug-clang CLOUD_SERVER_DOCKER_TAG: dbg jobs: diff --git a/.github/workflows/plgd-hub-test-with-cfg.yml b/.github/workflows/plgd-hub-test-with-cfg.yml index f42be24ec7..dcd358fe78 100644 --- a/.github/workflows/plgd-hub-test-with-cfg.yml +++ b/.github/workflows/plgd-hub-test-with-cfg.yml @@ -63,7 +63,7 @@ on: env: TEST_CLOUD_SERVER_IMAGE: ghcr.io/plgd-dev/hub/test-cloud-server:latest CLOUD_SERVER_DOCKER_FILE: docker/apps/Dockerfile.cloud-server-debug - CLOUD_SERVER_CLANG_DOCKER_FILE: docker/apps/Dockerfile.cloud-server-clang-debug + CLOUD_SERVER_CLANG_DOCKER_FILE: docker/apps/Dockerfile.cloud-server-debug-clang CLOUD_SERVER_DOCKER_TAG: dbg jobs: diff --git a/docker/apps/Dockerfile.cloud-server-debug-clang b/docker/apps/Dockerfile.cloud-server-debug-clang new file mode 100644 index 0000000000..9ddadb3267 --- /dev/null +++ b/docker/apps/Dockerfile.cloud-server-debug-clang @@ -0,0 +1,34 @@ +# GCC thread-sanitizer keeps reporting false positives, so we use clang instead for tests with thread-sanitizer. +FROM ubuntu:22.04 AS service +ARG BUILD_TYPE=Release +ARG BUILD_ARGS +RUN apt-get update -y && \ + DEBIAN_FRONTEND="noninteractive" apt-get install -y bash ca-certificates cmake curl gdb git-core gcovr g++ make patch python3 --no-install-recommends +RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y clang-15 +RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 100 && \ + update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-15 100 +COPY ./ /iotivity-lite/ +RUN cd /iotivity-lite/ && git submodule update --recursive +RUN mkdir /iotivity-lite/build && \ + cd /iotivity-lite/build && \ + cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DBUILD_TESTING=OFF -DOC_CLOUD_ENABLED=ON ${BUILD_ARGS} .. && \ + cmake --build . --target cloud_server +RUN cp /iotivity-lite/build/apps/cloud_server /iotivity-lite/port/linux/service + +# install libfaketime +RUN git clone https://github.com/wolfcw/libfaketime.git && \ + cd /libfaketime/src && \ + make install FAKETIME_COMPILE_CFLAGS="-DFAKE_SETTIME -DFAKE_STATELESS" + +COPY /docker/logbt /usr/local/bin/logbt +RUN logbt --version +COPY /docker/run.sh /usr/local/bin/run.sh +ENV NUM_DEVICES=1 +ENV FAKETIME= +ENV FAKETIME_DONT_FAKE_MONOTONIC=1 +ENV FAKETIME_TIMESTAMP_FILE= +ENV FAKETIME_UPDATE_TIMESTAMP_FILE= +ENV FAKETIME_DONT_RESET= +ENV FAKETIME_NO_CACHE= +ENV FAKETIME_CACHE_DURATION= +ENTRYPOINT ["/usr/local/bin/run.sh"]