Skip to content

Commit

Permalink
Pre-build glib-2.0 libraries with TSAN enabled (#23519)
Browse files Browse the repository at this point in the history
  • Loading branch information
arkq authored and pull[bot] committed Jul 28, 2023
1 parent c21e192 commit 1013698
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions integrations/docker/images/chip-build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ RUN set -x \
libusb-dev \
libxml2-dev \
make \
meson \
net-tools \
ninja-build \
openjdk-8-jdk \
Expand Down Expand Up @@ -131,3 +132,19 @@ RUN set -x \
&& cd .. \
&& rm -rf node_js \
&& : # last line

# Build glib-2.0 from source with enabled thread sanitizer. This is needed for
# running CHIP tests with TSAN enabled. When running applications with TSAN
# all shared libraries should be built with TSAN enabled, otherwise TSAN might
# report false positives. This case is most prominent with glib-2.0, which has
# a lot of threads-related APIs.
ENV LD_LIBRARY_PATH_TSAN=/usr/lib/x86_64-linux-gnu-tsan
RUN set -x \
&& mkdir -p $LD_LIBRARY_PATH_TSAN \
&& GLIB_VERSION=$(pkg-config --modversion glib-2.0) \
&& git clone --depth=1 --branch=$GLIB_VERSION https://github.com/GNOME/glib.git \
&& CFLAGS="-O2 -g -fsanitize=thread" meson glib/build glib \
&& DESTDIR=../build-image ninja -C glib/build install \
&& mv glib/build-image/usr/local/lib/x86_64-linux-gnu/lib* $LD_LIBRARY_PATH_TSAN \
&& rm -rf glib \
&& : # last line
2 changes: 1 addition & 1 deletion integrations/docker/images/chip-build/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.06 Version bump reason: [Telink] Update Telink Docker.
0.6.07 Version bump reason: Build glib-2.0 libs with TSAN

0 comments on commit 1013698

Please sign in to comment.