From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CAMbFlHx12NM/wAAbAwnHQ (envelope-from ) for ; Mon, 30 Jan 2023 17:33:21 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id qEEoFlHx12MakAAA9RJhRA (envelope-from ) for ; Mon, 30 Jan 2023 17:33:21 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 033B82E9C2 for ; Mon, 30 Jan 2023 17:33:20 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMX5b-0006vC-TM; Mon, 30 Jan 2023 11:33:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMX5a-0006um-Q5 for bug-guix@gnu.org; Mon, 30 Jan 2023 11:33:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMX5a-0002dB-BS for bug-guix@gnu.org; Mon, 30 Jan 2023 11:33:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pMX5Z-0005Oo-QW for bug-guix@gnu.org; Mon, 30 Jan 2023 11:33:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#61055: file-needed/recurive does not canonicalize paths Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 30 Jan 2023 16:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61055 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Lars-Dominik Braun Cc: 61055@debbugs.gnu.org Received: via spool by 61055-submit@debbugs.gnu.org id=B61055.167509634220705 (code B ref 61055); Mon, 30 Jan 2023 16:33:01 +0000 Received: (at 61055) by debbugs.gnu.org; 30 Jan 2023 16:32:22 +0000 Received: from localhost ([127.0.0.1]:50213 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMX4w-0005Ns-3a for submit@debbugs.gnu.org; Mon, 30 Jan 2023 11:32:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39736) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMX4s-0005NZ-Fp for 61055@debbugs.gnu.org; Mon, 30 Jan 2023 11:32:20 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMX4m-0002ZE-0e; Mon, 30 Jan 2023 11:32:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=H1iM88RAWkxrspNn+taXSdWjj43C9BCF4dHt5bAK6vk=; b=iIkrerr5DkUc237QK7U1 clb3CDwvLvhyEadtqz5vq+E0oPT0bqhhVN4MdGCYzn/MOwbaMz4/TXybVrWhrlCM27ShtGor2xbBO 8QpigOqHJIYsLjjOm84I++RpLVcYe/CbLaYX+Q+PQLcz/Z0ya5/kJqYy71goIlOAtjTYKn0Izg7/t uSt4EGz20lCxnGmZuJy9I8xuzPBO359oXPI/KKeVpEX3eKoh6qh3X1FB97wsHjfvdPoOTBcVczMuX qdX2dsTk13gdRF8C7eFpYorujkhftJiRCLmynKBCLy8ckM/7J6V6FQp0g+6uqWqttQHuBM1QtYdfq Wj+7HgyPrzWUvg==; Received: from [193.50.110.131] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMX4R-0007Tn-3z; Mon, 30 Jan 2023 11:32:10 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: Date: Mon, 30 Jan 2023 17:31:49 +0100 In-Reply-To: (Lars-Dominik Braun's message of "Wed, 25 Jan 2023 11:23:58 +0100") Message-ID: <87ilgoyoei.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1675096401; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=H1iM88RAWkxrspNn+taXSdWjj43C9BCF4dHt5bAK6vk=; b=tuMQmlqxFV2dxxVW2e7/Xm3Z20Gswu3z8LkiOCG2mpYr9i6AQP4adaWZ80X6T+q/km2BjJ 6dG+RPI661GTLqyENNMEdR75GU6Asqq9YiZn233aPAiC8VOjY5n+hdzdSct6nYbChW4CBu +sYdCCFeNeZXo9utFmdfUjeSDxxp8hZ4QfEpU22LIh//jv248LTjec/AMx3os4x0uSjZpu 6/lTSMV2B5w4rfWgUWzvMUZ3rLxcbVeoYX1Yvyk2ZQiEuRTrgOpWOA/jBgjWvyUTmrlh+Z jnRj+jTBkSeYtHXtFtTdwZolOPxqS6qGmICZbgI5GthKK2E/OCXC1m+1Maf7/w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=iIkrerr5; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1675096401; a=rsa-sha256; cv=none; b=lEuPLOSGoG4OWhenVAzegwhi7x8GV+KX5H/l+vPySxiBSf5vRvaCqW82S7t8W5Mr5BkF8m CraG8E6jOC6fMaS61+3j7ftunaMFGJIvyXPrEwSyvkmFmG2hhWeongagC1BKv5Eu06Fhg1 8z4fzg/0iGM3zWVayUGELnHXZzE1A6qMiKnZ2TRRyEkd9h4x2FovwB5BdcVzW1/uQ7D53H MzKZFMWGhlzzeXVXy27KQqIXjc6Q3Luf2w25UiOo6j51IDBgfkDw4bJTKqk5o+/751ZNLW nVNCth25T/m46xmVzYpr4Hvbv5rTPOnHyAIkj+Yty1NS2oeIx75TmDHgQt17fQ== Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=iIkrerr5; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org X-Migadu-Scanner: scn0.migadu.com X-Spam-Score: -3.88 X-Migadu-Queue-Id: 033B82E9C2 X-Migadu-Spam-Score: -3.88 X-TUID: 1SyyGEYtKJHy Hi Lars, Lars-Dominik Braun skribis: > during testing of wip-haskell I observed the make-dynamic-linker-cache > phase is taking alot of time (up to two minutes on a fast machine with > SSD). Looking at ghc-hindent for example [1]: > > starting phase `make-dynamic-linker-cache' > created '/gnu/store/2nrzbaxmqs2rq9yv52bpyn2azb3qj6h1-ghc-hindent-5.3.= 4/etc/ld.so.cache' from 10085 library search path entries > phase `make-dynamic-linker-cache' succeeded after 119.5 seconds > > And while Haskell packages link to a pretty large number of dynamic > libraries (116 in this case), 10000 search path entries seems wrong. Runn= ing just > > (file-needed/recursive "/gnu/store/2nrzbaxmqs2rq9yv52bpyn2azb3qj6h1-g= hc-hindent-5.3.4/bin/hindent") > > takes a long time and reveals entries like > /gnu/store/1cyk8j2nd6r0cvm6kx1408kd763yf8h5-ghc-9.2.5/lib/ghc-9.2.5/Cabal= -3.6.3.0/../directory-1.3.6.2/../unix-2.7.2.2/../bytestring-0.11.3.1/../tem= plate-haskell-2.18.0.0/../pretty-1.1.3.6/../array-0.5.4.0/../base-4.16.4.0/= ../ghc-bignum-1.2/../ghc-prim-0.8.0/libHSghc-prim-0.8.0-ghc9.2.5.so > so it looks like it deduplicates values, but does not canonicalize > paths. A relatively straight-forward fix could be the following change, > but I don=E2=80=99t know if that would cause any issues, since canonicali= ze-path > throws an exception if the resulting path does not exist. It=E2=80=99s al= so > a world rebuild since pretty much any package uses this phase (and the > reason and I cannot test it on a larger scale). Right. Other arguments against systematic canonicalization: (1) =E2=80=98canonicalize-path=E2=80=99 is costly, (2) developers and tools mig= ht choose to write =E2=80=98x/y/../z=E2=80=99 for a good reason and changing that could = break their expectations. Can you see how we end up with those entries? These at DT_NEEDED entries, not DT_RUNPATH, right? If so, that probably means that ghc at some points invokes the linker along the lines of: ld -o hindent ../foo/../bar/../baz/libbaz.so Could you check in build logs exactly how that executable gets linked? Is there a way we could canonicalize there, or, better, get the build system to do something like: ld -o hindent -L ../foo/../bar/../baz -lbaz ? That way DT_NEEDED would be just =E2=80=9Clibbaz.so=E2=80=9D instead of = the complete file name. DT_RUNPATH would contain the weird file name, but that=E2=80=99s probably okay. HTH, Ludo=E2=80=99.