From patchwork Mon Sep 9 08:24:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Wielaard X-Patchwork-Id: 97329 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4F2D7385E837 for ; Mon, 9 Sep 2024 08:24:27 +0000 (GMT) X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 50056385C6D1 for ; Mon, 9 Sep 2024 08:24:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 50056385C6D1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 50056385C6D1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=45.83.234.184 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725870257; cv=none; b=RwOKlk++kEhU/wPd3n2VrwznxOaiVxpxg2luocahjwpgnCXv2vDXOmFxvzimqVELdtfoPqf9G0KzpQxDs3u5xRf1sU9Yz7Xx655HvwNWOt582D3miRHVM9+y5NlZuZDv6juWjZINhtgvIfYZuSyVASNH+QRXqXYMwEkMUUvR7A0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725870257; c=relaxed/simple; bh=JLkiEEBAljvlHuNY9cfcQAW/Kxga0XN+zBsipfOQadI=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=TPHrwesWman6zt1cD9Fp8OjmSt4SxJzqvCjfUz/4m/rziBWpBnme1K/ZsX9xZ8itJN6qKxe7Pj3GQLHdgqxn00bfVrHyJ7EckGgFMuizaPooOar/HSc3s7Sj8lQbFoNI8Ha2sOTRAh3q5l3oEm028eNqye305PizHRdGCZJ2rSE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mwielaar-thinkpadp1gen3.rmtnl.csb (deer0x08.wildebeest.org [172.31.17.138]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id D569930D0628; Mon, 9 Sep 2024 10:24:10 +0200 (CEST) Received: by mwielaar-thinkpadp1gen3.rmtnl.csb (Postfix, from userid 10916) id AC07140F85A; Mon, 9 Sep 2024 10:24:10 +0200 (CEST) From: Mark Wielaard To: elfutils-devel@sourceware.org Cc: evvers@ya.ru, Mark Wielaard Subject: [PATCH] srcfiles: Fix compile with --disable-libdebuginfod Date: Mon, 9 Sep 2024 10:24:07 +0200 Message-ID: <20240909082407.728903-1-mark@klomp.org> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: elfutils-devel-bounces~patchwork=sourceware.org@sourceware.org The eu-srcfiles --no-backup option is only valid when build with libdebuginfod support. Adjust the ENABLE_LIBDEBUGINFOD conditional to not use no_backup anywhere. Also only run the run-srcfiles-self.sh test when debuginfod is enabled. * src/srcfiles.cxx (zip_files): Move endif ENABLE_LIBDEBUGINFOD after no_backup check. * tests/Makefile.am (TESTS): Only add run-srcfiles-self.sh if DEBUGINFOD and !DUMMY_LIBDEBUGINFOD. * tests/run-srcfiles.self.sh: Use local DEBUGINFOD_CACHE_PATH. https://sourceware.org/bugzilla/show_bug.cgi?id=32155 Signed-off-by: Mark Wielaard --- src/srcfiles.cxx | 2 +- tests/Makefile.am | 4 ++-- tests/run-srcfiles-self.sh | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/srcfiles.cxx b/src/srcfiles.cxx index 09d50f8d234a..c466b3076593 100644 --- a/src/srcfiles.cxx +++ b/src/srcfiles.cxx @@ -349,9 +349,9 @@ void zip_files() else cerr << "Error: Invalid build ID length (" << bits_length << ")." << endl; } - #endif if (!no_backup) + #endif /* ENABLE_LIBDEBUGINFOD */ /* Files could not be located using debuginfod, search locally */ if (fd < 0) fd = open(file_path.c_str(), O_RDONLY); diff --git a/tests/Makefile.am b/tests/Makefile.am index cdb2d405d212..424c184bc200 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -132,7 +132,6 @@ TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile test-nlist \ run-find-prologues.sh run-allregs.sh run-addrcfi.sh \ run-dwarfcfi.sh run-nm-syms.sh \ run-nm-self.sh run-readelf-self.sh run-readelf-info-plus.sh \ - run-srcfiles-self.sh \ run-readelf-compressed.sh \ run-readelf-const-values.sh \ run-varlocs-self.sh run-exprlocs-self.sh \ @@ -246,7 +245,8 @@ if DEBUGINFOD check_PROGRAMS += debuginfod_build_id_find # With the dummy delegation doesn't work if !DUMMY_LIBDEBUGINFOD -TESTS += run-debuginfod-dlopen.sh \ +TESTS += run-srcfiles-self.sh \ + run-debuginfod-dlopen.sh \ run-debuginfod-artifact-running.sh \ run-debuginfod-fd-prefetch-caches.sh \ run-debuginfod-regex.sh \ diff --git a/tests/run-srcfiles-self.sh b/tests/run-srcfiles-self.sh index 515cc47a5169..c9dbbc096bf1 100755 --- a/tests/run-srcfiles-self.sh +++ b/tests/run-srcfiles-self.sh @@ -85,6 +85,7 @@ if [ -x ${abs_builddir}/../debuginfod/debuginfod ] && $zip; then export DEBUGINFOD_URLS="http://localhost:${PORT1}/" export DEBUGINFOD_VERBOSE=1 + export DEBUGINFOD_CACHE_PATH=${PWD}/.client_cache testrun $ET_EXEC -z -b -e $ET_EXEC > test.zip tempfiles test.zip