From patchwork Wed Mar 8 23:18:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 1754369 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=C0OnIfFt; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=hauke-m.de header.i=@hauke-m.de header.a=rsa-sha256 header.s=MBO0001 header.b=RtOZijnU; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PX7Zy41Ysz246H for ; Thu, 9 Mar 2023 10:20:26 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=4Xa2ELAoFXcYQPomTc/rinleV9VNyHvdxGgB1dlms6s=; b=C0OnIfFt02LlZi mo2AfRqb/SNJ/FP/9qTZigyOscTcHx9RrDQSrgE1kPRkq3K55IYCCg/vH0NcWf3zCA5wx2QrIQ4wf Nw7nxYOBYxg26jTxTFBKvUPy1hCBbwE+mRBdSLKXQugeEi62V+C9rb2Xb4UqoxIXQY9KwwmRqNcT/ wg71GXqvT/QtqRgK4HAcKhE5XM2MkwvQU6g8G0KbPvfhro74V5BO7YNX3eREzRa8ai2vSYAz3xBkn ZRFe0XZDB1MlJutJlx5xPL+7iHiDfoCNeAKNqn1x29GUz4zFyYrl4ZTmi1j/zUMbiIAsqDddFk5rr OBExO5GAJmwJeIjFeCkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pa33G-0075wb-Tz; Wed, 08 Mar 2023 23:18:31 +0000 Received: from mout-p-201.mailbox.org ([2001:67c:2050:0:465::201]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pa33A-0075uX-9Z for openwrt-devel@lists.openwrt.org; Wed, 08 Mar 2023 23:18:25 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4PX7XW0h95z9sl2; Thu, 9 Mar 2023 00:18:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hauke-m.de; s=MBO0001; t=1678317499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=pd+LXX67O8PFIHELSaYvKEE2eYtuPInZ1KmAxeVxjvI=; b=RtOZijnUa5WYM0A7/3ZYYTBqTuRqde6yQjKwGXeJAFticmUzOQ8FhDbidJe6o2uSuljZCb Mk3qQ909OFeaYTgVNGi5dIthQrBSXho4aWDcc4Sqzzsg5j5z0OYVcrAXfUeMB8b6YHWAvn IJCNp8V1zb9LDVcH09zycSzZ3H/8voACfn2qqjfF3DTrWr/1DLuJm0j+0OZTCwDohk9xon tIvhl6RR4Ks11S6a0cS0AzPHqGo/z7V8kO9rdSK6oE5bKfIXKNyvfN2rsq3CAUMsKQ5jB4 bAZwUHARmFQFNoHkHLQTnE1a2uCgGHnwUv/i596JY1evr++YQd7876lejafcuQ== From: Hauke Mehrtens To: openwrt-devel@lists.openwrt.org Subject: [PATCH uci 1/2] fuzz: Compile using libstd++ Date: Thu, 9 Mar 2023 00:18:09 +0100 Message-Id: <20230308231810.2143384-1-hauke@hauke-m.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4PX7XW0h95z9sl2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230308_151824_539406_FA0D7E0E X-CRM114-Status: UNSURE ( 9.04 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: It looks like libfuzzer is compiled using libstd++ on Debian Bookworm and not libc++. Using libc++ causes linking errors, use libstd++ instead. Signed-off-by: Hauke Mehrtens --- tests/fuzz/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [2001:67c:2050:0:465:0:0:201 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hauke Mehrtens , ynezz@true.cz Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org It looks like libfuzzer is compiled using libstd++ on Debian Bookworm and not libc++. Using libc++ causes linking errors, use libstd++ instead. Signed-off-by: Hauke Mehrtens --- tests/fuzz/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fuzz/CMakeLists.txt b/tests/fuzz/CMakeLists.txt index 1533c46..f1b4a0d 100644 --- a/tests/fuzz/CMakeLists.txt +++ b/tests/fuzz/CMakeLists.txt @@ -4,7 +4,7 @@ MACRO(ADD_FUZZER_TEST name) ADD_EXECUTABLE(${name} ${name}.c) TARGET_COMPILE_OPTIONS(${name} PRIVATE -g -O1 -fno-omit-frame-pointer -fsanitize=fuzzer,address,leak,undefined) TARGET_INCLUDE_DIRECTORIES(${name} PRIVATE ${PROJECT_SOURCE_DIR}) - TARGET_LINK_OPTIONS(${name} PRIVATE -stdlib=libc++ -fsanitize=fuzzer,address,leak,undefined) + TARGET_LINK_OPTIONS(${name} PRIVATE -fsanitize=fuzzer,address,leak,undefined) TARGET_LINK_LIBRARIES(${name} uci) ADD_TEST( NAME ${name} From patchwork Wed Mar 8 23:18:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 1754370 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=uo4v8iNO; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=hauke-m.de header.i=@hauke-m.de header.a=rsa-sha256 header.s=MBO0001 header.b=nGooA2+I; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PX7bz4pgFz246H for ; Thu, 9 Mar 2023 10:21:19 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TKUByh0CTA2bNp0E5xUJ9GJVgOtDGswpxSdGKduqUiM=; b=uo4v8iNOIRscoN 7zGOa8LxmvtEQGGcWU98RQCLBsfEBjgqfZY+A2/lqgucBUswpqQSE8xQcWHnwidBPe6NNAWlZ/E3C r2fuWGDbSJAFhyDXTW3CeZDUjcsCW6yGfvuTNAAObCJ8lsfUD7ODdGnGWInAcq2eQ+d+YP3JiSBE9 3RyH0ZkWEWSuXfFTuixfS8bomg43KU176+vJNb105jRdvImlznCfSTdc5SGcXDghiGPFjY6GtueZX iP7ylS4PHOBUnz/gZhetkUYq0mckrZufpT16sylOY8xNn6I4oDkfIkFk2+xWg6b/XNxm+Mzqy2qJ7 JIc84PQJhu59sPqocVsA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pa346-0076FB-EI; Wed, 08 Mar 2023 23:19:22 +0000 Received: from mout-p-102.mailbox.org ([80.241.56.152]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pa33A-0075uT-7F for openwrt-devel@lists.openwrt.org; Wed, 08 Mar 2023 23:18:26 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4PX7XW4k9wz9sSV; Thu, 9 Mar 2023 00:18:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hauke-m.de; s=MBO0001; t=1678317499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dS8ENQknqTzLVktku6kWCgZTWNxM65Ckf4R+4I7tf+0=; b=nGooA2+IiuZrQGlF/PGw6Toyasf+QOTUYYY2i29nSfFQkRIkiYZ0+Je6CrJVc4bHLzOejo ayiBs13lKE9VITmDZ6ZL25UoKWgIqPlcWN+qH4cKbwdikr62p0xfNsCZWCHbpB65SQmL47 WlEkuTUTv0V7Ecoszh753/fYGKElIT45wXqKFB7Eex5ye3NFbjfCWRkAtDySXVxlF4geVU iYPuDnOqqYDkxFt6RqDQinS4396/50mJU8SVHdKZg0l73duD5C4E2TyqDP2SUxe7FsJmsd H9R3yB9FYYDZXkMxVa+Ec1UgxTi9v6H3nOMLUq3W8v/AkzPbexW+s/wWvC5sxg== From: Hauke Mehrtens To: openwrt-devel@lists.openwrt.org Subject: [PATCH uci 2/2] CI: Add github action Date: Thu, 9 Mar 2023 00:18:10 +0100 Message-Id: <20230308231810.2143384-2-hauke@hauke-m.de> In-Reply-To: <20230308231810.2143384-1-hauke@hauke-m.de> References: <20230308231810.2143384-1-hauke@hauke-m.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4PX7XW4k9wz9sSV X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230308_151824_456864_E47B2D53 X-CRM114-Status: GOOD ( 11.10 ) X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Add a github action to build uci and then execute the tests. This first builds and installs libubox and then uses that dependency to build and test uci. clang 14 generates debug information in DWARF 5 format, but valgrind 19.0 does not support that. Install valgrind 20.0 from experimental which supports it. Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.152 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hauke Mehrtens , ynezz@true.cz Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Add a github action to build uci and then execute the tests. This first builds and installs libubox and then uses that dependency to build and test uci. clang 14 generates debug information in DWARF 5 format, but valgrind 19.0 does not support that. Install valgrind 20.0 from experimental which supports it. Signed-off-by: Hauke Mehrtens --- I created a github pull request with these changes too: https://github.com/openwrt/libubox/pull/2 .github/workflows/test.yml | 83 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d76300d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,83 @@ +name: 'Run tests' + +on: + push: + +jobs: + build_test: + strategy: + matrix: + include: + - compiler: "-DCMAKE_C_COMPILER=clang" + - compiler: "-DCMAKE_C_COMPILER=gcc" + + name: Build and run tests + runs-on: ubuntu-latest + container: + image: debian:bookworm + + steps: + + - name: Add Debian experimental + run: | + echo "deb http://deb.debian.org/debian/ experimental main" >> /etc/apt/sources.list + + - name: Install compiler + run: | + apt update + apt install -y cmake build-essential lua5.1 pkgconf libjson-c-dev liblua5.1-0-dev python3.11-venv clang libc++abi-dev libc++-dev + apt -t experimental install -y valgrind + useradd -ms /bin/bash buildbot + + - name: Checkout libubox + uses: actions/checkout@v3 + with: + repository: openwrt/libubox + path: libubox + + - name: Checkout uci + uses: actions/checkout@v3 + with: + path: uci + + - name: Create build directory + run: mkdir libubox-build + + - name: Create build directory + run: mkdir uci-build + + - name: Create install directory + run: mkdir install + + - name: Fix permission + run: chown -R buildbot:buildbot libubox-build libubox uci uci-build install + + - name: Run cmake (libubox) + shell: su buildbot -c "sh -e {0}" + working-directory: libubox-build + run: cmake ../libubox -DCMAKE_INSTALL_PREFIX=../install -DBUILD_LUA=false ${{ matrix.compiler }} + + - name: Run build (libubox) + shell: su buildbot -c "sh -e {0}" + working-directory: libubox-build + run: make + + - name: Run install (libubox) + shell: su buildbot -c "sh -e {0}" + working-directory: libubox-build + run: make install + + - name: Run cmake (uci) + shell: su buildbot -c "sh -e {0}" + working-directory: uci-build + run: cmake ../uci -DUNIT_TESTING=true -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_PREFIX_PATH=../install ${{ matrix.compiler }} + + - name: Run build (uci) + shell: su buildbot -c "sh -e {0}" + working-directory: uci-build + run: make + + - name: Run tests (uci) + shell: su buildbot -c "sh -e {0}" + working-directory: uci-build + run: make test